title: FFMPEG set volume in amix
body: <p>I've been trying to mix an audio mp3 with a video mp4 while retaining the mp4 audio. This is working with . </p>
  
  <pre><code>ffmpeg -y  -i video.mp4 -i audio.mp3
   -filter_complex "[0:a][1:a]amix=inputs=2:duration=longest[out]" 
   -map 0:v -map [out] output.mp4
  </code></pre>
  
  <p>I'm now trying to adjust the volumes of the sound files (video 0.5, audio 1) as part of the mix. </p>
  
  <p>I've been trying things like</p>
  
  <pre><code>ffmpeg  -i 020c276b-face-4bb3-9169-e8969c1232ba.mp4 -i test.mp3 -filter_complex 
   "[0:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo,volume=0.5[a1]; 
    [1:a]aformat=sample_fmts fltp:sample_rates=44100:channel_layouts=stereo,volume=0.8[a2]; 
    [a1][a2]amerge,pan=stereo:c0&lt;c0+c2:c1&lt;c1+c3[out]"-map 1:v -map [out]
    -c:v copy -c:a aac -strict -2  output2.mp4`
  </code></pre>
  
  <p>And I get errors such as </p>
  
  <blockquote>
    <p>[Parsed_aformat_2 @ 037f8620] Error parsing sample format: sample_fmts
    fltp. [AVFilterGraph @ 038be620] Error initializing filter 'aformat'
    with args 'sample
    _fmts fltp:sample_rates=44100:channel_layouts=stereo' Error initializing complex filters. Invalid argument</p>
  </blockquote>
  
  <p>Does anyone know how to make the code I've code above that is working, also change the volume of the inputs? </p>
  
  <p>Thanks</p>