Log in

View Full Version : is there a tool can modify interlace flag in divx/xvid avi ?


FrEEwilL
19th July 2009, 16:55
i've seen many videos encoded without deinterlacing but incorrectly flagged as progressive.
i've looked mpeg4modifier but it seems it can change only field order when interlaced type is detected.
anyone knows which tool, if any, can change interlace<->progressive flag in avi?

thanks.

Guest
20th July 2009, 04:01
AVIs do not have an interlaced/progressive flag.

LoRd_MuldeR
20th July 2009, 04:31
But AVI has a section to store Codec-specific parameters ('strd' chunk). Formats that support interlaced video may store an interlaced/progressive flag there.

I don't know whether Xvid and DivX (or MPEG-4 ASP in general) do that.

Anyway, if the video was encoded interlaced, this must be indicated correctly somewhere in stream/header. Otherwise the video couldn't be decoded properly.

What actually may be the case here: Somebody encoded interlaced video as progressive. So the video is flagged correctly, but encoded wrongly!

And in that case it cannot be fixed simply by setting a flag. You would have to re-encode from the original source...

Guest
20th July 2009, 04:52
So the video is flagged correctly AVI does not have a flag defined to specify progressive/interlaced.

FrEEwilL
20th July 2009, 08:35
I don't know about technical specifications but rely on mediainfo.
there are divx avi's reported as interlaced by mediainfo
(divx has "Preserve interlace" in codec configurations which i assumed is related)
and these videos seemed being deinterlaced on playback (maybe by vga?).
I wanted to change badly encoded videos i mentioned into this status.
but if LoRd is right, i guess there's no workaround without re-encoding. :/

CWR03
20th July 2009, 11:55
"Reported as interlaced" does not indicate that it's flagged as interlaced.

You can create an .avs file which, when opened as a video, will correct the interlacing without re-encoding the file.

LoRd_MuldeR
20th July 2009, 13:01
AVI does not have a flag defined to specify progressive/interlaced.

As explained before, AVI doesn't specify a progressive/interlaced flag on the container-level explicitly. Anyway, a video format that does support interlaced video must store a progressive/interlaced flag (or an equivalent) somewhere. Otherwise the decoder wouldn't be able to decode the video properly! And as said before, AVI has a section to store Codec-specific data (it's the "strd" chunk, that may follow the "strh" and "strf" chunks in the "strl" list), which for example could be used to store such information. Furthermore formats, such as MPEG-4 ASP, have their own bitstream-level header. That's also the place where PAR/DAR information is stored (again because AVI lacks an explicit field for that on the container-level) and which MPEG4Modifier does modify...

You can create an .avs file which, when opened as a video, will correct the interlacing without re-encoding the file.

Tools, such as MediaInfo, can only report how a video was encoded. They can't determine the nature of the original source data.
So if the video is reported to be "progressive", but looks "interlaced", then probably somebody encoded interlaced content as progressive video.
And if you encode interlaced video as progressive (without deinterlacing it first), the result will be broken. No way to fix that afterwards.

(BTW: Note that the other way around, encoding progressive content as interlaced video, doesn't break it. It just reduces the coding efficiency)

Guest
20th July 2009, 14:04
which for example could be used to store such information Please cite one codec that uses it and a player that honors that.

LoRd_MuldeR
20th July 2009, 14:38
Please cite one codec that uses it and a player that honors that.

I didn't say I'm aware of any. I only said it's defined by the AVI specs and could be used. Reality often looks different, like PAR information usually is stored in the MPEG-4 bitstream-level header.

In fact I think if tools like MediaInfo report "interlaced" or "progressive" for video stored in an AVI file, they actually did look at the bitstream to obtain that info - which doesn't make that info any less valid.

Still that only tells us how the video was encoded. It doesn't tell use what the nature of the original source was and how it should have been encoded properly...

Guest
20th July 2009, 14:50
Still that only tells us how the video was encoded. It doesn't tell use what the nature of the original source was and how it should have been encoded properly... That's exactly my point. There is no flag to signal the nature of the content in an AVI, which is what the OP asked for. He wants deinterlacing for display, but only for interlaced content. This has nothing to do with decoding.

FrEEwilL
20th July 2009, 19:12
@neuron2
So could it mean interlaced encoding in avi is always a bad idea and playback deinterlacing will never occur in any way
even if it's correctly encoded in a bitstream level?

how about trascoding avi into another container and force it to assume interlaced? does it possible?

Guest
20th July 2009, 19:17
@neuron2
So could it mean interlaced encoding in avi is always a bad idea and playback deinterlacing will never occur in any way even if it's correctly encoded in a bitstream level? It is an OK idea to encode interlaced if you want to display it interlaced, e.g., via a TV out port to an interlaced TV. Another case would be high-action sports where you want to keep the motion fluidity and your display device can bob deinterlace well.