Log in

View Full Version : Best way to deinterlace Oklahoma! (MBAFF, Interleaved fields, Top Field First)


en6ads
20th May 2025, 16:20
Hi all, my first project.

I'm trying to learn the best way to deinterlace / field match Oklahoma! blu ray:
Scan Type: MBAFF
Scan Type: Interleaved fields
Scan Order: Top Field first.
Frame Rate: 30000/1001 FPS

The image looks bad on my OLED TV, interlaced lines on clouds and moving objects, terrible. I'd like to losslessly (if possible) create a progressive version.

Thank you.

johnmeyer
20th May 2025, 16:42
Is this the original 1955 Rogers and Hammerstein movie version of their play? If so, you don't want to deinterlace it. You should instead perform inverse telecine to recover the original 23.976 progressive frames.

I never ended up getting into Blu-Ray, but on DVD, if you do things correctly when you rip it, you should end up with 23.976 and not 29.97, without doing anything at all. In other words, you just rip it and you're done.

en6ads
20th May 2025, 17:07
Is this the original 1955 Rogers and Hammerstein movie version of their play? If so, you don't want to deinterlace it. You should instead perform inverse telecine to recover the original 23.976 progressive frames.

I never ended up getting into Blu-Ray, but on DVD, if you do things correctly when you rip it, you should end up with 23.976 and not 29.97, without doing anything at all. In other words, you just rip it and you're done.

Thank you for your reply. It's the Todd-AO Blu Ray version, 29.97 fps 60i. The CinemaScope Blu Ray version is 23.976 progressive.

The Todd-AO version is the only high frame rate (>24fps) HD Blu Ray. I'm just trying to restore it to 29.97 non interlaced.

johnmeyer
20th May 2025, 17:33
I just did some research and until then did not know the fascinating story about how Oklahoma! was simultaneously filmed in CinemaScope at 24 fps and Todd-AO at 30 fps. I never knew until now that Todd-AO used a non-standard frame rate.

I now understand what you are trying to do.

However, do you think you need to do anything? I would be surprised if there is any temporal difference between fields on that Blu-Ray. Have you checked this? It is probably flagged as interlaced, but that is just a flag. If there is no temporal difference between fields, then it is 29.97 progressive, which is what I think you are after.

en6ads
20th May 2025, 18:13
I just did some research and until then did not know the fascinating story about how Oklahoma! was simultaneously filmed in CinemaScope at 24 fps and Todd-AO at 30 fps. I never knew until now that Todd-AO used a non-standard frame rate.

I now understand what you are trying to do.

However, do you think you need to do anything? I would be surprised if there is any temporal difference between fields on that Blu-Ray. Have you checked this? It is probably flagged as interlaced, but that is just a flag. If there is no temporal difference between fields, then it is 29.97 progressive, which is what I think you are after.

It may be the MKV container created during the rip, or it may be jellyfin, but i'm seeing excessive interlaced combing (indicating the display for some reason thinks the frames are temporally spaced). I'll go back and backup to ISO (not rip to MKV file), then copy that over to the playback device (not stream using fmp4-hls protocol with jellyfin). The main part of the movie is 01755.m2ts.

Edit: I've been using Potplayer on 01755.m2ts: turned off video transform filter, turned on deinterlacing, paused video then advance frame by frame. It appears 2 frames are identical, the image updates every two times I advance, whicj means progressive segmented frame.

johnmeyer
20th May 2025, 18:56
Besides visually, how can I determine the temporal difference between frames? Is there an analyzer that calculates it?If you've got AVISynth installed and know how to use it, this is trivially easy. You just create an AVISynth script with one line: separatefields(). If the material is progressive, as you walk through the video one field at a time you'll see no horizontal motion at all for two steps, followed by horizontal motion. This repeats. If the material truly is interlaced, regardless of what MediaInfo might tell you, then you will see horizontal motion on each field.

If it is progressive, you will see up/down motion between each field because each field is from a different spatial location, but you will see no horizontal motion between fields from the same frame.

You can also do this with Bob, but you have to use the right settings, and I can never remember what they are. If you don't use AVISynth, you can use VirtualDub, but I always forget what deinterlace settings to use, so someone else will have to come up with that.

