VideoHelp Forum




+ Reply to Thread
Results 1 to 10 of 10
  1. 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.
    Quote Quote  
  2. 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.
    Quote Quote  
  3. 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.
    Quote Quote  
  4. 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.
    Quote Quote  
  5. Member
    Join Date
    Jul 2016
    Location
    United Kingdom
    Search PM
    eac3to should be able to do this. You may need to look up the parameter for only audio and subs.
    Quote Quote  
  6. eac3to is one of the tools i thought about. but i have no idea how to check what streams are audio or subs first and then create a command line.

    eac3to runs good with wine on linux.
    Quote Quote  
  7. 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?
    Yes you can do this with ffmpeg using the -map function.
    Quote Quote  
  8. Example 7 is nearly what i search. With this command

    Code:
    ffmpeg -i input.mkv -map 0:a -c copy output.mkv
    i can copy only the audio files into the output file - but its one file, not ne file per stream. its not a real demux, its "copy into a new matroska file". it seems there isn't a demux function in ffmpeg that can demux into separate files with specify it manually?

    in eac3to i can do this with

    Code:
    eac3to input -demux
    Quote Quote  
  9. 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
    and you can demux several streams at once like so:

    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.ass
    In each case specify the correct filetype like maybe ac3 audio or srt subtitle etc. (the example above assumed aac audio and ass subs.)
    Last edited by blud7; 11th Mar 2018 at 08:12.
    Quote Quote  
  10. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    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.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!