I have tried different methods of muxing a raw h264 stream into an AVI container.
The (MKV) movie is originally 90 mins 36 secs long. I demuxed it using MKVEXTRACTGGUI and the result was a .h264 file. I used SUPER to diagnose the video stream, and the stream was claimed to be 29.970 fps. However if I used AlltoAVI to diagnose the stream, it would be 25.0 fps.
I used AlltoAVI to reencode the stream to a DivX movie file. Settings are Normal, not restrictive. If I used restrictive mode to convert the stream, the program would crash. The error was "Runtime error 5 : Invalid call or argument" before I could even start conversion. The process takes over an hour, and the result was that the .avi movie is 87 mins and 57 seconds long. So i ditched the Alltoavi method since 1) converting between formats will give rise to sync problems. 2) it will cause a decrease in quality and 3) the process takes waayyy too long.
I have too, tried the same method with SUPER, it ended up giving me a list of errors.
So I decided to try out the AVC2AVI method, where by there is no re-encoding of the stream, but rather just muxing the stream directly into the AVI container (as it says). What I found weird was that when I set the fps to the default value of 25, the movie had the same problem as AlltoAVI, it had the same resultant duration which was 87 mins and 57 seconds long. If i set the fps to 29.97, the movie came out to be 78 mins long! I don't really understand why there would be a discrepancy when I simply muxed the stream into a container. Should I continue trying with different FPS settings to see which results in the same duration as the original?
I have tried Virtualdubmod, but it can't recognise the stream. (cannot detect file type xxx.h264)
So I'm just wondering, is there a way to mux the h264 stream into an AVI container without any change in duration at all? Please take note that I have handled the audio file separately.
The audio does not go out of sync if I handled it separately because I always uncompress before converting to MP3 (VBR included, and still does not go out of sync), and when I say it does not go out of sync, it means that there is no significant change in duration from the original. (only a few ms of skew is ok)
This could be a possible way to obtain an .avi file with the same duration, but I only have a few GB of space left on my com, so I don't think it's possible to uncompress then recompress a video stream.
+ Reply to Thread
Results 1 to 5 of 5
-
-
It's probably VFR (Variable FrameRate), see https://forum.videohelp.com/topic349035.html#1834679
-
Tried poisondeathray's suggestion.
Now both audio and video have same duration as original.
Verdict: FAIL! Because the AVI file is now at CFR, many of the frames shifted to different timings from the original. So when I mux them together, only the audio follows the original timing, and the video goes out of sync.I'm at my wit's end T.T should I just stick to mkv???
I wonder if AVI format allows VFR, and if there are any tools that can keep the integrity of the movie file while placing it in AVI container. If it doesn't, It might be best sticking to MKV.
Thanks for identifying my problem though. -
Depending on how the file(s) will be used, is there even any reason to convert it? No offense, but many users seem to spend (ie: waste) a lot time and effort converting files (and reducing quality) simply because they want all of their files in a single format. While that can be nice, for PC use it is totally unncessary.
Google is your Friend -
I might consider burning it into a DVD (not data). It might be better so if all the movies are in the same format of AVI right? Most of the DVD converters so far hardly supports h264. By far, the most important reason is that in the AVI format, I can seek to different timings without any weird glitches. I've noticed that in MKV or OGM formats, whenever i seek to different timings in the movie, the graphics will be glitchy and blotchy for some time before it returns to normal. Since my movie is most likely in VFR, I left it as it was, since I heard that AVI containers don't support VFR.
Similar Threads
-
Converting VFR FLV (H264/AAC) to AVI (other) w/o sync issue
By kwondra34 in forum Video Streaming DownloadingReplies: 43Last Post: 11th Apr 2012, 00:54 -
AVIDeMux - H264 (.mp4) to .avi - Audio Sync 1000ms
By nlvraghavendra in forum Video ConversionReplies: 3Last Post: 9th Mar 2010, 14:50 -
Sync 29.970 FPS audio to 23.976 FPS video?
By LCO1971 in forum Newbie / General discussionsReplies: 3Last Post: 13th Sep 2008, 15:23 -
where to get h264's FPS?
By shun in forum EditingReplies: 2Last Post: 19th Aug 2007, 04:42 -
Audio Sync Problem Joining 2 AVI's Together from a 2 DVD Set
By boofer in forum EditingReplies: 6Last Post: 22nd Jul 2007, 01:29