en6ads
20th May 2025, 20:25
If you've got AVISynth installed and know how to use it, this is trivially easy. You just create an AVISynth script with one line: separatefields(). If the material is progressive, as you walk through the video one field at a time you'll see no horizontal motion at all for two steps, followed by horizontal motion. This repeats. If the material truly is interlaced, regardless of what MediaInfo might tell you, then you will see horizontal motion on each field.

If it is progressive, you will see up/down motion between each field because each field is from a different spatial location, but you will see no horizontal motion between fields from the same frame.

You can also do this with Bob, but you have to use the right settings, and I can never remember what they are. If you don't use AVISynth, you can use VirtualDub, but I always forget what deinterlace settings to use, so someone else will have to come up with that.

I've figured out my problem on my LG TV. My player (Ugoos AM6B+ running CoreElec) cannot deinterlace when hardware acceleration is enabled. It plays back at full 60i, not 29.97p. It looks crappy.

I tried the same file playing on the TV directly from a USB stick and it is playing correctly progressive. Looks good.

So now I need to make a new mkv file that takes the 60i progressive segmented frames, and outputs 29.97p by dropping the repeated frames. How do I do that in Avisynth?

Thanks again for your help.

johnmeyer
20th May 2025, 23:39
Is there any way you can cut out 10 seconds, without re-encoding, and post that? I'd have to see exactly what you've got. I think the fix will be extremely easy.

en6ads
21st May 2025, 00:53
Is there any way you can cut out 10 seconds, without re-encoding, and post that? I'd have to see exactly what you've got. I think the fix will be extremely easy.

https://drive.google.com/file/d/1MwVSL1NVKXQtE6iTr1CayCB66NAt3mjh/view?usp=sharing

End goal is to create a new mkv file that is 29.97p. Perhaps by just deleting all the bottom frames?

Many thanks for your help.

RetsimLegin
21st May 2025, 08:50
For each pair of fields (which are temporally identical) one field has half of the lines and the other has the other half. Simply deleting one field will therefore effectively halve your vertical resolution. The two fields actually need merging to make a complete frame. I have zero experience with scripting so I leave it to others to suggest how this might be done.

SeeMoreDigital
21st May 2025, 09:55
https://drive.google.com/file/d/1MwVSL1NVKXQtE6iTr1CayCB66NAt3mjh/view?usp=sharing

End goal is to create a new mkv file that is 29.97p. Perhaps by just deleting all the bottom frames?

Many thanks for your help.
If you look at the images in the 29.970fps source you provided in VirtualDub2, you'll see that they're actually progressive. There are no interlaced 'fields' (pulldown or otherwise) present!

wonkey_monkey
21st May 2025, 10:16
https://drive.google.com/file/d/1MwVSL1NVKXQtE6iTr1CayCB66NAt3mjh/view?usp=sharing


What a shame 30fps never caught on. Looks really nice on a 60Hz display.

johnmeyer
21st May 2025, 16:07
As SeeMore says, you have very nice 29.97 fps progressive video. There is no temporal difference between fields. Your video is therefore not interlaced. Any TV that can play that file should display it correctly.

en6ads
21st May 2025, 18:15
As SeeMore says, you have very nice 29.97 fps progressive video. There is no temporal difference between fields. Your video is therefore not interlaced. Any TV that can play that file should display it correctly.

That's my problem. My player can't deinterlace without turning off hardware acceleration. It plays the file as 60i and it looks awful.

What I'd like to do is change the scan type from MBAFF to Progressive without re-encoding, but MBAFF is defined in the stream, not the container. This part I don''t know how to do but I'm still researching.

https://forum.videohelp.com/threads/400649-Mark-Force-MBAFF-Encoded-Video-as-Progressive
https://forum.doom9.org/showthread.php?p=1836724

Edit: I gave up and decided to re-encode to h265 at very high quality (hopefully transparent). Outputted file is now 29.97 progressive and no player deinterlacing is triggered / required. Thanks everyone for your help.

johnmeyer
21st May 2025, 18:56
That's my problem. My player can't deinterlace without turning off hardware acceleration. It plays the file as 60i and it looks awful.

