Hi,
is there any way to demux only the audio and subtitle streams from a matroska file, independently how many streams the matroska has? lets say i habe a file with 2 audio streams and 2 subtitle streams. when the file should demux 4 streams, when the matroska includes 3 audios streams and 3 subtitle, 6 streams should be demuxed. all this without the need to set up something manual. i don't want to check how many streams includes to the file first and then manually create a command line with the streams to demux.
can ffmpeg do this? first check what input streams are audio or subtitle and then in a second step put only these streams into a command line and demux them?
i know i can check that using ffprobe. streams 0:1 and 0:2 are audio and 0:3 and 0:4 are subs. but i have no idea how to create a command line for ffmpeg or an other tool from that.
+ Reply to Thread
Results 1 to 10 of 10
-
-
You should be able to do it with MKVCleaver.
Open an MKV and on the right is the batch mode section. If an MKV has a single audio stream you'll see Audio1 in the list. If an MKV has two audio streams you'll see Audio1 and Audio2 etc. The same applies to subtitle streams. Just check all the relevant streams and extract, whether you open a single MKV or multiple MKVs. -
gMKVExtractGUI also has a batch mode these days but it doesn't work quite the same way. It'll show you the streams in each MKV but you have to manually check the streams you wish to extract from each one.
-
i'm on linux, not windows. sorry.
i dont search a tool with batch mode, i want to use the comnand line in a context menu with kde. -
Example 7 is nearly what i search. With this command
Code:ffmpeg -i input.mkv -map 0:a -c copy output.mkv
in eac3to i can do this with
Code:eac3to input -demux
-
You can demux if you specify the audio format in output e.g. for aac audio:
ffmpeg -i input.mkv -map 0:a -c copy output.m4a
ffmpeg -i input.mkv \
-map 0:v -c copy video.mkv \
-map 0:a:0 -c copy audio0.m4a \
-map 0:a:1 -c copy audio1.m4a \
-map 0:a:2 -c copy audio2.m4a \
-map 0:s -c copy sub.assLast edited by blud7; 11th Mar 2018 at 08:12.
-
And if you put a trailing question-mark after the stream specifier, you won't get an error if the stream doesn't exist. So you can include the maximum number you anticipate.
Similar Threads
-
Matroska text file attachment
By Bigo2 in forum Software PlayingReplies: 10Last Post: 12th Jul 2022, 08:30 -
Open a Matroska file directly in gMKVExtractGUI
By Valit in forum Video ConversionReplies: 7Last Post: 11th Feb 2018, 12:34 -
Which "demux" program extracts audio & video from various file formats?
By jaibubwan in forum EditingReplies: 11Last Post: 18th Oct 2017, 14:20 -
Authoring a DVD using a Matroska File
By efiste2 in forum Authoring (DVD)Replies: 1Last Post: 21st Aug 2014, 08:38 -
Demux TS file
By roglopes in forum Video ConversionReplies: 34Last Post: 27th Jun 2013, 01:52