I use MPV to play MKV media files and almost all the media is ripped with MakeMKV from Blu-ray sources.
I often come across a problem with interlaced h264 media, which doesn't display correctly in any player without forced deinterlacing.
In MPV, I use a lavfi filter (yadif=mode=1:deint=1) which plays back all my interlaced MPEG2 sourced content perfectly, without affecting progressive frames.
With some (or possibly all) h264 interlaced content however, it doesn't work.
Here's a sample of some lossless h264 from a recent blu-ray that prompted this post:
With the example above, I suspect the problem is the blu-ray manufacturer incorrectly marked the interlaced frames as progressive... or maybe it's MakeMKV. It's very difficult to tell as I don't have a working Blu-ray player besides the one in my PC that I use for ripping, and I don't know how to analyse the signature of each frame to see if it's marked as progressive or interlaced.
If I step frame by frame in MPV, it appears to be a repeated cycle of I I P P P (whereby I = an interlaced frame and P = a progressive frame), a cycle that I've noticed on other h264 interlaced content in the past.
I'm not sure if the problem is baked into the encoding itself or if it affects all h264 interlaced content, as I don't often come across interlaced h264 on blu-ray. But seemingly every time I've come across it, I've been forced to re-encode with forced deinterlacing (yadif) to make it look right.
I come across this issue from time to time from DVDs I've ripped with MakeMKV (which are definitely incorrectly marked as progressive frames), but I can fix MPEG2 streams with the help of Restream.
Re-encoding is not an option, how else can I fix this?
+ Reply to Thread
Results 1 to 10 of 10
Last edited by hedgehog90; 5th Jan 2021 at 11:02.
In that case why does my yadif filter not work? (yadif=mode=1:deint=1, which should 'Only deinterlace frames marked as interlaced' but deinterlaces nothing.)
Last edited by hedgehog90; 5th Jan 2021 at 12:28.
'Only deinterlace frames marked as interlaced' does not just work for MPEG-2 sources?users currently on my ignore list: deadrats, Stears555
I haven't looked into it, all I know is it doesn't work in MPV or ffmpeg.
yadif=mode=0:deint=0 deinterlaces all frames and outputs 1 frame per frame (instead of 1 frame per field) makes it watchable but there's a repeated frame every 5 frames.
But if I use that filter in my MPV configuration then it makes everything that isn't MBAFF look worse.
It's 3:2 pulldown, hard telecine (no way to fix it without re-encoding). It's progressive content (23.976p). If you used yadif, it would deinterlace and degrade the frames, and you'd be left with jerky playback with a repeated frame 1 in 5 . None of your film MPEG2 videos with hard telecine would play correctly either with hard telecine
You need to fieldmatch and decimate to return original quality 23.976 progressive frames. Yadif is only for fallback for residual combed frames, the ones that fieldmatch marks as still interlaced after field matching
ffplay -i "-sef.mkv" -vf "fps=30000/1001,fieldmatch,yadif=deint=interlaced,decimate"
but there's a repeated frame every 5 frames.
In case it's soft telecined, MakeMKV would mark it as progressive and report that there's a 3:2 pulldown.
Can't really say what mpv does, but my guess is that for MBAFF it applies deinterlacing to all frames.
As a side note: MBAFF = Macroblock-Adaptive Frame/Field Coding, on a macroblock level the encoder decides whether the to encode the block interlaced or progressive, so deinterlacing isn't as straight forward as with mpeg-2. MPEG-2 style interlacing is called PAFF Picture Adaptive Field Frame" in H.264.
Depending on how the decoder flags the output and how the deinterlacer handles it, quality loss is to be expected.
Cu Selurusers currently on my ignore list: deadrats, Stears555
Of course there's repeated frames, this needs to be detelecined, no deinterlaced. It's shot on film so the content is 23.976 not 29.970.
edit: poisondeathray was faster
Your flat panel TV will play it back fine, 99.9% of them in North America have 3:2 pulldown detection . ie. It will look fine on a normal setup, BD/TV player.
TV/Movie studio don't care if you can not play it back easily without jumping through hoops on anything but broadcast or optical disc . That's what "telecine" is for in the first place , and to make everything standards compliant (albeit ancient standards... but that's for another discussion)
Native progressive SD (23.976pN) is not allowed according BD specs ; native progressive is only allowed for HD resolutions . That is why your file was encoded that way. It's supposed to be that way