My end goal is to create a single FFmpeg command that will convert my h264.DTS.mkv files to a format that is compatible with my AppleTV, whilst preserving the original quality.
I'm almost there, however I have not been able to figure out how to disable streams/tracks.
So far I have got:
ffmpeg -i FILE \
-y -strict experimental \
-map 0:0 -map 0:1 -map 0:1 -map 0:1 -map 0:2 \
-c:0 copy -c:1 aac -ac:a 2 -c:2 ac3 -ac:a 6 -c:3 copy -c:4 mov_text \
OUTPUT
This produces an output file that looks like:
The problem is I need it to look like:
Hence I need to know how I can disable the non-1st Audio Streams/Tracks.
From what I have read, this is part of the track header atom at the location "tkhd.flags". But I have not been able to figure out how to set this via command line arguments.
Any help would be greatly appreciated.
Hello Dipesh this will solve your problem.
What you seek to accomplish is to flag which audio stream will be default, while negating this flag on all undesired audio streams. This solution will be similar when attempting to select which (if any) subtitle track will be default and/or possibly forced.
FFmpeg will automatically flag all streams to default
without user intervention. Therefore we first need to flag all streams -default
and then flagdefault
the one desired as default. Let us use an audio stream for the example.
-disposition:a -default -disposition:a:0 default
The result of the statement above flags all audio streams -default
and the first audio stream to default
.
Details on its use can be found in the FFmpeg Documentation under 5.4 Main options.
ffmpeg -i FILE \
-y -strict experimental \
-map 0:0 -map 0:1 -map 0:1 -map 0:1 -map 0:2 \
-c:0 copy -c:1 aac -ac:a 2 -c:2 ac3 -ac:a 6 -c:3 copy -c:4 mov_text \
-disposition:a -default -disposition:a:0 default \
OUTPUT
In the solution -disposition:a -default
flags all audio streams in the output file to not default. While -disposition:a:0 default
flags the first audio stream in the output file to default.
Did you check this: http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20use%20-map%20option Just don't copy the streams that you do not need to the output.
ffmpeg -i FILE \
-y -strict experimental \
-map 0:0 -map 0:1 -map 0:4 \
-c:0 copy -c:1 aac -ac:a 2 -c:4 mov_text \
OUTPUT
I hope I got yout question correctly!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With