OTZIILORD / lavfilters

Automatically exported from code.google.com/p/lavfilters
GNU General Public License v2.0
0 stars 0 forks source link

H.264 jitter if file extension is wrong #133

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I noticed a file that played jittery with LAV video (gave the impression of 
half-framerate).

On investigation it turned out it was an MKV file renamed to AVI (which, in my 
experience, is a common occurrence). Renaming it back to MKV solved the issue.

Looking at 
http://code.google.com/p/lavfilters/source/browse/decoder/LAVVideo/decoders/avco
dec.cpp#437 it seems like this is done purposefully by detecting the file 
extension. In my opinion this is a little fragile and should be avoided.

I hate to mention "competing decoders" here, but ffdhsow, CoreAVC, and MS' 
DTV-DVD decoder don't have this problem, so maybe there's a better way to solve 
it?

Thanks!

Original issue reported on code.google.com by klah...@sogetthis.com on 8 Nov 2011 at 4:57

GoogleCodeExporter commented 8 years ago
Other decoders don't have that problem because they fail at playing actual AVI 
files with H264.

If you rename your file, thats what you're going to get.

Original comment by h.lepp...@gmail.com on 8 Nov 2011 at 9:38

GoogleCodeExporter commented 8 years ago
A small correction:

There is actually something planned that might fix this as a side-effect as 
well, but only if you use LAV Splitter.

Original comment by h.lepp...@gmail.com on 8 Nov 2011 at 9:49

GoogleCodeExporter commented 8 years ago
> they fail at playing actual AVI files with H264

But they don't. I've tested the 3 decoders I mentioned with all combinations 
(in samples with B-pyramid):

* H.264 in AVI, AVI extension
* H.264 in AVI, MKV extension
* H.264 in MKV, AVI extension
* H.264 in MKV, MKV extension

And they work perfectly in every case. MPC-HC's internal decoders (software and 
DXVA) work too.

Original comment by klah...@sogetthis.com on 8 Nov 2011 at 12:08

GoogleCodeExporter commented 8 years ago
And I've tested a multitude of decoders with H.264 in AVI, and they all produce 
the same problem - they have wrong frame timestamps, somewhat similar to what 
you see with your renamed file.

In any case, renaming files is braindead stupid, so just don't.

Original comment by h.lepp...@gmail.com on 8 Nov 2011 at 12:14

GoogleCodeExporter commented 8 years ago
Using "show frame timestamps" the timestamps from ffdshow in all 4 cases look 
perfectly fine to me (each frame increasing by the same amount with no ordering 
issues), likewise DirectShowSource(convertfps=true) in AviSynth generates 
correct results.

But anyway, no point arguing further about this, we are seeing different things 
for one reason or another.

Also, I'm not the one renaming the files.

Original comment by klah...@sogetthis.com on 8 Nov 2011 at 12:30

GoogleCodeExporter commented 8 years ago
Now that I think about it, would it be too much of a hassle to just grab the 
full path, actually open the file, and check that the first four bytes are 
"RIFF"? (yes, not pretty)

Original comment by klah...@sogetthis.com on 9 Nov 2011 at 12:36