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 > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th November 2023, 23:10   #1  |  Link
-Radar-
Registered User
 
-Radar-'s Avatar
 
Join Date: Oct 2023
Posts: 2
Are interlaced fields encoded separately?

This is a question regarding interlaced video that I've never received a firm answer on.

Question is: are the fields in interlaced video actually encoded separately? This would mean that the fields exist separately in the video stream and are recombined by your video player. Or, are the fields encoded into the same frame as a progressive video, and the term "60i" is simply used to describe how the video is visually perceived?

If the former, how can I check that a video is truly interlaced, and not just a progressive video with interlaced frames?
-Radar- is offline   Reply With Quote
Old 18th November 2023, 23:27   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,251
Quote:
Question is: are the fields in interlaced video actually encoded separately?
That depends on how you encode them

You can always encode interlaced video "as if it was progressive", i.e. weaving each pair of consecutive fields and then encoding the "interlaced frames" just as if they were progressive video. The result will not be good, obviously

That's why video formats like H.264 have a dedicated "interlaced" mode, where the fields will indeed be encoded separately. But, usually, you need to explicitly enable this!

Note that H.264 actually has two different "interlaced" modes, called PAFF (Picture Adaptive Field Frame) and MBAFF (MacroBlock Adaptive Field Frame). PAFF allows to decide, on a frame basis, whether to encode each frame as a frame or as two fields. MBAFF allows to decide, on a macroblock basis, whether to encode as field or frame. Meanwhile, in H.265, encoding of "interlaced" material has been greatly simplified, pretty much treating each field as a separate picture.

Quote:
If the former, how can I check that a video is truly interlaced, and not just a progressive video with interlaced frames?
You can check how it was encoded. But, unfortunately, there is no trivial way to figure out what was the nature of the original material

It is possible that progressive material was encoded as interlaced, which is inefficient but doable. And, just as well, it is possible that interlaced material was encoded as progressive, which definitely should be a no-go but you never know!

(Note that if any tools like MediaInfo and friends show "interlaced" vs. "progressive", then this always indicates how the video was encoded, not what the nature of the material is)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 18th November 2023 at 23:50.
LoRd_MuldeR is offline   Reply With Quote
Old 19th November 2023, 20:03   #3  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 4,015
Quote:
Originally Posted by -Radar- View Post
how can I check that a video is truly interlaced, and not just a progressive video with interlaced frames?
Select a scene with motion. Separate the fields and step through the fields. If there is motion with every field advancement it is true interlaced. If there is motion with every 2nd field only it is progressive video.
Sharc is offline   Reply With Quote
Old 21st November 2023, 04:18   #4  |  Link
-Radar-
Registered User
 
-Radar-'s Avatar
 
Join Date: Oct 2023
Posts: 2
Sorry for not responding earlier. I actually did respond within the first day but I got a message about the post requiring moderator approval, but that never happened so I'm just re-writing my post.

Quote:
Originally Posted by LoRd_MuldeR View Post
That's why video formats like H.264 have a dedicated "interlaced" mode, where the fields will indeed be encoded separately. But, usually, you need to explicitly enable this!

Note that H.264 actually has two different "interlaced" modes, called PAFF (Picture Adaptive Field Frame) and MBAFF (MacroBlock Adaptive Field Frame). PAFF allows to decide, on a frame basis, whether to encode each frame as a frame or as two fields. MBAFF allows to decide, on a macroblock basis, whether to encode as field or frame. Meanwhile, in H.265, encoding of "interlaced" material has been greatly simplified, pretty much treating each field as a separate picture.
I'm mostly interested in investigating DVD ISOs. Is it true that DVDs with hard telecine are encoded as interlaced? And soft telecine DVDs are progressive?

Quote:
Originally Posted by LoRd_MuldeR View Post
(Note that if any tools like MediaInfo and friends show "interlaced" vs. "progressive", then this always indicates how the video was encoded, not what the nature of the material is)
What if MediaInfo doesn't show anything? There is a DVD remux I'm watching with one episode that has interlaced lines, but the MediaInfo doesn't specify interlaced or progressive.

