Skip to main content

Topic: How to change scan type of H.264 video. (Read 4795 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • psycho
  • [*][*][*]
How to change scan type of H.264 video.
I have H.264 video that is clearly interlaced but has the scan type info set to "Progressive", when I check it with mediainfo.

Is there a way to change this info (flag?) so that my decoder will know it has to deinterlace when I play it? Preferably without re-encoding!
lame -V 0

  • Mole
  • [*]
How to change scan type of H.264 video.
Reply #1
No, this is not a flag. They screwed up during encoding and encoded an interlaced video as progressive.

You'll have to re-encode it as interlaced.

Can't you force your decoder to deinterlace?

  • psycho
  • [*][*][*]
How to change scan type of H.264 video.
Reply #2
I'm sorry for late reply... I have almost forgot about my post. Forcing the decoder to deinterlace works fine on the PC, I would like it to work on the standalone player too. And there's no forcing to deinterlace there. Thanks for trying to help. I guess that there's no other way to go about solving this other than to just re-encode it with deinterlace filter... Oh well...
lame -V 0

  • elecyb
  • [*]
How to change scan type of H.264 video.
Reply #3
Actually, as I understand, the file format contains this information. For example, in the QuickTime file format there is a "Box" or "Atom" called "fiel" for that purpose.
Your file with the H.264 video may be a .MP4 file.. And the MP4 file format specification derives from QuickTime.
You can read about the format specification in this link: QuickTime File Format Specification

I transcribe the description about the atom "fiel" for you:
"Two 8-bit integers that define field handling. This information is used by applications to modify decompressed image data or by decompressor components to determine field display order. This extension is mandatory for all uncompressed Y´CbCr data formats. The first byte specifies the field count, and may be set to 1 or 2. A value of 1 is used for progressive-scan images; a value of 2 indicates interlaced images. When the field count is 2, the second byte specifies the field ordering: which field contains the topmost scan-line, which field should be displayed earliest, and which is stored first in each sample. Each sample consists of two distinct compressed images, each coding one field: the field with the topmost scan-line, T, and the other field, B. The following defines the permitted variants: 0 – There is only one field. 1 – T is displayed earliest, T is stored first in the file. 6 – B is displayed earliest, B is stored first in the file. 9 – B is displayed earliest, T is stored first in the file. 14 – T is displayed earliest, B is stored first in the file." 

At this moment, I am writing an application to fix pixel aspect ratio and scan type of video files recorded with a Samsung Camcorder F30 series.