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. |
11th December 2019, 17:41 | #1 | Link |
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 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 |
11th December 2019, 20:47 | #6 | Link |
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. |
11th December 2019, 21:05 | #7 | Link | |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
Quote:
loadplugin("dgdecodenv.dll") dgsource("example.dgi") Last edited by videoh; 11th December 2019 at 21:11. |
|
11th December 2019, 23:20 | #8 | Link |
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...
|
11th December 2019, 23:31 | #9 | Link |
Cary Knoop
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 |
11th December 2019, 23:32 | #10 | Link |
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 |
12th December 2019, 07:53 | #13 | Link |
Broadcast Encoder
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. |
12th December 2019, 14:37 | #14 | Link | |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
Quote:
http://rationalqm.us/faq.html |
|
13th December 2019, 01:26 | #15 | Link |
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? |
13th December 2019, 10:35 | #16 | Link |
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,347
|
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 |
13th December 2019, 22:32 | #17 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
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.
|
15th December 2019, 02:00 | #18 | Link |
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. |
15th December 2019, 18:24 | #20 | Link |
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.
|
|
|