View Full Version : ffmpeg treating output as interlaced


Orthonormal
18th September 2026, 22:21
If I create a script with only the line:
DGDecode_mpeg2source("progressive_mpeg2_video.mpg")
ffmpeg treats it as interlaced. ffprobe directly on the script reports top frame first interlacing, and transcoded video output has metadata reporting top frame first interlacing and shows zippering when the player's deinterlacing is disabled.

The original video is progressive. ffprobe reports it as such, and playback with deinterlacing disabled has smooth lines during fast movement.

But if I create a script:
DGDecode_mpeg2source("interlaced_mpeg2_video.mpg")
QTGMC(Preset="Slow")
SelectEven()
Spline64Resize(720,540)
Then the output is detected by ffmpeg as progressive, and all is well. Note that this is a different input file, that is interlaced.

Can anyone think of a reason why ffmpeg is detecting the former as interlaced? Or happen to know the flags to tell/force ffmpeg that the input video is progressive?

ffmpeg version is 9.0.1.
AviSynth+ is version 3.7.5

qyot27
18th September 2026, 23:23
If FFmpeg is detecting it as interlaced, then DGDecode is setting the _FieldBased frame property to TFF even in the case the video is progressive. In-script, you can change the property using propSet("_FieldBased", 0), or you can selectively turn off FFmpeg reading the field property:
ffmpeg -avisynth_flags -field_order [...]

Orthonormal
19th September 2026, 00:50
Good tips. I tried each one, and both of them result in the output being interpreted as progressive, so that ffmpeg/ffprobe reports the output as progressive.

However, when I play back the video, there's zippering/combing with motion.

When I turn on deinterlacing in the player, the video gets very jittery, as if every few frames it displays two in reverse order.

When I use the mpeg2 source file as a direct input to ffmpeg, it is recognized as progressive and conversion and playback are normal.

For background, I'm doing this because I want to use AviSynth for scaling with the spline64resize() filter. If this gets too ugly, I'll probably try to rescale within ffmpeg instead. I'm using AviSynth because I'm already using it to deinterlace my interlaced videos, and scaling the progressive videos with AviSynth keeps the process consistent.

Columbo
19th September 2026, 12:33
However, when I play back the video, there's zippering/combing with motion. That suggests the content is not all progressive as you thought.

When I turn on deinterlacing in the player, the video gets very jittery, as if every few frames it displays two in reverse order. Post an unprocessed source sample that we can look at. Otherwise we are just guessing.

johnmeyer
19th September 2026, 15:41
Generally speaking, I don't think treating progressive video as interlaced will cause any problems. The reverse is obviously not true.

Orthonormal
19th September 2026, 19:14
Here's a link (https://www.idsfa.net/~john/temp/avisynth/) to a short sample that demonstrates the behavior.

ffmpeg -i orthonormal-example.avs from-avs.mp4
ffmpeg -i orthonormal-progressive.mpg from-mpg.mp4

Both output files show as progressive using ffprobe, but in playback, the file converted from avs shows combing, and the file converted from mpg does not.

qyot27
19th September 2026, 20:38
You didn't check the pulldown flags when you made the .d2v file. The example is 99.79% FILM, but presumably, you still had DGIndex set to Honor Pulldown Flags when it should be set to Force Film in this circumstance.

Orthonormal
19th September 2026, 21:28
I'm sure that I didn't, partly because I didn't use DGIndex to generate the .mpg files. It's been so long that I don't remember exactly how I did it, but I think it involved using ffmpeg to separate individual episodes out of the VOB files using the index times, into .mpg container files without re-encoding.

It sounds like there's something I could have done at an earlier stage so that the files would work properly with AviSynth.

My question now is whether there's any argument I could pass to DGDecode_MPEG2Source() to get it to treat the input properly.

Orthonormal
19th September 2026, 21:39
I have noticed that a .d2v is being generated automatically when I access the .avs file, and also that the documentation for MPEG2Source() says that the d2v filename is a required parameter.

Is the answer to create the .d2v file before running MPEG2Source(), passing the filename to MPEG2Source(), and making sure that the file description is correct in the .d2v file?

Columbo
19th September 2026, 22:26
Make the D2V first using DGIndex. In Video/Field Operation check Force Film. Then Save Project makes the D2V.

Orthonormal
19th September 2026, 22:29
That does seem to work. The .d2v gets generated automatically by MPEG2Source("file.mpg"), but as you say, the Field Operation parameter is set to Honor Pulldown Flags (0). If I change it to Force Film (1) that seems to correct the combing artifacts.

I don't suppose there's a way from within an AviSynth script that I could control how that parameter gets set when the .d2v file is automatically generated?

Columbo
19th September 2026, 22:59
No, there is no parameter for that to mpeg2source().

But you can edit the auto-generated D2V file and change the field operation to 1 (instead of 0).

Note that DGDecNV has a field operation parameter to DGSource(). You could use that instead of DGMPGDec if you have an nVidia card.

Orthonormal
19th September 2026, 23:14
That's exactly what I planned to do. I'm using Python to automate the process.
I can trigger the generation of the file with a call to ffprobe, then use a function to edit the Field Operation line, before calling ffmpeg for the transcoding step.

OOOH. I do have an nvidia card. Will look at that.

THANKS, all!

Columbo
19th September 2026, 23:16
Good plan but be careful. Don't blindly set FO 1 as it is not suitable for all source files, such as truly interlaced ones, or ones with a mix of interlaced and progressive content (hybrid). It also has no effect on interlacing for files with hard pulldown (not done with flags) other than changing the frame rate.

DGDecNV lacks some features of DGIndex, so switching will be gated by what features you actually use. I have a lot of experience with both ;) so feel free to post again if you run into anything. Also you can post at the DG Forum, where a flying squirrel will be anxious to help you.