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.
+ Reply to Thread
Results 1 to 9 of 9
-
-
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.
-
-
That'd be the reason, I only had the last stable build.
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.
-
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
post mediainfo information (view=>text) of your file -
Use ffmpegsource2 and avisynth to generate timecodes text
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
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.
Similar Threads
-
MkvТоMp4 v0.224 - rapid tool for repack Mkv to Mp4
By oreons in forum Video ConversionReplies: 808Last Post: 7th Mar 2022, 01:43 -
MKV Compression to a smaller MKV or MP4
By THRobinson in forum Video ConversionReplies: 9Last Post: 20th Jul 2018, 10:56 -
MKV guide, Play MKV, MKV to AVI, MKV to DVD, MKV to MP4, MKV to Blu-ray
By Baldrick in forum Newbie / General discussionsReplies: 55Last Post: 29th Jun 2012, 11:19 -
muxing .264 stream to .mkv, or to .mp4 first, an then to .mkv ?
By codemaster in forum Video ConversionReplies: 2Last Post: 20th Sep 2011, 20:50 -
Issues Converting MKV to MP4 (could be due to damaged MKV header??)
By MohQ in forum Video ConversionReplies: 1Last Post: 1st Feb 2008, 03:10