VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. Member
    Join Date
    Dec 2009
    Location
    United States
    Search Comp PM
    Hi again. I really would like to understand something about demuxing, and then remuxing.

    This question is just for the knowledge of how to do so.

    I have a video that is in a "MKV" container, with the video being encoded as h.264, and the video encoded as 6ch aac.

    Know from my current understanding, the the H.264 video, with AAC audio should be one of the most common forms, if not the default, of your standard MPEG-4 video/audio container.

    My initial attempt involved demuxing the video/audio streams, and then muxing them as copy streams with FFMPEG (Win32 build). Needless to say, There were too many issues to go into, and I don't believe FFMPEG is a good option for this type of procedure. In fact while I did try muxing the video with ffmpeg, it couldn't even split the audio, requiring I save the stream with compression.

    So... anyways, I ended up trying to mux the two streams, video & audio, with AviDemux. What I got was pretty much the same results as ffmpeg's muxing attempt, horrible frame-skipping, and out of sync audio. During the file open prompts, a message popped up asking if I wanted to use a H.264 safe mode, which I selected 'no' to. I also selected 'yes' to rebuild the frames.

    I eventually found AviDemux acceptable settings that reasonably worked:

    1. 'No' to h264 safe mode.
    2. 'Yes' to rebuild frames.
    3. 'Copy' video.
    4. 'Compress' audio with AAC audio, which the source already was, at 384Kbps.

    Now I thought the point of (de)muxing was to preserve the original quality of video, or audio, so does anyone know why I have to recompress the audio for this video example to sync correctly?

    It it the frames per second? Both the original, and result files that worked had a FPS of 23.986.

    Does it have something to with my rebuilding the frames option?

    Or, maybe my not selecting the h264 safe mode?

    I'd really like to know at the very least why the source audio/video wont sync, even if there isn't a way to make them mux correctly.
    Quote Quote  
  2. Use YAMB, which is intended for MP4 muxing. You might have to use MKVextractGUI from the MKVtoolnix package to demux the streams from the MKV first.
    Quote Quote  
  3. Member
    Join Date
    Dec 2009
    Location
    United States
    Search Comp PM
    Originally Posted by creamyhorror View Post
    Use YAMB, which is intended for MP4 muxing. You might have to use MKVextractGUI from the MKVtoolnix package to demux the streams from the MKV first.
    With the exception of using the MKEVWizard instead of MKVextractGUI, I already tried that. The audio problem remains. Even using the advanced delay option when importing, the audio remains consistently out of sync, and doesn't even change position.

    It seems the only way to make it sync is by recompressing the AAC to ... AAC, losing quality in the process. Might it have something to do with it being 6ch audio?
    Last edited by Huh...What?; 1st Mar 2010 at 09:30.
    Quote Quote  
  4. Don't demux from container, use yamb directly on .mkv

    If it's VFR, you need to mux with timecodes
    Quote Quote  
  5. Member
    Join Date
    Dec 2009
    Location
    United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Don't demux from container, use yamb directly on .mkv
    Yamb doesn't recognize MKV files.

    Originally Posted by poisondeathray View Post
    If it's VFR, you need to mux with timecodes
    Interesting... What does VFR refer to, and what are timecodes?
    Quote Quote  
  6. Originally Posted by Huh...What? View Post
    Originally Posted by poisondeathray View Post
    Don't demux from container, use yamb directly on .mkv
    Yamb doesn't recognize MKV files.
    Yes it does. Use 2.1.0.0 beta2 or newer

    Originally Posted by poisondeathray View Post
    If it's VFR, you need to mux with timecodes
    Interesting... What does VFR refer to, and what are timecodes?
    VFR = Variable frame rate . Time codes tell the player to speedup/slowdown in different sections. Use GOOGLE!
    Quote Quote  
  7. Member
    Join Date
    Dec 2009
    Location
    United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Yes it does. Use 2.1.0.0 beta2 or newer
    That'd be the reason, I only had the last stable build.

    Originally Posted by poisondeathray View Post
    VFR = Variable frame rate . Time codes tell the player to speedup/slowdown in different sections. Use GOOGLE!
    Okay, I think I got a handle on what they are. Looking around the net, I found many ways documented on how to convert the video to one of the FPS used, usually decimation or 120 avi.

    I'd rather maintain the VFR structure, and remux to MP4. Could someone recommend a way to generate a VFR timecode from the original MKV?

    -edit-
    While Yamb will open the MKV now, it will not encode the video to MP4. It quits with this error.
    Code:
     
    Error importing C:\Track1.h264:fps=23.976: BitStream Not Compliant
    Last edited by Huh...What?; 2nd Mar 2010 at 07:23.
    Quote Quote  
  8. Originally Posted by Huh...What? View Post
    I'd rather maintain the VFR structure, and remux to MP4. Could someone recommend a way to generate a VFR timecode from the original MKV?
    This is only if you are certain you have a VFR mkv: Use ffmpegsource2 and avisynth to generate timecodes text , then tc2mp4 to merge timecodes into mp4, then mp4box to add audio in

    -edit-
    While Yamb will open the MKV now, it will not encode the video to MP4. It quits with this error.
    Code:
     
    Error importing C:\Track1.h264:fps=23.976: BitStream Not Compliant
    yamb doesn't encode

    post mediainfo information (view=>text) of your file
    Quote Quote  
  9. Member
    Join Date
    Dec 2009
    Location
    United States
    Search Comp PM
    Use ffmpegsource2 and avisynth to generate timecodes text
    I move around from PC to PC a lot, so I'd prefer not having to use anything that needs installed.

    Sorry, I meant mux/remux.

    Here is the MediaInfo (through Media Player Classic):
    Code:
    General
    Complete name                    : C:\Video\WIP\last_rendezvous.mkv
    Format                           : Matroska
    File size                        : 237 MiB
    Duration                         : 24mn 5s
    Overall bit rate                 : 1 379 Kbps
    Encoded date                     : UTC 2006-08-29 05:46:54
    Writing application              : mkvmerge v1.7.0 ('What Do You Take Me For') built on Apr 28 2006 17:20:19
    Writing library                  : libebml v0.7.7 + libmatroska v0.8.0
    Cover                            : Yes / Yes
    Video
    ID                               : 1
    Format                           : AVC
    Format/Info                      : Advanced Video Codec
    Format profile                   : Main@L4.0
    Format settings, CABAC           : Yes
    Format settings, ReFrames        : 4 frames
    Muxing mode                      : Container profile=Unknown@4.0
    Codec ID                         : V_MPEG4/ISO/AVC
    Duration                         : 24mn 3s
    Width                            : 704 pixels
    Height                           : 392 pixels
    Display aspect ratio             : 16:9
    Original display aspect ratio    : 16:9
    Frame rate                       : 23.976 fps
    Resolution                       : 8 bits
    Colorimetry                      : 4:2:0
    Scan type                        : Progressive
    Title                            : AVC
    Writing library                  : eavc 1.0.2.2
    Language                         : English
    Audio #1
    ID                               : 2
    Format                           : AAC
    Format/Info                      : Advanced Audio Codec
    Format version                   : Version 4
    Format profile                   : LC
    Format settings, SBR             : Yes
    Format settings, PS              : No
    Codec ID                         : A_AAC/MPEG4/LC/SBR
    Duration                         : 24mn 5s
    Channel(s)                       : 6 channels
    Sampling rate                    : 44.1 KHz
    Title                            : 5.1 HE-AAC
    Language                         : English
    Guess it wasn't VFR after all.

    The only thing I see as off with this MediaInfo outpout is the sample rate of the audio. After extraction I opened with a couple different audio programs, which said it was 22,050KHz.

    I eventually figured an acceptable way to process this particular video at least.

    What I had ended up doing was extract the AAC audio with mkvextract. I then ran the video through the 'mkv2vfr' command-line utility, which outputted a AVI containing the video stream along with a timecodes text.

    I then tried to run that AVI through the avi tc package 'tc2cfr' utility to output a 120 fps AVI with drop-frames, but...it wouldn't accept mkv2vfr's timecode text.

    Just by luck, I decided to open the decimated AVI outputted by 'mkv2vfr' with AviDemux, which I then did a copy stream with a custom 120 fps selected. I then muxed the 120 fps video AVI, the AAC audio, and the timecodes.txt back into a MKV container with MKVmergeGUI.

    Finally, I ran the modified MKV through Yamb, which completed the remux without any errors.
    Quote Quote  



Similar Threads

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