Quote:
Originally Posted by Sharc View Post
Select a scene with motion. Separate the fields and step through the fields. If there is motion with every field advancement it is true interlaced. If there is motion with every 2nd field only it is progressive video.
What are you using to separate the fields? I can only advance frame by frame using vlc or mpv.
-Radar- is offline   Reply With Quote
Old 21st November 2023, 22:40   #5  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,866
Quote:
Originally Posted by Sharc View Post
Select a scene with motion. Separate the fields and step through the fields. If there is motion with every field advancement it is true interlaced. If there is motion with every 2nd field only it is progressive video.
Specifically, telecine shows a repeating sequence of three progressive frames and two interlaced frames.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 21st November 2023, 22:54   #6  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,866
Quote:
Originally Posted by -Radar- View Post
I'm mostly interested in investigating DVD ISOs. Is it true that DVDs with hard telecine are encoded as interlaced? And soft telecine DVDs are progressive?
Most "24p" DVDs are nominally interlaced, but the encoder sets the field/frame tags so the encode is efficient as a native 24p encode (which DVD doesn't actually support).

Some very old and very low budget TVs take 30i source with 3:2 pulldown and just encode it as interlaced, which delivers worse quality. But inverse telecine is still often possible.

Quote:
What if MediaInfo doesn't show anything? There is a DVD remux I'm watching with one episode that has interlaced lines, but the MediaInfo doesn't specify interlaced or progressive.
Weird. What does the fps say? If it is 29.97 is is normally interlaced, 23.976 proper telecine.

Quote:
What are you using to separate the fields? I can only advance frame by frame using vlc or mpv.
VLC deinterlaces by default. You can turn it off in settings to see the actual frames.

Note that lots of tools treat a properly encoded 3:2 pulldown streams as straight-up 24p, and report it as such, despite DVD not having a true 24p mode.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 1st May 2024, 05:40   #7  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,076
It depends on the colorspace. YV12 definitely encodes each field separately, which is part of the reason why the height should only be cropped in increments of 4 pixels rather than 2.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 28th May 2024, 13:58   #8  |  Link
Yz345a
Registered User
 
Join Date: May 2024
Posts: 3
Interlaced fields in video are typically encoded together within the same frame, not separately. The term "60i" refers to how the video is perceived, with two fields making up each frame. To check if a video is truly interlaced, you can use software like MediaInfo to inspect the file's properties, or view the video frame-by-frame in an editing program to see if there are distinct interlaced fields
Yz345a is offline   Reply With Quote
Old 28th May 2024, 18:28   #9  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 8,102
Quote:
Originally Posted by Katie Boundary View Post
It depends on the colorspace. YV12 definitely encodes each field separately, which is part of the reason why the height should only be cropped in increments of 4 pixels rather than 2.
no it does not:
https://learn.microsoft.com/en-us/wi...vformats08.gif

if you store field individual it is technically not interlaced anymore.
huhn is offline   Reply With Quote
Old 29th May 2024, 10:52   #10  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,368
Interlacing of the lines is a property of how the video was sampled / is going to be presented, eg. in the raw domain - in a coded bitstream it is very common to encode the fields separately, and re-combine them after decoding. This is done for efficiency of course, alternating lines with different temporal information would be terrible to compress.
H264 for example has two encoding modes, PAFF (Picture Adaptive Frame/Field), which separates the two fields, and MBAFF (Macroblock Adaptive Frame/Field) which can do the same separation on a macroblock level for efficiency gains. Only after decoding will the fields be combined and get the "interlaced lines" style.

With that in mind every video codec can in theory be used for interlaced encoding - just encode at twice the fps and half the frame size, and add a filter around it to split/re-combine. This is technically how HEVC encodes interlaced. It has no special interlaced mode, just encodes half-sized fields, and carries some metadata to instruct the decoder to combine it. It is not very well supported though, as everyone is trying to make interlaced go away.

Some video processing frameworks will also keep the fields separate in their processing chain, and only combine them as needed, as its more efficient to do this, depending on what kind of effects you apply to it.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders

Last edited by nevcairiel; 29th May 2024 at 10:55.
nevcairiel is offline   Reply With Quote
Old 31st May 2024, 00:24   #11  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,076
Quote:
Originally Posted by huhn View Post
no it does not:
https://learn.microsoft.com/en-us/wi...vformats08.gif

if you store field individual it is technically not interlaced anymore.
No, there was a whole thread about how cropping YV12 incorrectly would cause problems. That was how I learned this. We have the bugs to prove it.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 31st May 2024, 13:52   #12  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 8,102
if a software does something at one point it does not change that YV12 is not encoded at all and does not mean it sperate fields.

YV12 is just a 420 format that has 3 array that's it.
it stores the same information as NV12 which uses only 2 array.
huhn is offline   Reply With Quote
Old 31st May 2024, 14:29   #13  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,890
Quote:
Originally Posted by Katie Boundary View Post
It depends on the colorspace. YV12 definitely encodes each field separately, which is part of the reason why the height should only be cropped in increments of 4 pixels rather than 2.
The cropping only needs to be mod4 if it's interlaced otherwise it can be mod2. Mind you there's a slight chance a mod2 height won't display correctly if you're using a decoder that hasn't been updated in over 20 years, but other than that a mod2 height is fine.
hello_hello is offline   Reply With Quote
Reply

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 14:43.


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