Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 22nd October 2010, 09:58   #1  |  Link
aand
Learning fast
 
aand's Avatar
 
Join Date: May 2008
Location: Bucharest
Posts: 33
Broken VFR decode

(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.

Last edited by aand; 22nd October 2010 at 10:06.
aand is offline   Reply With Quote
Old 22nd October 2010, 12:17   #2  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
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).

Last edited by Ghitulescu; 22nd October 2010 at 12:51.
Ghitulescu is offline   Reply With Quote
Old 22nd October 2010, 12:32   #3  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Ghitulescu View Post
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?
Groucho2004 is offline   Reply With Quote
Old 22nd October 2010, 12:39   #4  |  Link
kypec
User of free A/V tools
 
kypec's Avatar
 
Join Date: Jul 2006
Location: SK
Posts: 826
Quote:
Originally Posted by Ghitulescu View Post
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?
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 as a source filter in your AVS script. These should help x264 to keep & obey timecodes of input VFR material properly.
kypec is offline   Reply With Quote
Old 22nd October 2010, 12:44   #5  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
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.
sneaker_ger is offline   Reply With Quote
Old 22nd October 2010, 13:06   #6  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
Quote:
Originally Posted by Groucho2004 View Post
How is VBR and CBR related to the variable framerate he's talking about?
Quote:
Originally Posted by kypec View Post
WTH are you talking about?
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.

Quote:
Originally Posted by kypec View Post
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?

The material was already encoded, aand needs to decode it, not to reencode it again.
Ghitulescu is offline   Reply With Quote
Old 22nd October 2010, 13:35   #7  |  Link
kemuri-_9
Compiling Encoder
 
kemuri-_9's Avatar
 
Join Date: Jan 2007
Posts: 1,348
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
__________________
custom x264 builds & patches | F@H | My Specs
kemuri-_9 is offline   Reply With Quote
Old 22nd October 2010, 13:53   #8  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Ghitulescu View Post
Sorry, I'm extremely tired this week.
Then go to sleep and stop posting nonsense.

Quote:
Originally Posted by Ghitulescu View Post
Apparently, 4 guys here "hunt" me for every little thing I do
Sleep deprivation can also lead to paranoia.
Groucho2004 is offline   Reply With Quote
Old 22nd October 2010, 14:35   #9  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
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?
Ghitulescu is offline   Reply With Quote
Old 22nd October 2010, 16:05   #10  |  Link
Midzuki
Unavailable
 
Midzuki's Avatar
 
Join Date: Mar 2009
Location: offline
Posts: 1,480
<OFF-TOPIC>

Quote:
Originally Posted by Groucho2004 View Post
Sleep deprivation can also lead to paranoia.
Psychiatry is a pseudo-science.

Seriously.

</OFF-TOPIC>
Midzuki is offline   Reply With Quote
Old 22nd October 2010, 17:30   #11  |  Link
aand
Learning fast
 
aand's Avatar
 
Join Date: May 2008
Location: Bucharest
Posts: 33
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.

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.
aand is offline   Reply With Quote
Old 22nd October 2010, 17:34   #12  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by aand View Post

SOLUTION (?!): it's a bug in MPC decoding (internal FFmpeg, intenal DXVA, external ffdshow all are displayed wrong). WMP works. VLC works.

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
poisondeathray is offline   Reply With Quote
Old 22nd October 2010, 21:50   #13  |  Link
aand
Learning fast
 
aand's Avatar
 
Join Date: May 2008
Location: Bucharest
Posts: 33
Matroska was disabled in MPC-HC. Didn't work correctly after enabling either.
aand is offline   Reply With Quote
Old 23rd October 2010, 12:20   #14  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Which renderer did you use?
sneaker_ger is offline   Reply With Quote
Old 23rd October 2010, 20:49   #15  |  Link
aand
Learning fast
 
aand's Avatar
 
Join Date: May 2008
Location: Bucharest
Posts: 33
Quote:
Originally Posted by sneaker_ger View Post
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.

Last edited by aand; 23rd October 2010 at 21:04.
aand is offline   Reply With Quote
Old 23rd October 2010, 21:28   #16  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Good to know who the culprit is. Would be interesting to see how madVR does.
sneaker_ger is offline   Reply With Quote
Old 24th October 2010, 01:52   #17  |  Link
aand
Learning fast
 
aand's Avatar
 
Join Date: May 2008
Location: Bucharest
Posts: 33
madVR is also OK.
aand is offline   Reply With Quote
Old 24th October 2010, 08:37   #18  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Thx for testing.
sneaker_ger is offline   Reply With Quote
Reply

Tags
mkv, variable frame rate, vfr, x264

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:05.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.