What I'd like to do is change the scan type from MBAFF to Porgressive without re-encoding, but MBAFF is defined in the stream, not the container. This part I don''t know how to do but I'm still researching.

https://forum.videohelp.com/threads/400649-Mark-Force-MBAFF-Encoded-Video-as-Progressive
https://forum.doom9.org/showthread.php?p=1836724Those two threads have people saying the same thing I am saying: the interlaced flag does not mean that your footage is actually interlaced, and we now know that, in fact, it is progressive.

It is a little unclear to me, but I think you are saying that your TV is interpolating in between fields and/or frames to provide 60 fields per second (which is 60i) rather than your video's 30 progressive frames per second (which is 30p). You say you have to turn off hardware acceleration to make it play correctly. Since I don't know the make/model of your TV, I don't know what "hardware acceleration" means for that set, but if you are talking about the technology which creates the "soap opera effect" by synthesizing intermediate fields, then my recommendation is to turn that off, not only when playing this movie, but always. It creates all sorts of artifacts and, even if you like the totally different look it imparts to 24p material, once you begin to notice the morphing artifacts, you'll never be able to "un-see" them and your viewing experience will be degraded.

If you want to change the MKV header without re-encoding or altering the video/audio information, it looks like MKVToolNix might be able to do that job, although I have never used it.

en6ads
21st May 2025, 19:13
Those two threads have people saying the same thing I am saying: the interlaced flag does not mean that your footage is actually interlaced, and we now know that, in fact, it is progressive.

It is a little unclear to me, but I think you are saying that your TV is interpolating in between fields and/or frames to provide 60 fields per second (which is 60i) rather than your video's 30 progressive frames per second (which is 30p). You say you have to turn off hardware acceleration to make it play correctly. Since I don't know the make/model of your TV, I don't know what "hardware acceleration" means for that set, but if you are talking about the technology which creates the "soap opera effect" by synthesizing intermediate fields, then my recommendation is to turn that off, not only when playing this movie, but always. It creates all sorts of artifacts and, even if you like the totally different look it imparts to 24p material, once you begin to notice the morphing artifacts, you'll never be able to "un-see" them and your viewing experience will be degraded.

If you want to change the MKV header without re-encoding or altering the video/audio information, it looks like MKVToolNix might be able to do that job, although I have never used it.

Thanks for your help. I also used VirtualDub2 to determine its progressive, Progressive segmented Frame Aa Bb Cc...

So now my problem is how to change the input stream from MBAFF/Interleaved fields to Progressive. MTKToolnix can't do this because the container does not define this, it's embedded in the video stream. Would love to work out how to edit the stream to change it to progressive without re-encoding, but I don't have the time to learn how to do it, and It's only going to be 1 disk. So I gave up and re-encoded it to h265. That created a 29.97p progressive file. All good. Thanks again for your help.

SeeMoreDigital
21st May 2025, 19:15
That's my problem. My player can't deinterlace without turning off hardware acceleration. It plays the file as 60i and it looks awful.What player are you using? The sample you provided plays fine using MPC-BE v1.8.4 and on my LG C4 television.

johnmeyer
21st May 2025, 19:31
Plays fine here as well.

en6ads
21st May 2025, 21:08
What player are you using? The sample you provided plays fine using MPC-BE v1.8.4 and on my LG C4 television.

Ugoos AM6B+ running the latest CoreElec NG kernel nightly.
https://discourse.coreelec.org/t/enable-deinterlacing/12190

If I play the file directly from the TV media player it plays perfectly.

However I play my media using Jellyfin sent to the Ugoos (for Dolby Vision Profile 7 FEL support).

I may try this hack after some more research: echo 1 > /sys/module/di/parameters/bypass_all

SeeMoreDigital
21st May 2025, 21:15
Ugoos AM6B+ running the latest CoreElec NG kernel nightly.
https://discourse.coreelec.org/t/enable-deinterlacing/12190

If I play the file directly from the TV media player it plays perfectly.

However I play my media using Jellyfin sent to the Ugoos (for Dolby Vision Profile 7 FEL support).

I may try this hack after some more research: echo 1 > /sys/module/di/parameters/bypass_allOkay... So it's pretty obvious now that there's nothing wrong with the actual video file. The issue is down to your Ugoos AM6B+ Jellyfin player!