Demuxing in MediaCoder

Discuss about generic usage of MediaCoder.

Moderator: HuggiL

meRobs
Expert
Expert
Posts: 3116
Joined: Tue Jun 23, 2009 2:45 pm
Location: Sydney, Australia

Demuxing in MediaCoder

Postby meRobs » Tue Aug 02, 2011 11:52 am

[Updated 4 Feb 2013]

MediaCoder is a GUI (Graphical User interface) that allows users access to a variety of utilities and Codecs that lie “under its hood” -- utilities such as FFmpeg and MEncoder. As a result, MediaCoder is able to convert almost any audio/video format into almost any other.

This is its main function. However, it is also able to do other things, one example being Demuxing, the subject of this Guide. Remember, though, that MediaCoder is limited by what its utilities can do. If you want more, I suggest you try a dedicated Demuxer App.

In recent times there have been a number of questions and problems that relate to demuxing, and, in some cases, there is a clear mis-understanding of what demuxing is! So, what is it?

I’ll begin with ‘Muxing’, short for Multiplexing. This is the combining of individual audio, video and subtitle (text) files into one file. On the other hand, demuxing is the opposite. It is from the verb ‘to demux’ and is short for ‘de-multiplexing’. It means the splitting of an audio/video file into separate files, one for each of its constituent streams. Strictly speaking, demuxing does not involve encoding or in any way modifying any of the streams.

1. Set up MediaCoder

To demux a source file: set the Task Mode (small panel at far right, just below the Properties panel) to “Demux” – see also the Note below. Choosing the Demux mode will set up the Demuxer tab (8th from the left) and prevent MediaCoder from responding to the video and audio tabs. It should also ignore the Container, Picture and Sound tabs, etc.
To keep this combination as a Preset, I recommend that you begin with a Starter Preset, as explained in viewtopic.php?f=17&t=8131 instead of Revert All Settings – for the reasons given in that Guide.

On the Demuxer tab, 8th from the left, two of the three check boxes would now be checked. They are: the individual check boxes for Demuxing the audio and video streams. Also, MPlayer should appear as the default Demuxer. I tested that this was so for builds 4797, 5175, 5300, 5342 and 5355.

Also, you may set the extensions that will be used in the output filenames (see next section).

NOTE: it is not enough to merely tick the check boxes on the Demuxer tab, while leaving the Task Mode at its default setting (‘Normal’). A click on the “Start” button would then cause MediaCoder to hang up in the Pre-processing phase, or the ‘Testing Stage’ in early builds. I tried this in for builds 4640, 4740, 4797 and 5176. In other words, for these builds at least, MediaCoder does not allow demuxing and conversion at the same time.

2. Set output Extensions

Also on the Demuxed tab is the option to set the extensions for the output (demuxed) video and audio files, via the “File Ext. for Audio” and “File Ext. for Video” boxes. The file extension is the set of characters after the last dot (“.”) in the filename.

You may set whatever you think would be appropriate here, such as “ac3” for the audio from a VOB source file and “m2v” or “mpv” for its video file. Whatever you enter will be used as the extension, even if silly, although it may not be acceptable by your player. Of course, the extensions may later be changed using the Rename function of Explorer, etc.

On the other hand, you may also leave these boxes empty. Then, MediaCoder will add the correct extensions in some cases, such as for AC3, MPA and AAC audio and for MPEG2 video (“mpv”), it will guess incorrectly for some types or just leave the extensions blank. Fix with Rename!

Regardless of what you set (or not) for the extensions, demuxing will still output the video and audio streams. In build 5175, I was able to demux VOB files as well as the files that resulted from the use of all options in the Encoding Guide (viewtopic.php?f=17&t=9643) except demuxing an MP4 source file gave an AAC audio file that had its data present but was not playable because the header was incomplete! The video, given the M4V extension played correctly. This was also the case in build 5355-58 (see bug report: viewtopic.php?f=28&t=12496 ).

Note: if Demuxing fails for your file, you could use DGIndex, a freebie.

Output filenames: if the source file is “corename.vob”, for example, the demuxed output files will be “corename.vob-audio-128” and “corename.vob-video-0” plus whatever extensions are added. Hence, even without the extensions, the type of media can still be judged from the file name. The included numbers appear to be the stream IDs.

3. Multi-audio source File

MediaCoder builds 4640, 4740, 4797 and 5176, at least, would demux only the first audio stream in a multi-audio source file. Any attempt to set other than the first audio ID (default) in these builds triggered a non-specific error message from MediaCoder and no file was output!

If you want to demux all the audio streams in a multi-audio file use a dedicated demuxing App like DGIndex (free, but will not demux any subtitle streams, if present).

4. Loss of initial Frames when Demuxed

I compared the results of demuxing VOB files in MediaCoder 5176 and in DGIndex. I used a single-audio VOB and VOBs with 3 audio streams, one with subtitle streams and one without. Whereas, the demuxed audio output (first audio for the Multi-audio cases) from all three VOBs had the same file size (in kB) and the same durations displayed in a software player, as those from DGIndex, the demuxed video files from MediaCoder were slightly smaller.

To examine what had happened for the video, I examined the results in AVIdemux, which first indexes an MPG file and then allows incrementing through the file, frame by frame or by I-frame. The result: all frames earlier than the first I-frame in the demuxed video files were missing from those by MediaCoder. For the single-audio VOB there was 2 video frames missing and for each multi-audio VOB, there were 4 missing. All other frames were present and correct.

I checked the importance of this finding by feeding a number of VOBs from two DVDs into Gspot. In all cases, the first VOB of a VTS group (movie) began with an I-frame, but, virtually all other VOBs in that group began with a B-frame. In these cases, MediaCoder would lose the early frames in a Demux (up to the first I-frame). For a DVD in PAL (or NTSC), which usually has a GOP length of 12 frames (16 for NTSC), up to this many (~0.5 sec) could be lost, with an average loss of maybe half this. According to Stanley, the developer of MediaCoder, the loss of these early frames cannot be avoided (relates to the Demuxer?). For a description of the different frame types and GOP see the Guide: viewtopic.php?f=17&t=8599&start=0.

This may not be as bad as it sounds, since the loss does not apply to the first VOB of a VTS group, and out-of-sync issues are likely when you consider other than the first VOB (see: viewtopic.php?f=17&t=8082&start=0).
Have you checked out the Tips & Guides for MediaCoder? Try: http://forum.mediacoderhq.com/viewtopic.php?f=17&t=8061
Also, get older builds at: http://www.videohelp.com/tools/MediaCoder/old-versions#download
meRobs
Expert
Expert
Posts: 3116
Joined: Tue Jun 23, 2009 2:45 pm
Location: Sydney, Australia

Re: Demuxing in MediaCoder

Postby meRobs » Tue Aug 02, 2011 11:54 am

The above Topic has been added to the Tips & Guides section (link below).
Have you checked out the Tips & Guides for MediaCoder? Try: http://forum.mediacoderhq.com/viewtopic.php?f=17&t=8061
Also, get older builds at: http://www.videohelp.com/tools/MediaCoder/old-versions#download

Return to “Generic Discussions”

Who is online

Users browsing this forum: No registered users and 13 guests