[FFmpeg-user] ntsc-dvd doesn't default to interlaced.

Francois Visagie francois.visagie at gmail.com
Fri Jul 26 09:14:55 CEST 2013


> -----Original Message-----
> From: ffmpeg-user-bounces at ffmpeg.org [mailto:ffmpeg-user-
> bounces at ffmpeg.org] On Behalf Of Andy Civil
> Sent: 26 July 2013 08:09
> To: ffmpeg-user at ffmpeg.org
> Subject: [FFmpeg-user] ntsc-dvd doesn't default to interlaced.
> 
> Short description: I'm moaning that the default output for "ntsc-dvd" is
> progressive, even if I give it enough information to make it interlaced.
> 
> Long description:
> 
> First, an aside on interlacing. I know that in general, people here don't
like
> interlacing and attempt to deinterlace at the earliest opportunity. I can
see a
> day when interlacing is pointless, when all CRT displays are on the scrap
heap
> and no one uses DVDs any more. I used to think that interlacing was a
viable
> alternative to compression for saving data, but I now realise that where
> software compression is available, the advantage is moot because
> compression can
> reduce the data rate more efficiently than the interlacing process, and
> although
> interlacing might appear to halve the amount of data required, it simply
> makes
> the datastream less compressible so you gain nothing in the end.
> 
> Having said that, we still live in a world where people use DVDs to store
and
> share movies. And like it or not, we have to work within the constraints
of
> what
> is a valid DVD-video stream.

Progressive input to the authoring process isn't a problem, the DVD standard
allows that. I own quite a few progressively encoded commercial DVDs.

> Within that constraint, a video of 30fps
> interlaced
> (60 fields per second) does indeed look better than a straight 30p because
> there
> is more temporal information. Pointing out that a 60p movie might compress
> to
> smaller than the 30i is irrelevant, because 60p is not a valid mode for
DVD-
> video.
> 
> I am in the position of wanting to make DVD videos of material I have shot
> with
> an HD camera. After days of head-scratching, I have found that the
> interlacing
> of HD video is opposite in field order to that required by DVD.

If you want to encode interlaced, field order isn't a problem either; the
DVD standard accepts either. For ffmpeg just set the correct field order
with '-top[:stream_specifier] {0|1}'. If you really want to reverse field
order, that's possible with tools like Avisynth, but let's leave that for
another day for now ;-).

>  Further, the
> video editor that I'm using to edit my videos seems to do a poor job of
scaling
> the interlaced content (seriously).

Well picked up, few people realise or notice that. It's a consequence that
applies to scaling interlaced content in general, not only to your editor.
Fields need to be scaled separately to preserve their vertical structure,
otherwise you get vertical blending of field content. Either separate fields
or rather properly deinterlace first.

>  I therefore turned to trusty FFmpeg to
> solve
> the quality problem. I got the editor to output a rather large temporary
file in
> HD resolution and the full 60p. (The quality is OK because it seems able
to
> de-interlace fine.) I then asked FFmpeg to convert this to DVD-video. It's
a
> simple command:
> c:\ffmpeg\bin\ffmpeg -i E:\temp\2013-06-07-hdp.mp4 -target ntsc-dvd -
> acodec mp2
> -ac 2 -b:a 128000 output-dvd.mpg

FWIW, I think the '-acodec mp2' is redundant (at least my command line
doesn't use it). See what happens without it.

> Now here's my complaint: this works fine, but it makes a 30p video, simply
> throwing away half of the frames. 30p is a valid mode for DVD-video, but
it's
> not as smooth as it could be. I found that I had to specifically add the
flags
> -flags ildct+ilme
> to make it create a proper interlaced video. (Which it does, for sure.)

Because the DVD standard allows either interlaced or progressive video, the
'-target [{pal|ntsc}-]dvd' option does not specify the ildct+ilme flags by
default.

> Therefore the default action is not the best it can do (with a 60p
source). Is
> that a fault, or simply a limitation of the 'preset' system (not knowing
if the
> source video has enough frames to make interlaced or not)?

To prevent frame decimation as you're experiencing, feed ffmpeg either 30fps
progressive or 30fps interlaced, with flags set appropriately for the
latter. If you want to go from 60fps progressive to 30fps interlaced before
encoding, you have to reinterlace first. I don't know if that can be done in
ffmpeg. VirtualDub's 'interlace' filter works, but I usually use the
following Avisynth script fragment for jobs like this (going from 60fps
progressive to 30fps interlaced):

# For top field first material
AssumeTFF()
# For bottom field first material
# AssumeBFF()
SeparateFields()
SelectEvery(4, 0, 3)
Weave()

> 
> --
> Andy
> 
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list