jamaal81 / lavfilters

Automatically exported from code.google.com/p/lavfilters
GNU General Public License v2.0
0 stars 0 forks source link

VIDEOINFOHEADER2: dwInterlace Flag reports wrong values #189

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Describe the issue you're having:
- The VIDEOINFOHEADER2: dwInterlace Flag reports wrong values for several video 
formats including MPEG2,DNXHD, PRORES, AVCHD. ALl files with Progressive or 
Field 1 are reporting 0x81 instead of 0x0 for progressive or 0xN5 for Field1 
based clips.

How can the issue be reproduced? Sample File?
-It is enough to create some graphs with Graphstudio or Graphstudio next and to 
check the values for VIDEOINFOHEADER2: dwInterlace Flag

What version of the product are you using? In which Player?
I've used LAV filters 0.45. Graphstudio

Please provide any additional information below.
I've attached a graph used to decode a an MPG file created with Field1 
dominance: as you can see the IVS MPEG2 decoder decodes it fine while the LAV 
filters are setting it to 0x0 for splitter and 0x81 for Decoder. Also other 
files with Progressive dominance are showing 0x81 value in the decoder pin 
properties Xform out. 

Original issue reported on code.google.com by roberto....@ivs.it on 11 Feb 2012 at 12:15

Attachments:

GoogleCodeExporter commented 9 years ago
The behavior is as intended.

If its not 100% clear if the file is completely progressive, it'll be marked as 
0x81, which basically means its mixed material and the flags on each frame 
itself will indicate if its interlaced or progressive. Only if, for example in 
mpeg2, the header marks it as progressive_sequence, it'll be set to 0x0.

The media type is only a hint, and as documented by the MSDN, if its set to 
"AMINTERLACE_DisplayModeBobOrWeave" (0x80), the flags on every frame indicate 
if its interlaced (frame flags of 0 for bottom field first, or 
AM_VIDEO_FLAG_FIELD1FIRST for top field first), or a progressive frame (frame 
flags of AM_VIDEO_FLAG_WEAVE)

As noted above, the frame flags also indicate which field is supposed to be 
shown first, therefor no global setting is applied. Additionally the field 
order may change mid-stream, or even on a per frame basis (commonly used with 
soft-telecine)

The splitter will never set such flags because it doesn't know, and the decoder 
also doesn't need that information.

Original comment by h.lepp...@gmail.com on 11 Feb 2012 at 12:40

GoogleCodeExporter commented 9 years ago
With all due respect,your analisys is wrong. Probably you never used an Hw card 
to check the  output of your filters (see BlackMagic, AJA, BlueFish Cards) 
because could be more easy understand that current lav filtes are unusable for 
any broadcast usage or for any visual computing task. That you call an "hint" 
is a very important detail because allows some filters to auto adjust the field 
order according the ouput capabilities. Probably on VGA monitor you can 
consider minimum the impact of this flag but on a PAL Monitor (Usually Field 1) 
and NTSC monitor (Usually field 2) this hint is crucial. To try to let 
understand the matter please consider we need to convert CirclesandSquares.Mpeg 
file (1920x1080@50i -Field1) to a SD DV AVI file (720x576@50i - Field2): so 
please check the following graphs: The first uses ivs MPEG2 decoder that 
exports the right flag to the medialooks videoscaler filter, This filter only 
in this way can automatically downscale our video and if it is set to create a 
new stream of 720x576@50i - Field2  swaps the fields and move up one scanline 
as required to transform a stream from Field 1 to field2 . In the second graph 
(hepp2.jpg) the lav video decoder exports bad flag and the ML videoscaler, 
getting both Input and Output Intelace flags unchanged, will not swap the 
fields as required and we will get a DV avi file with bad field order. I'cant 
believe that a coder with your skill can believe to be still in the right after 
this feedback. I will wait hopefully to read your answer. :)

Original comment by roberto....@ivs.it on 11 Feb 2012 at 5:53

Attachments:

GoogleCodeExporter commented 9 years ago
here I've highlighted the relevant details required to convert the 
1920x1080@50i Field1 to DV.

Original comment by roberto....@ivs.it on 11 Feb 2012 at 6:19

Attachments:

GoogleCodeExporter commented 9 years ago
Sounds like the software you're using is just not capable of dealing with 
per-frame flags. Per-frame is much more accurate then defining one flag for the 
whole stream. If every frame has a flag which field is the first, why would you 
ever need a global flag?

Like i said, the field order can change mid-stream, and there are a lot of 
files were it actually will change - or in the case of telecine switch on every 
other frame.

The way it works now is fully compliant to MSDNs documentation.

I have no plans to change this. It works fine in the playback environments i 
tested it with, which is my main target.

Original comment by h.lepp...@gmail.com on 11 Feb 2012 at 6:22

GoogleCodeExporter commented 9 years ago
It is very strange because in several years (18),working with several highend 
Editing video apps (some as coder or betatester) or working with thousands of 
editors I never got a file that changes the field order in middle of stream. 
Probably it exists but it is no so usual as you believe. 
Medialooks, Mainconcept, Elecard and all other Decoder/Encoder Directshow 
filters used in the best Commercial video software are working as I'm reporting 
considering that flag as crucial. 
I' will try to read again the MSDN pages related to interlacing flags because 
also with my curriculum there is always something to learn.
I'd like to try only one transform directshow filter is getting the interlacing 
info from frames: I will apreciate if you can list me one.

About Telecine we have worked with it : it works/sorts/mixes the fields in 
order to mantain smooth playback without to present bad fields order artifacts 
changing the frame rate but the field dominance of resulting media is 
necessarily the same for the entire stream duration. 

I cant hide my frustration to see a so interesting filter with some features 
very powerful like colorspace options that are much better than other not 
free/commercial filters to drop on "hint" like dwinterlaceflag remaining 
confined to play files on some desktop media player. Some guys could have 
noticed that for this task there is already VLC or Media Player Classic.
Only If you will change idea, you will be able really to open your filter to 
the closed standadized world, so  your coding efforts will result still more 
interesting for still more people.

Best Regards
Roberto

Original comment by roberto....@ivs.it on 12 Feb 2012 at 12:01