VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 3 of 3
  1. I want to convert this source MP4 video containing AC3 5.1 audio to stereo, but also copy (passthru) the same audio stream as a secondary soundtrack in the output file.

    ffmpeg -i SOURCE.MP4 -map 0:v -c:v copy -map 0:a -c:a:0 mp3 -ac:a:0 2 -filter_complex "[0:a:0]aresample=matrix_encoding=dplii" -map 0:a -c:a:1 copy OUTPUT.MP4
    The result is a video with ONE audio stream: just the converted mp3, and it ignores the audio "copy" command to create a secondary soundtrack: the untouched AC3 5.1 audio. (I know Handbrake does this flawlessly, but I don't want to re-encode the video stream which Handbrake requires).

    Any help would be appreciated.
    Quote Quote  
  2. Member
    Join Date
    Aug 2010
    San Francisco, California
    Search PM
    Create two inputs to the same file:

    ffmpeg -i SOURCE.MP4 -i SOURCE.MP4 -map 0:v -c:v copy -map 0:a -c:a:0 mp3 -ac:a:0 2 -filter_complex "[0:a:0]aresample=matrix_encoding=dplii" -map 1:a -c:a:1 copy OUTPUT.MP4
    Quote Quote  
  3. I modified one of my scripts - not tested but should work, audio track is copied and at the same time stereo version with small dynamics compression and level normalization encoded as mp3 and added as second audio track

    ffmpeg.exe -i source.mp4 -map 0:v -c:v copy -map 0:a -c:a:0 copy -filter_complex "[0:a:0]pan=stereo|FL < FL + 1.414FC + .5BL + .5SL + .25LFE + .125BR|FR < FR + 1.414FC + .5BR + .5SR + .25LFE + .125BL,dynaudnorm=p=1/sqrt(2):m=100:s=10,firequalizer=gain='if(gte(f,42),0,-INF)+if(lte(f,13749),0,-INF)':accuracy=1:fixed=on:delay=0.05,asetpts=PTS-0.05/TB[a2c]" -map [a2c]:1 -c:a:1 libmp3lame -q:a:1 6 -map 0:s -c:s copy -f matroska source.mkv
    Last edited by pandy; 24th Jun 2016 at 09:31.
    Quote Quote  

Similar Threads