VideoHelp Forum
+ Reply to Thread
Results 1 to 12 of 12
Thread
  1. Member
    Join Date
    Mar 2012
    Location
    Orlando
    Search Comp PM
    Hello all,

    Not to sound redundant as I've asked this question before, but I really need a program, like tsMuxer GUI, to demux the elementary streams (tracks) of an AVI container without ANY conversion.

    I maintain a Media Server system with movies, home videos, photos, music, etc. For movies, I regularly convert my BD's (m2ts) and DVD's (vob>mp4) to a more compact file size (20+GB to ~6GB, or ~6Mbps) so I can stream them via my Media Server, not to mention a much more manageable files size for storage. In this process, there are instances where a straight BD conversion has to be manipulated to the point where it ends up in the AVI format. However, there's times, especially where I wish to re-edit an existing video, where I need to demux the video and audio tracks, edit say the audio file to add a music track, etc., then remux it again. Working in the m2ts format is a breeze, mostly due to the invaluable tsMuxer GUI program.

    I can do this now, but only by doing a re-conversion from the AVI format to ts, then use tsMuxer to convert that to m2ts, demux and edit, then remux the whole shebang back to the edited m2ts.It's certainly not like the old VHS days, where after about 2-3 copies of a copy, and the video looks like it was washed out. TG for digital video, but here too, there is a point where after multiple conversions, the video quality starts to suffer due the the level on compression used.

    In the past, I've had some recommendations, like Avidemux, but that along with other programs I've tried only does conversions to another format, which is NOT what I need. I realize that tsMuxer's designers had a specific purpose in mind, sticking with most popular containers, except for an AVI type.

    Any recommendations would be greatly appreciated.

    Thanks,
    Bill
    Quote Quote  
  2. ffmpeg can demux/remux pretty much anything. For example, these two lines in a batch file will demux h.264 video and aac audio to elementry streams when you drag/drop an MP4 file onto it:

    Code:
    ffmpeg -i %1 -vcodec copy %~n1.h264
    ffmpeg -i %1 -acodec copy %~n1.aac
    Or this batch file will remux to an MKV file.

    Code:
    ffmpeg -i %1 -c copy %~n1.mkv
    But some codecs aren't suitable for some containers. What codecs are used in your AVI files?
    Quote Quote  
  3. Member
    Join Date
    Mar 2012
    Location
    Orlando
    Search Comp PM
    I'm using the Xvid AVI codec (built into Xilisoft Video Converter).

    Originally Posted by jagabo View Post
    ffmpeg can demux/remux pretty much anything. For example, these two lines in a batch file will demux h.264 video and aac audio to elementry streams when you drag/drop an MP4 file onto it:

    Code:
    ffmpeg -i %1 -vcodec copy %~n1.h264
    ffmpeg -i %1 -acodec copy %~n1.aac
    Or this batch file will remux to an MKV file.

    Code:
    ffmpeg -i %1 -c copy %~n1.mkv
    But some codecs aren't suitable for some containers. What codecs are used in your AVI files?
    Quote Quote  
  4. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    What's wrong about VirtualDubMod, VirtualDub-FilterMod, AviMux-GUI?

    I understand that most tools working specifically with the AVI container may not include the feature to demultiplex a raw video stream, because most historical video formats were unidentifyable outside the AVI container. Multiplexing modern video formats like MPEG-4 AVC or HEVC into the AVI container is not recommendable because the container does not support specific attributes of such video formats anymore, but some software (like OTVR's) still do so; here it is most recommendable to use a multiplexer of the desired container to import from the AVI.
    Last edited by LigH.de; 5th Sep 2017 at 02:18.
    Quote Quote  
  5. x264vfw can output h.264 elementary streams (bypassing AVI output in VFW based programs).

    You can remux xvid/AVI to m2ts with:

    Code:
    ffmpeg -i %1 -c copy "%~n1.m2ts"
    Also to mov or mp4 by changing the extension.
    Quote Quote  
  6. Member
    Join Date
    Mar 2012
    Location
    Orlando
    Search Comp PM
    These are all god programs in their own right, but again, all these want to re-convert the video track, which I don't want to do.

    Originally Posted by LigH.de View Post
    What's wrong about VirtualDubMod, VirtualDub-FilterMod, AviMux-GUI?

    I understand that most tools working specifically with the AVI container may not include the feature to demultiplex a raw video stream, because most historical video formats were unidentifyable outside the AVI container. Multiplexing modern video formats like MPEG-4 AVC or HEVC into the AVI container is not recommendable because the container does not support specific attributes of such video formats anymore, but some software (like OTVR's) still do so; here it is most recommendable to use a multiplexer of the desired container to import from the AVI.
    Quote Quote  
  7. Member
    Join Date
    Mar 2012
    Location
    Orlando
    Search Comp PM
    Thanks for these tips. I'll try them out soon.

    Originally Posted by jagabo View Post
    x264vfw can output h.264 elementary streams (bypassing AVI output in VFW based programs).

    You can remux xvid/AVI to m2ts with:

    Code:
    ffmpeg -i %1 -c copy "%~n1.m2ts"
    Also to mov or mp4 by changing the extension.
    Quote Quote  
  8. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    You are wrong. All the mentioned tools are able to demultiplex (some of the) contained streams without re-encoding, you just need to switch the handling of the stream types to "Direct Stream Copy" in VirtualDub variants (in VirtualDubMod, you will find the handling of audio and subtitles in the "Streams" dialog). IIRC, AviMux-GUI does not support re-encoding at all. Whether it exports a stream type with or without any container, is another detail to be discussed, though.

    To help you with more certainty, please show us a full MediaInfo analysis of such AVI files, and tell us which type of streams you want to extract. Then we can tell you in detail which options you have to set in which of the tools to possibly achieve your desired result (it will depend on the content formats).

    In general, jagabo's solution via ffmpeg is probably the most recommendable; ffmpeg is the most versatile "Swiss Army Knife" converter for different container and content formats. You just have to set all "codec" parameters to "copy" to leave the content as it is, if you only want to repack to a new container. There are also several GUIs around the ffmpeg kernel if you don't like command-line jobs, e.g. TEncoder to process a batch of files multi-threaded (one conversion per CPU core).
    Last edited by LigH.de; 6th Sep 2017 at 02:23.
    Quote Quote  
  9. The best thing about using a batch file is you can put it in your SendTo folder (say you call this batch file remux_to_m2ts.bat). Then you can right click on a file in Explorer and select SendTo -> remux_to_m2ts.bat to execute it with that file. This is even easier to do than start up some GUI tool, load the file, select some options, and save the file. I have lots of fixed function batch files like this in my SendTo folder.
    Quote Quote  
  10. Member
    Join Date
    Mar 2012
    Location
    Orlando
    Search Comp PM
    LigH, I think you don't understand what I'm asking for. I do not need an ENCODER, I need an AVI DEMUXER. I've tried VirtualDubMod before with little success, mostly because I can never get it to work right. Below are are the typical error messages I get when using VDM.

    [!] AVI: Truncated or invalid compressed audio format detected (16 bytes, should be 18). Attempting to fix.

    [!] AVI: Variable bitrate (VBR) audio detected. VBR audio in AVI is non-standard and you may encounter sync errors up to 0ms when attempting to extract WAV files or playing in some players. If this is a problem, use Full Processing mode is recommended to decompress or recompress the audio. (This warning can be disabled in Options, Preferences, AVI. bitrate: 448.0 ± 0.0 kbps)


    The problem I'm having with VDM is that the AVI file created by the Xillisoft program takes the AC3 audio track from the m2ts file, and generates an AC3 audio stream, with a fixed Sample Rate of 48K and a fixed (not variable) CBR Bitrate of 448K. With these VDM errors present, I'm unable to proceed.

    However, I do plan to try Jagabo's method to see it it will work for me.

    Thanks

    Originally Posted by LigH.de View Post
    You are wrong. All the mentioned tools are able to demultiplex (some of the) contained streams without re-encoding, you just need to switch the handling of the stream types to "Direct Stream Copy" in VirtualDub variants (in VirtualDubMod, you will find the handling of audio and subtitles in the "Streams" dialog). IIRC, AviMux-GUI does not support re-encoding at all. Whether it exports a stream type with or without any container, is another detail to be discussed, though.

    To help you with more certainty, please show us a full MediaInfo analysis of such AVI files, and tell us which type of streams you want to extract. Then we can tell you in detail which options you have to set in which of the tools to possibly achieve your desired result (it will depend on the content formats).

    In general, jagabo's solution via ffmpeg is probably the most recommendable; ffmpeg is the most versatile "Swiss Army Knife" converter for different container and content formats. You just have to set all "codec" parameters to "copy" to leave the content as it is, if you only want to repack to a new container. There are also several GUIs around the ffmpeg kernel if you don't like command-line jobs, e.g. TEncoder to process a batch of files multi-threaded (one conversion per CPU core).
    Quote Quote  
  11. Member netmask56's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Search Comp PM
    You can do it in AViDemux but..... One quick way that works is to first put the avi file in a MKV container using MKVMergeGui (takes a couple of minutes no re-encoding takes place) and then using gMKVExtractGUI to extract all the streams that may be present like video and audio subtitles chapters etc. Typically with AVI files you will have a video file and an audio file. When you load the MKV file into gMKVExtract there appears on the left of the screen all tracks present and tick boxes to select which one or all of them etc. https://www.videohelp.com/software/gMKVExtractGUI
    SONY 75" Full array 200Hz LED TV, Yamaha A1070 amp, Zidoo UHD3000, BeyonWiz PVR V2 (Enigma2 clone), Chromecast, Windows 11 Professional, QNAP NAS TS851
    Quote Quote  
  12. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Originally Posted by billw6560 View Post
    LigH, I think you don't understand what I'm asking for. I do not need an ENCODER, I need an AVI DEMUXER.
    I understand this detail perfectly well. And so I asked you which streams you want to demultiplex from the AVI. VirtualDubMod can demultiplex audio streams without recoding; it may just not be suitable for extracting raw video streams ... but this is not recommendable for some cases anyway, because e.g. raw AVC and HEVC may biss a few attributes which would only be preserved if they are in a container; I believe the frame rate was sometimes not stored in raw video.

    And again:

    Warnings are not errors. Warnings are no reason for panic. Warnings only tell you not everything is in optimal order, but the application can still continue. Especially the misunderstanding between CBR and VBR multiplexing mode of audio streams in AVI is very common. You can multiplex CBR audio in a way that also supports VBR if it would be the case, by adding some additional timing information to the audio stream. It will not make the bitrate of the audio stream vary suddenly; if it originally had a constant bitrate, it will still keep this constant bitrate.

    Originally Posted by billw6560 View Post
    With these VDM errors present, I'm unable to proceed.
    That's a wrong conclusion. You are able to proceed. And you may learn to understand why you don't have to be concerned in these mentioned cases.
    Quote Quote  



Similar Threads

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