PDA

View Full Version : VFR+AVC+SSA in MKV => bug?


MeteorRain
14th July 2005, 18:07
well, i encoded an anime today, using VFR mkv becoz the source was VFR MKV.
i extracted the timecode and the fake CFR avi out, and encoded the op karaoke into it, using meGUI+x264. (the frame rate changing point is after the op, so we won't worry about the unsync)(well, i enabled 4 ref b-f and 16 b-f max :D )
then i made the subtitle (ssa), and encode the audio (he-aac)
finally i muxed the AVC, AAC and SSA together into MKV using MMG 1.5, w/ the timecode file.
when i played the mkv, the subtitle seems abnormal. i will discribe it:
if we have 2 subtitle lines
frame 1 to 500: line1text
501 to 900: line2text

when it playes to near 500, it becomes abnormal.
when at 497, the subtitle (seems) disappears
498, line1text
499, line2text
500, line1text
501, line2
502, disappear
503~89x, line2

the number above is just an example, but almost all the point where one event disappers and another one appears, it will blink like the example above.
but AVC w/o VFR works very well.
i have tried mpc internal mkv splitter, guliverkli's, and haali's one, but they all cannot handle it correctly.
so i'm thinking if there's bug(s) in mkv splitter. (or maybe muxer?)
does who have any idea?

best regards!!!!
MeteorRain

MeteorRain
14th July 2005, 19:36
as i have tested till now, the problem should between the b-frame and VFR.
the mkv seems output frames as
2,4,1,5,1,8,8,7,9,5,12,14,12,15,12,11,18,18,16,19,21,15,..........
(i checked the ffdshow info)
and then, vobsub apply sub to it, and this cause the problem

==========edit===========
well, the subtitle plugin inside MPC deals well with it.
and btw, if you need sample, you can either encode a small clip yourself, or ask me for the file ;)

Haali
14th July 2005, 21:01
Timecode file must be v2 with frames in coding order if your video has out of order frames.

MeteorRain
15th July 2005, 02:32
Timecode file must be v2 with frames in coding order if your video has out of order frames.
:O
well, Haali, how can i extract the timecode v2 from the VFR MKV?
I dealed it with your mkv2vfr.exe

thank you for your help & regards
MeteorRain
======== EDIT ========
i find your faq and see your answer. thank you.

Liisachan
26th July 2005, 01:53
:O
well, Haali, how can i extract the timecode v2 from the VFR MKV?
I dealed it with your mkv2vfr.exe
The original problem seems to have been solved already, but I was interested in this question:
We have avi2timecode to get the "timecode format v2" file from 120fps AVI, but how can I get it from MKV? mkv2vfr cannot.

The method I found is silly and brute force.

mkvinfo -v in.mkv > info.txt
perl work.pl info.txt

where work.pl is like:

print OUT "# timecode format v2\n";
while(<IN>) {
if( /timecode (\d+)\.(\d\d\d)s/ )
{
print OUT $1 * 1000 + $2 . "\n";
}
}


Any better solutions?

MeteorRain
4th August 2005, 11:12
ha.... i even nearly forgot this topic.

the problem hasn't solved, i just turn to XviD, as XviD works well with timecode v1. (Halli's faq (http://haali.cs.msu.ru/mkv/faq.html) says mkv just couldn't handle some streams like x264 with b-frames w/ subtitle, as will cause subtitle blink)

and i have no idea about perl script. any php one avaliable?

best regards!!
MeteorRain

Liisachan
4th August 2005, 12:08
You don't need Perl anymore; newer mkvtoolnix simply has this:

mkvextract timecodes_v2 file.mkv 1:v2.tm

http://forum.doom9.org/showthread.php?p=694517#post694517

MeteorRain
4th August 2005, 14:21
coooooooooooooooool
======= EDIT =======
i've tried x264+ssa+timecode v2, but the subtitle is still blink.
have to wait for better choices.

gards,
MR

MeteorRain
7th August 2005, 20:51
i wonder if we can modify the timecode file according to x264 analyze file, and muxing the new timecode file and see if it works?

more discusstion needed
MeteorRain

Liisachan
24th August 2005, 13:21
coooooooooooooooool
======= EDIT =======
i've tried x264+ssa+timecode v2, but the subtitle is still blink.
have to wait for better choices.

gards,
MR

Did you really try a post-1.5.0 build?
You should update mkvmerge too so that it'll work with the 'display-ordered' timecode v2.

MeteorRain
24th August 2005, 13:52
:o
yeah, new mkvmerge support it XD
that's why i cries in mosu's post ~~

iapir
24th August 2005, 23:38
You may also use timecode files v3 for easier creation of timecode files from scratch.