Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#771 Scan Type for MBAFF encoded video

Usability
pending
Interlaced (1)
5
2014-01-31
2013-06-22
NDB
No

H.264 interlaced video encoded using MBAFF tools shows up as Scan Type: MBAFF where as PAFF encoded video shows up as Scan Type: Interlaced. I suggest that both show up as Scan Type: Interlaced and with type appended as MBAA or PAFF. For example: Interlaced, MBAFF

Discussion

  • PAFF encoded video shows up as Scan Type: Interlaced.

    Actually, PAFF is not (yet) detected. I don't ee explicit description in specs. Do yo uhave an idea about how to detect it? Sample files would be great.

    For example: Interlaced, MBAFF

    I am not sure I like it (no worry, I don't like the current display too ;-). After reading a bit more about it, maybe MBAFF and PAFF should be more considered as "tools" rather than ScanType information, something more like CABAC. Additionally, MBAFF and PAFF can be in used together, the output would be complex for only "Interlaced" information.

    I propose another display, example with a complex file:
    Format settings: CABAC, 2 Ref frames, MBAFF, PAFF
    Scan type: Interlaced

    Your thoughts?

     
    • status: open --> pending
    • assigned_to: Jerome Martinez
     
  • NDB
    NDB
    2013-06-24

    Hi, Before I can add some more details and possibly provide clips, I had a question. When MediaInfo reports "Scan Type: Interlaced" for H.264 video, what does that actually mean? Or rather what type of encoding is reported as Interlaced? I thought that maybe PAFF video is being reported as Interlaced. There are two forms of Interlaced coding: Frame-encoded and Field-Encoded. If the selection (frame or field encoding) is done of a picture by picture basis, then it is PAFF. If you do it as Macroblock pair-level than it is called MBAFF. So I am not sure what does "Scan Type: Interlaced" mean right now.

    Thanks
    Dinkar

     
  • When MediaInfo reports "Scan Type: Interlaced" for H.264 video, what does that actually mean?

    The goal is to provide information about how it is displayed (time shift between each field), whatever is the format. Before H.264, it was easy, it was the same as the encoded version, but with H.264 it is a bit more complex and I did not take care of it!

    So:

    If you do it as Macroblock pair-level than it is called MBAFF.

    In that case, the displayed "data" at a precise time stamp is a field, right? --> "Interlaced"

    If the selection (frame or field encoding) is done of a picture by picture basis, then it is PAFF.

    In that case, how is the time line?
    If the encoded is for example: Frame / Field 1 / Field 2
    Is the output:
    1/ Frame (33 ms) / Field 1 (17 ms) / Field 2 (17 ms) --> "Mixed"?
    or
    1/ half the Frame (17 ms) / half the Frame (17 ms) / Field 1 (17 ms) / Field 2 (17 ms) --> "Interlaced"

    Currently, the code is:
    seq_parameter_set::mb_adaptive_frame_field_flag 1 --> "MBAFF" (it would be changed to "Interlaced")
    seq_parameter_set::frame_mbs_only_flag 1 --> "Progressive"
    slice_header::field_pic_flag 1 (count of slices having this field 1 is >0) --> "Interlaced". I imagine I should check if there are frames and fields.
    I also read sei_message::pic_timing::ClockTS::ct_type but I don't use it currently

    I try to understand how is the refresh with PAFF: at 30 fps, when a frame is encoded, is the display refresh rate 60 fields per second (17 ms) or 30 frames per second (33 ms)?

    I apologize if it seems confusing, I actually did not really focus on this kind of issue (most files are easy: progressive or interlaced, period), I am interested in learning and displaying the right information.

     
  • BTW, the discussion about how to display information could also include PsF (but I don't know how to detect it).

     
  • NDB
    NDB
    2013-06-25

    I think:

    seq_parameter_set::mb_adaptive_frame_field_flag == 1 and field_pic_flag == 0 --> "MBAFF" picture (Should be "Interlaced"/MBAFF)
    mb_adaptive_frame_field_flag == 1 and field_pic_flag == 1 ---> Interlaced picture without MBAFF (I think this cannot happen).
    seq_parameter_set::frame_mbs_only_flag == 1 --> "Progressive"
    slice_header::field_pic_flag = 1 on ALL frames --> "Interlaced" Video

    Only thing to add:

    if seq_parameter_set::frame_mbs_only_flag = 0 AND field_pic_flag == 1 on some frames (interlaced) and 0 on some others (progressive), then PAFF ...

     
  • mb_adaptive_frame_field_flag == 1 and field_pic_flag == 1 ---> Interlaced picture without MBAFF (I think this cannot happen).

    From specs ;-)
    "if( !frame_mbs_only_flag ) {
    field_pic_flag 2 u(1)"

    if seq_parameter_set::frame_mbs_only_flag = 0 AND field_pic_flag == 1 on some frames (interlaced) and 0 on some others (progressive), then PAFF ...

    So not in the sps? :(
    In that case, I can miss some PAFF (because I don't scan the full file, too long, so if th beginning of the file has only one method, I don't catch PAFF).
    Can you provide some files with PAFF?


    So I plan to change:

    if seq_parameter_set::frame_mbs_only_flag == 1
    {
        ScanType = "Progressive"
    }
    else
    {
      if seq_parameter_set::mb_adaptive_frame_field_flag == 1
      {
        Settings += "MBAFF"
      }
    
      if field_pic_flag == 1 only
      {
        ScanType = "Interlaced"
      }
      else // if (field_pic_flag == 1 on some frames and 0 on some others)
      {
        ScanType = "Mixed" // I think that field_pic_flag == 0 everywhere is not logical, frame_mbs_only_flag  would be 0 instead)
      }
    }
    

    PAFF would be detectable with ScanType == "Mixed", more generic name than PAFF.

     
  • barndawg
    barndawg
    2014-01-31

    We have seen this bug as well and definitely prefer that for MBAFF content, you return ScanType "Interlaced." MBAFF is not a scantype but rather an encoding technique.

    We've also noticed that for MPEG2-TS files where ScanType = MBAFF, there may not be a FieldOrder coming out of MediaInfo. Is it possible to also provide that? We have some autoamtion built around MediaInfo and for most other files we say ScanType = Interlaced FieldOrder = TFF (or something like that).

     
  • MBAFF is not a scantype but rather an encoding technique

    I agree.

    there may not be a FieldOrder coming out of MediaInfo.

    I think it is another bug, please open another ticket and we discuss about that in this new ticket.