[FFmpeg-user] FFMPEG 3.3.2 audio copy conversion question

Adam Gendron adamgs2009 at hotmail.com
Wed Oct 11 23:29:22 EEST 2017


Not sure if this is the correct place to ask this, but I have a question about FFMPEGs workflow for copying and converting an audio stream in one operation:

What I'm trying to do is convert some "home video" from mkv to mp4. Video codec is from one mpeg2 stream to one h264 stream, this works fine. Audio codec is one AC3 192kpbs "Dolby Surround" stream. With the audio conversion, I'm trying to copy the original audio stream to the output, as well as convert that original audio stream to 2ch aac 128kpbs while retaining the "dolby surround" matrix encoding (OR just converting to 2ch aac 128kbps stereo) for compatibility (e.g. Windows Media Player on older PCs doesn't support AC3, as well as some older video players for portable media players). What I am getting when I attempt to map the original stream to 0:a:0 for the copied stream and 0:a:1 for the converted audio stream is "filtering and streamcopy cannot be used together". Now, I imagine that is because I am using the audio filter "aresample=matrix_encoding=dplii". Command Line:

for %%D in (*.mkv *.mp4) do ffmpeg -report -i "%%D" -filter_complex "[0:v]yadif=1:-1:1,fps=60000/1001;[0:a]aresample=matrix_encoding=dplii" -map 0:0 -c:v libx264 -preset veryslow -crf 21 -tune film -map 0:1 -c:a:0 copy -map 0:1 -c:a:1 aac -ac:a:1 2 -b:a:1 128k -cutoff:a:1 18000 -map 0:2 -c:s copy -movflags +faststart -threads 1 "%%~nD [480p x264].mp4"

for %%D in (*.mkv *.mp4) do ffmpeg -report -i "%%D" -map 0:0 -map 0:1 -map 0:1 -map 0:2 -c:v libx264 -preset veryslow -vf "yadif=1:-1:1,fps=60000/1001" -crf 21 -tune film -c:a:0 copy -c:a:1 aac -ac:a:1 2 -b:a:1 128k -cutoff:a:1 18000 -af:a:1 aresample=matrix_encoding_dplii -c:s copy -movflags +faststart -threads 1 "%%~nD [480p x264].mp4"

Thanks in advance.

More information about the ffmpeg-user mailing list