as an example: I have 2 MKV videos with
3 audio streams (English, French and Mandarin)
2 subtitle streams (English and Mandarin)
The streams can appear in any order. like on the first video, Mandarin is the first audio stream but on the 2nd it's using French. Same situation with subtitle.
what I want to auto-select the Mandarin audio and English subtitle without having to specify the stream number (like using -map perhaps?).
Is this possible? If yes, how?
Thanks!
+ Reply to Thread
Results 1 to 6 of 6
-
-
You'll have to rely on that the proper language code is set and it is not merely using "Undetermined".
But you could use MKVBatch to mux a filteret file to use with ffmpeg.
Or a batch job using ffprobe/mediainfo to find the stream numbers and set the ffmpeg command accordingly. (if you would call that auto select) -
You can use:
Code:-map 0:s:language:ISO?
Code:-map 0:s:language:eng?
Code:-map 0:a:language:ISO?
-
as a test, I tried your suggestion using an MKV I have in my laptop.
It's has a single audio stream + many many subtitle streams. As an example, there are eng, ger, ita and many more subtitle streams. I got the subtitle language/language code by parsing the MKV file via ffprobe. Also according to ffprobe, eng is the default subtitle stream.
as a test, I tried this command:
Code:-i INPUT.mkv -map 0:0 -map 0:1 -map 0:s:language:ita? -vcodec copy -acodec copy -scodec mov_text OUTPUT.mp4
As another test, I tried:
Code:-i INPUT.mkv -map 0:0 -map 0:1 -map 0:s:language:ita -vcodec copy -acodec copy -scodec mov_text OUTPUT.mp4
Any ideas what I could be doing wrong? Thanks! -
Not used this for very long time and i can't verify this (have no source with many language sub currently) but i use slightly different way of writing ffmpeg script - perhaps this will help?
Code:-i INPUT.mkv -c:v copy -c:a copy -map 0:s:language:ita? -c:s mov_text OUTPUT.mp4
Similar Threads
-
FFMPEG: can "select" audio channels using -acodec copy?
By marcorocchini in forum Newbie / General discussionsReplies: 9Last Post: 25th Feb 2015, 19:04 -
Audio stream mixing and mapping in ffmpeg
By encodingmonkey in forum AudioReplies: 0Last Post: 30th Dec 2013, 19:50 -
Audio auto-muting & video player auto-stopping
By Godsninja in forum AudioReplies: 3Last Post: 26th Aug 2013, 15:11 -
After processing with FFMPEG, some video has no audio when played via HTML5
By vertigoelectric in forum Video Streaming DownloadingReplies: 4Last Post: 18th May 2013, 06:28 -
Audio Stream Mixing in FFMPEG
By encodingmonkey in forum AudioReplies: 2Last Post: 9th May 2013, 02:38