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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th December 2019, 17:41   #1  |  Link
Bahamuth
Registered User
 
Join Date: Dec 2003
Location: Germany
Posts: 78
Can't encode interlaced "separate fields" video

Hi everyone,

I have several files ripped from a disc which are strangely interlaced.

Code:
Video
ID                                       : 1
ID in the original source medium         : 4113 (0x1011)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 2 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 2 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 1 min 5 s
Bit rate mode                            : Variable
Bit rate                                 : 3 838 kb/s
Width                                    : 720 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 4:3
Original display aspect ratio            : 4:3
Frame rate mode                          : Variable
Frame rate                               : 59.940 (60000/1001) FPS
Original frame rate                      : 29.970 (30000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan type, store method                  : Separated fields
Scan order                               : Bottom Field First
Bits/(Pixel*Frame)                       : 0.185
Stream size                              : 29.8 MiB (95%)
Language                                 : English
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray
These separated fields kill me. No matter which deinterlacing I choose (TDeInt, YadifMod, QTGMC), no matter if using Avisynth or VapourSynt, no matter if I don't set any deinterlacer at all, no matter if I set x264 options to stay Interlaced, Bottom Field First, the output file ALWAYS plays the video only in half speed, sometimes giving me two green bars on the bottom of the video as well. Audio works flawlessly.

What could cause this? As this example is just an advertisement, I uploaded it here.

I usually encode with Staxrip, but no matter what I set up yet, the result is crap. Interestingly with Handbrake I don't have that problem, but I personally dislike the handling of Handbrakes GUI.

Where could be my problem here? Which filter could I use in Staxrip to achieve the same thing?

Here's part of a handbrake log, showing decomb/deinterlace settings it found I think:
Code:
[17:21:50]  * video track
[17:21:50]    + decoder: h264
[17:21:50]    + filters
[17:21:50]      + Detelecine (pullup) ()
[17:21:50]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[17:21:50]      + Decomb (mode=39)

[17:22:01] comb detect: heavy 91 | light 233 | uncombed 1623 | total 1947
[17:22:01] decomb: deinterlaced 91 | blended 233 | unfiltered 1623 | total 1947
Bahamuth is offline   Reply With Quote
Old 11th December 2019, 17:46   #2  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
It's simple, the video is not interlaced.
Cary Knoop is offline   Reply With Quote
Old 11th December 2019, 19:35   #3  |  Link
Bahamuth
Registered User
 
Join Date: Dec 2003
Location: Germany
Posts: 78
and why does Mediainfo tells me it is?
Bahamuth is offline   Reply With Quote
Old 11th December 2019, 20:04   #4  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Because it says it does not automatically make it so.
Cary Knoop is offline   Reply With Quote
Old 11th December 2019, 20:46   #5  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
@Bahamuth

You have to distinguish between how the video is encoded versus the actual content. The actual content can be progressive but encoded as interlaced. Presumably, MediaInfo reports on how the video is encoded.
videoh is offline   Reply With Quote
Old 11th December 2019, 20:47   #6  |  Link
Bahamuth
Registered User
 
Join Date: Dec 2003
Location: Germany
Posts: 78
And how does it explain, that, if not using any deinterlacer, the video is still crap?

I just found out, if I add a AssumeFPS(source) anywhere in the script, then the file seems to be normal. So is it "just" the source frame rate which somehow isn't correctly used?

So I wonder if I used a deinterlacer on things that don't need deinterlacing before. All Blade 1, 2 and 3 Bonus extras from the BluRays are with that Separate Fields tag.
Bahamuth is offline   Reply With Quote
Old 11th December 2019, 21:05   #7  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by Bahamuth View Post
And how does it explain, that, if not using any deinterlacer, the video is still crap?
Maybe you are clueless. Maybe StaxRip is screwing up. I have no problem making great video from your sample. But I don't use GUIs; I'm a pedal to the metal guy.

loadplugin("dgdecodenv.dll")
dgsource("example.dgi")

Last edited by videoh; 11th December 2019 at 21:11.
videoh is offline   Reply With Quote
Old 11th December 2019, 23:20   #8  |  Link
Bahamuth
Registered User
 
Join Date: Dec 2003
Location: Germany
Posts: 78
So I am clueless, because two programs (Mediainfo obviously telling me a progressive video is interlaced (besides, ffmpeg states interlaced as well) and Staxrip utilizing Avisynth and Vapoursynth in a wrong way for the video) don't work the way they probably should? Okay...
Bahamuth is offline   Reply With Quote
Old 11th December 2019, 23:31   #9  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Not sure what the remaining problem is, just re-encode the video without any bells and whistles and you are ready to go:

Something like this:

ffmpeg example.mkv -c:v libx264 -a:c -crf 18 result.mp4
Cary Knoop is offline   Reply With Quote
Old 11th December 2019, 23:32   #10  |  Link
Bahamuth
Registered User
 
Join Date: Dec 2003
Location: Germany
Posts: 78
with some ffmpeg filter I found the following information:
Code:
Season One Volume Two.mkv:  
[Parsed_idet_0 @ 00000284a7698a40] Repeated Fields: Neither:  1922 Top:     2 Bottom:    27
[Parsed_idet_0 @ 00000284a7698a40] Single frame detection: TFF:     0 BFF:     0 Progressive:   652 Undetermined:  1299
[Parsed_idet_0 @ 00000284a7698a40] Multi frame detection: TFF:     0 BFF:     0 Progressive:  1922 Undetermined:    29
I guess, Mediainfo just found the very few frames being Top or Bottom and assumed, it was interlaced. Evil...
Bahamuth is offline   Reply With Quote
Old 12th December 2019, 00:35   #11  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
You totally ignored the point about the difference between how a video is encoded and what the content actually is. That's what makes you clueless -- even when we tell you what is going on you don't take it on board.
videoh is offline   Reply With Quote
Old 12th December 2019, 07:39   #12  |  Link
Bahamuth
Registered User
 
Join Date: Dec 2003
Location: Germany
Posts: 78
How about telling me how I should check this on a video file instead of just telling me that I'm clueless? Would help me much more than such comments.
Bahamuth is offline   Reply With Quote
Old 12th December 2019, 07:53   #13  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
@Bahamuth just like Donald said: you can have videos flagged as interlaced but with frames inside instead of fields. I noticed that you live in Germany, so you're in a PAL region just like me. Have you ever watched movies on TV? I bet you did. Every time you watched a movie, it almost definitely was 25p progressive flagged as interlaced. Why do we do this? Because the standard is interlaced and video servers expect it to be that way, but we can literally send progressive materials instead as long as we FLAG them as interlaced. In other words, it's just a flag, you don't really have to deinterlace anything. What happens if you deinterlace it anyway? Like blindly bobbing it? Well, there are no fields, so each "field" correspond to the same frame; in other words, nothing will happen other than duplicating 25 frames every second to get a fake 50p full of dups.

That's it really.
In other words, media info is fine, but when it comes to interlacing always index your source and look at it frame by frame with your eyes via AVSPmod.
FranceBB is offline   Reply With Quote
Old 12th December 2019, 14:37   #14  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by Bahamuth View Post
How about telling me how I should check this on a video file instead of just telling me that I'm clueless? Would help me much more than such comments.
Happy to oblige:

http://rationalqm.us/faq.html
videoh is offline   Reply With Quote
Old 13th December 2019, 01:26   #15  |  Link
Bahamuth
Registered User
 
Join Date: Dec 2003
Location: Germany
Posts: 78
Just an hour ago I found the problem for the slow video result. FFMS2 used from StaxRip2 was the reason. Using the latest official version makes everything right with my video.

@videoh: thanks for the link, will take a look at it.

One more question: I'm watching TV over cable. The signal is supposed to be 576i. But when I use ffmpeg with idet filter and check all frames, I get the following:
[Parsed_idet_0 @ 0000026d78ef87c0] Repeated Fields: Neither: 29573 Top: 7 Bottom: 38
[Parsed_idet_0 @ 0000026d78ef87c0] Single frame detection: TFF: 213 BFF: 8 Progressive: 10928 Undetermined: 18469
[Parsed_idet_0 @ 0000026d78ef87c0] Multi frame detection: TFF: 744 BFF: 0 Progressive: 28874 Undetermined: 0

Wouldn't that mean, that the video itself is rather progressive, when only like 2.5% of the video has interlaced frames?
Bahamuth is offline   Reply With Quote
Old 13th December 2019, 10:35   #16  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,347
Quote:
Originally Posted by Bahamuth View Post
Wouldn't that mean, that the video itself is rather progressive, when only like 2.5% of the video has interlaced frames?
Its a progressive video, and the 2.5% are either misdetections or an interlaced overlay, which broadcast does sometimes do.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is online now   Reply With Quote
Old 13th December 2019, 22:32   #17  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
Quote:
Originally Posted by nevcairiel View Post
or interlaced overlay, which broadcast does sometimes do.
Yep, I hate when it happens, but most of the time it's really just that the main feed is progressive and it's the video mixer (like Vizrt in my case) that overlays something interlaced like credits moving from a part to the other of the screen at the very bottom just before a program ends. In other words, we have no control over that. Most TVs handle it nicely though, so it's not a big deal.
FranceBB is offline   Reply With Quote
Old 15th December 2019, 02:00   #18  |  Link
Bahamuth
Registered User
 
Join Date: Dec 2003
Location: Germany
Posts: 78
So I could use that way to automatically check (e.g. via batch file) if a video file is Interlaced or Progressive and might need Deinterlacing or not? Because Deinterlacing a progressive video is something bad I think.

A truely Interlaced video probably has high percentages in the TFF and BFF values.
Bahamuth is offline   Reply With Quote
Old 15th December 2019, 03:34   #19  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Bahamuth, just put the video into something like VirtualDub and step through some frames. A simple visual inspection can tell you if you deal with progressive, interlaced or telecined footage.
Cary Knoop is offline   Reply With Quote
Old 15th December 2019, 18:24   #20  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
I already suggested that to Bahamuth and gave a link to instructions for doing that. He seems uninterested and wants to put his faith in automated methods. This is misguided because 1) flagging does not necessarily match the content, and 2) if you actually look for combing you are relying on heuristics that are not always correct. I suppose hope springs eternal and one has to find things out the hard way.
videoh is offline   Reply With Quote
Reply


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 09:28.


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