View Full Version : Broken VFR decode
aand
22nd October 2010, 09:58
(I'm not sure this is the right forum for this post)
1. How do I decode VFR correctly?
2. How do I get the frame number accurately?
I ripped a DVD and encoded with x264 in Matroska container. The rip has variable frame rate (60fps -> 30fps) in some small segments. The trouble is decoding the thing. The 30fps portions look choppy (like 3fps). EDIT:30fps actually looks like 60fps-pause-60fps-pause. Frame-by-frame looks OK.
I've tried decoding with ffdshow and the internal MPC decoders.
Also decoding the MKV file is strange. In AviSynth, if I use DirectShowSource I get 305781 frames, with DSS2 I get 306086 frames. So I'm not sure the ranges in the timecodes file are set correctly.
Ghitulescu
22nd October 2010, 12:17
The easiest thing would be to rerip the DVD again and to use CFR. There's no gain in using VFR on CFR sources, VFR is mainly used for PC screen capturing (for presentations, demos, tutorials).
Groucho2004
22nd October 2010, 12:32
The easiest thing would be to rerip the DVD again and to use CBR. There's no gain in using VBR on CBR sources, VBR is mainly used for PC screen capturing (for presentations, demos, tutorials).
How is VBR and CBR related to the variable framerate he's talking about?
kypec
22nd October 2010, 12:39
The easiest thing would be to rerip the DVD again and to use CBR. There's no gain in using VBR on CBR sources, VBR is mainly used for PC screen capturing (for presentations, demos, tutorials).
WTH are you talking about?:eek:
aand has problems with decoding VFR=Variable Frame Rate stream properly. It has nothing to do with CBR (ConstantBitRate) or VBR (VariableBitRate) modes of encoding being actually used.
aand, try to feed your source material directly to x264 (no Avisynth involved) or use FFMS2 (http://forum.doom9.org/showthread.php?t=127037) as a source filter in your AVS script. These should help x264 to keep & obey timecodes of input VFR material properly.
sneaker_ger
22nd October 2010, 12:44
AFAIK DSS2 does a VFR -> CFR conversion, that's why the number of frames changes. DirectShowSource does it only when "convertfps=true" is set.
1.) Try different renderers in MPC and a player without DirectShow like VLC.
2.) Are you sure that the timecodes have been created correctly? Extract them using mkvtoolnix and look at the 30 fps sections.
Ghitulescu
22nd October 2010, 13:06
How is VBR and CBR related to the variable framerate he's talking about?
WTH are you talking about?:eek:
aand has problems with decoding VFR=Variable Frame Rate stream properly. It has nothing to do with CBR (ConstantBitRate) or VBR (VariableBitRate) modes of encoding being actually used.
I wanted to write VFR and CFR instead of CBR and VBR, it was clear from the context for everyone involved. Sorry, I'm extremely tired this week.
Apparently, 4 guys here "hunt" me for every little thing I do:
Two of them are here, I'm expecting the third one.
I still think that the easiest and least uncomplicated way is to rerip the DVD, there's no use of a VFR for sources that are CFR. I'm not saying that VLC or MPC-HC cannot cope with VFR, they do, but this might unduly restrict the usage of the MKV.
aand, try to feed your source material directly to x264 (no Avisynth involved) or use FFMS2 as a source filter in your AVS script. These should help x264 to keep & obey timecodes of input VFR material properly.
WTH are you talking about?:eek:
The material was already encoded, aand needs to decode it, not to reencode it again.
kemuri-_9
22nd October 2010, 13:35
you should follow sneaker_ger's #2: extracting out the timecodes from your resulting mkv and then convert the v2 format to v1 for easier readability.
from the v1 timecodes you can see what the vfr sections are and see if they're correct/incorrect.
also how did you pass the vfr video to x264 as an input to begin with?
the number of frames can also be found by the number of lines with numbers on them (exclude the header and possibly a blank line at the end) in the v2 timecodes file that you extract out
Groucho2004
22nd October 2010, 13:53
Sorry, I'm extremely tired this week.
Then go to sleep and stop posting nonsense.
Apparently, 4 guys here "hunt" me for every little thing I do
Sleep deprivation can also lead to paranoia.
Ghitulescu
22nd October 2010, 14:35
I'm not posting nonsense. It was a typo.
The guy has a DVD and an MKV that is VFR, and has problems playing the second.
Solutions:
1. find a player (apparently there are some problems here)
2. find an MKV verifier, pin point the problem, act accordingly - steps: find the tool (is there any?), check the stream (how deep?), find the problem (needs further research on various parameters and values), correct the stream (which tool?), check the result again (maybe restart from step 1 again)
3. find an alternative way (avisynth script, VFR codecs etc.) - this way must be saved somehow, to be reused next time.
4. rerip the DVD once more, paying attention to configuration.
The last option seems to be the quickest and the least resource demanding. It also seems to be future proof (less than a 1:1 copy, but still), since all software players can cope with CFR. That's the purpose of a backup, right, to allow future uses, while keeping the original safely in the safe?
Midzuki
22nd October 2010, 16:05
<OFF-TOPIC>
Sleep deprivation can also lead to paranoia.
Psychiatry is a pseudo-science. :p
Seriously.
</OFF-TOPIC>
aand
22nd October 2010, 17:30
Wow so many replies!
SOLUTION (?!): it's a bug in MPC decoding (internal FFmpeg, intenal DXVA, external ffdshow all are displayed wrong). WMP works. VLC works.
:mad: Damn I thought MPC is bulletproof :)
I don't wanna use WMP or VLC!
Replies:
GHITULESCU
Re-rip not necessary.
I had to drop some frames because of little segments of NTSC film (24fps -> 30fps) mixed in with the 30fps interlaced material. Some film parts got deinterlaced ugly ( approximate frame order: 1 2 2 2 3 3 4 2 4 5 5 6 6 6 7 7 8 6 8 9 ...). So I just used selectodd() on those segments - "bad" frames were only even numbers.
kemuri-_9
I used v1 timecodes like this:
Assume 59.940180
8108,8137,29.97009
13814,13856,29.97009
14122,14215,29.97009
...
Input for x264 was an AviSynth script.
poisondeathray
22nd October 2010, 17:34
SOLUTION (?!): it's a bug in MPC decoding (internal FFmpeg, intenal DXVA, external ffdshow all are displayed wrong). WMP works. VLC works.
:mad: Damn I thought MPC is bulletproof :)
I don't wanna use WMP or VLC!
What splitter?
IIRC only haali works properly , so try disabling internal MPCHC/MPC mkv splitter
aand
22nd October 2010, 21:50
Matroska was disabled in MPC-HC. Didn't work correctly after enabling either.
sneaker_ger
23rd October 2010, 12:20
Which renderer did you use?
aand
23rd October 2010, 20:49
Which renderer did you use?
HAHA! I used EVR custom. EVR sync, Haali renderer work ok. -.-"
Thanks! Didn't even think of that!
EDIT: this option caused the trouble:
View-> Renderer-> Presentation-> Enable Frame Time Correction
Enable only when you experience stuttering video because of a buggy decoder or splitter. For example VC-1 content in m2ts container currently needs this.
I disabled it and now there's no stuttering.
sneaker_ger
23rd October 2010, 21:28
Good to know who the culprit is. Would be interesting to see how madVR does.
aand
24th October 2010, 01:52
madVR is also OK.
sneaker_ger
24th October 2010, 08:37
Thx for testing.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.