Hi all, I have some video files with a DTS audio stream. I'm trying to add a couple of additional audio streams into the file, transcoded from the DTS stream. My command line is: ffmpeg -i "${input}" -map 0:0 -map 0:1 -map 0:1 -map 0:1 -c:v copy -movflags +faststart -c:a:0 aac -b:a:0 192k -ac 2 -metadata:s:a:0 title="AAC Stereo Audio" -c:a:1 ac3 -ac 6 -metadata:s:a:1 title="AC3 5.1 Audio" -c:a:2 copy -disposition:a -default -disposition:a:0 default -f mp4 "${output}.mp4" However, this isn't doing exactly what I expected. The output is: Output #0, mp4, to 'output.mp4': Metadata: Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1036 [SAR 1:1 DAR 480:259], q=2-31, 23.98 fps, 23.98 tbr, 16k tbn, 1k tbc (default) Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 192 kb/s (default) Metadata: title : AAC Stereo Audio Stream #0:2(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1, fltp, 448 kb/s Metadata: title : AC3 5.1 Audio Stream #0:3(eng): Audio: dts (DTS) (mp4a / 0x6134706D), 48000 Hz, 5.1(side), fltp, 1536 kb/s Note that Stream #0:1 is being output as AAC 5.1 instead of AAC stereo. How come the -ac 2 flag is being ignored - do I need to specify which stream this applies to, and if so how? Thank you all Ant.
Because you three times specify -map 0:1. Check stream.mapping. wt., 17 kwi 2018, 05:45 użytkownik antony baxter <antony.baxter@gmail.com> napisał:
Hi all,
I have some video files with a DTS audio stream. I'm trying to add a couple of additional audio streams into the file, transcoded from the DTS stream. My command line is:
ffmpeg -i "${input}" -map 0:0 -map 0:1 -map 0:1 -map 0:1 -c:v copy -movflags +faststart -c:a:0 aac -b:a:0 192k -ac 2 -metadata:s:a:0 title="AAC Stereo Audio" -c:a:1 ac3 -ac 6 -metadata:s:a:1 title="AC3 5.1 Audio" -c:a:2 copy -disposition:a -default -disposition:a:0 default -f mp4 "${output}.mp4"
However, this isn't doing exactly what I expected. The output is:
Output #0, mp4, to 'output.mp4': Metadata: Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1036 [SAR 1:1 DAR 480:259], q=2-31, 23.98 fps, 23.98 tbr, 16k tbn, 1k tbc (default) Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 192 kb/s (default) Metadata: title : AAC Stereo Audio Stream #0:2(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1, fltp, 448 kb/s Metadata: title : AC3 5.1 Audio Stream #0:3(eng): Audio: dts (DTS) (mp4a / 0x6134706D), 48000 Hz, 5.1(side), fltp, 1536 kb/s
Note that Stream #0:1 is being output as AAC 5.1 instead of AAC stereo.
How come the -ac 2 flag is being ignored - do I need to specify which stream this applies to, and if so how?
Thank you all
Ant. _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
Am Dienstag, den 17.04.2018, 04:30 +0000 schrieb Marcin W.:
Because you three times specify -map 0:1. Check stream.mapping. Multiple 'map' parameter are the way to create new output streams from same source streams.
wt., 17 kwi 2018, 05:45 użytkownik antony baxter <antony.baxter@gmail.com>
napisał:
Please don't top post! Bye Frank
Hi all,
I have some video files with a DTS audio stream. I'm trying to add a couple of additional audio streams into the file, transcoded from the DTS stream. My command line is:
ffmpeg -i "${input}" -map 0:0 -map 0:1 -map 0:1 -map 0:1 -c:v copy -movflags +faststart -c:a:0 aac -b:a:0 192k -ac 2 -metadata:s:a:0 title="AAC Stereo Audio" -c:a:1 ac3 -ac 6 -metadata:s:a:1 title="AC3 5.1 Audio" -c:a:2 copy -disposition:a -default -disposition:a:0 default -f mp4 "${output}.mp4" If you not specifiy the right mapping index by 'ac' parameter it will default to zero. In your case '-ac 6' will overwrite '-ac 2'. Use '- ac:1 2' and '-ac:2 6' and you will get what you expected. Please take care of the different index numbers between 'ac' and '-b:a' for example. It is related to the map paramter not to the related audio output stream index. The '-ac:2 6' parameter can safely be deleted, because the channel definition will be taken from the source stream. For a better reading (and in some cases the order has an impact to ffmpeg) you should order your parameter a little bit. Write all related
Am Montag, den 16.04.2018, 16:02 -0400 schrieb antony baxter: parameters together directly behind the corresponding '-map'. '-f' parameter can be deleted as well, ouput file extension give the hint for ffmpeg autodetection. ffmpeg -i "${input}" -map 0:0 -c:v copy -movflags +faststart -map 0:1 -c:a:0 aac -b:a:0 192k -ac:1 2 -metadata:s:a:0 title="AAC Stereo Audio" -disposition:a:0 default -map 0:1 -c:a:1 ac3 -ac:2 6 -metadata:s:a:1 title="AC3 5.1 Audio" -map 0:1 -c:a:2 copy -f mp4 "${output}.mp4" I deleted '-disposition:a -default', because it will not work in this way, IMHO Bye Frank P.S.: It is untested!
On Tue, Apr 17, 2018 at 22:24:12 +0200, Frank Haefemeier wrote:
Am Montag, den 16.04.2018, 16:02 -0400 schrieb antony baxter:
I have some video files with a DTS audio stream. I'm trying to add a
If you not specifiy the right mapping index by 'ac' parameter it will default to zero.
Sorry, Frank, I had missed that you had already answered Antony's question when I wrote mine. Moritz
On Mon, Apr 16, 2018 at 16:02:53 -0400, antony baxter wrote:
I have some video files with a DTS audio stream. I'm trying to add a couple of additional audio streams into the file, transcoded from the DTS stream. My command line is:
ffmpeg -i "${input}" -map 0:0 -map 0:1 -map 0:1 -map 0:1 -c:v copy -movflags +faststart -c:a:0 aac -b:a:0 192k -ac 2 -metadata:s:a:0 title="AAC Stereo Audio" -c:a:1 ac3 -ac 6 -metadata:s:a:1 title="AC3 5.1 Audio" -c:a:2 copy -disposition:a -default -disposition:a:0 default -f mp4 "${output}.mp4"
However, this isn't doing exactly what I expected. The output is: [...] Note that Stream #0:1 is being output as AAC 5.1 instead of AAC stereo.
How come the -ac 2 flag is being ignored - do I need to specify which stream this applies to, and if so how?
It's being overridden by the second "-ac" flag. Note that you can make this more specific, and it should actually work: -ac:a:0 2 -ac:a:1 6 -ac:a:2 6 Moritz
participants (4)
-
antony baxter -
Frank Haefemeier -
Marcin W. -
Moritz Barsnick