PDA

View Full Version : h264 wrong timelength after demuxing mkv


mrdummy
21st March 2008, 09:26
I have already done some steps in conversion and encoding from MKV file.
But i have some troubles with wrong timelength from h264 videostream. Before demuxing, the MKV file has for example length of 24 minutes.

After demuxing videostream from MKV, the timelength suddenly changed to 40 minutes. Still playable, though, but wrong.

I use AVC2AVI to try fix the problem. It works with 29,97 fps videostream, the final AVI videostream has 24 minutes. Good.

But different fps, for example 23,97 fps videostream, has bad result. The timelength is still wrong with too much seconds difference. I can fix it with 24,18 fps (measured with VirtualDub video-audio sync option) but that is still strange fps fix.
It gives troubles with added subtitles and audio stream.

Therefore, what is good solution to fix the timelength of h264 file after demuxing from MKV?
I convert it in AVI file, for editing in VirtualDub. That is another step i have no problem with it.

(After encoding with VirtualDub, i discover the large black video part at the end of videostream, for many seconds. I want avoid it too.)

Don't ask for source media. I won't tell more about it, because the rule #6. I want only speak about h264 timelength problem at demuxing - converting - encoding level. This is basic problem with demuxing h264 videostream and make it AVI compatible for VirtualDub reading / editing. Many users should known this problem. All another steps are not needed here. That is all.

bond
21st March 2008, 10:37
which tool tells you the length of the .264 stream?

run h264_parse of mpeg4ip over the .264 stream and post the beginning of itsoutput here (sequence and picture parameter set)

mrdummy
21st March 2008, 11:28
After demuxing, i test it with MPC to see if the length is correct.
Also after AVC2AVI, i check again if its succesfully converted or not with MPC again.

Should i ignore just MPC information? Think not.
Well, with AVC2AVI converted AVI, i got indeed wrong timelength and big black video at the end of videostream after encoding in Virtualdub.
That is not good. There must something to correct the problem easy.

Trahald
21st March 2008, 17:37
@mrdummy
the problem isnt really mpc's fault. detecting the length of an elementary stream is almost impossible without scanning the whole thing first. thats why authoring software that requires raw files scan them first before assuming the length

as far as avc2avi... it should reasonably get the right length after muxing.. although .avi container really isnt suited for avc. thats why you usually only see avc in .mkvs and .mp4s and transport streams.

mrdummy
21st March 2008, 18:07
mpeg4ip is not available for download :(
They have some troubles with latest version, because i don't see the download link on Sourceforge site.

Too bad, i'm trying some tools soon to see the results.

And AVI format is needed for VirtualDub, it cannot read h264 format. I know it's bit strange with "h264 inside AVI", converted with AVC2AVI, but it makes h264 "readable" for VirtualDub :)

bond
22nd March 2008, 09:41
mpeg4ip is not available for download :(
They have some troubles with latest version, because i don't see the download link on Sourceforge site.it never has been available on sf. :search: for download links

And AVI format is needed for VirtualDub, it cannot read h264 format. I know it's bit strange with "h264 inside AVI", converted with AVC2AVI, but it makes h264 "readable" for VirtualDub :)as trahald said. dont use avc in avi and editing such files in vd is an even worse idea. mux the .264 to mp4 and edit in avidemux (its similar to vd)