Opened 4 years ago

#8605 new defect

DV25 flagged as progressive in AVI vprp chunk

Reported by: Jérôme Martinez Owned by:
Priority: normal Component: avformat
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
DV25 is interlaced (the only progressive DV are "DVCPRO Progressive" format at 50 Mbps, and DVCPRO HD), but is sometimes flagged as progressive when muxed in AVI by FFmpeg.

DV --> MOV: OK (no "fiel" atom written)
DV --> AVI: NOK ("vprp" chunk written with FieldPerFrame set to 1)

DV in MOV with correct "fiel" atom -> AVI: OK ("vprp" chunk written with FieldPerFrame set to 2)
DV in AVI with correct "vprp" chunk -> AVI: NOK ("vprp" chunk written with FieldPerFrame set to 1)

First command is DV in AVI direct creation (wrong "vprp").
Second and third command are transwrapping from DV in MOV (edited for injecting a "fiel" atom, attached) to AVI (this one is OK, correct "vprp"), then AVI to AVI (this one is NOK, wrong "vprp").

How to reproduce:

ffmpeg  -f lavfi -i testsrc=size=720x576 -vcodec dvvideo -r 25 -acodec pcm_s16be -ac 2 -vframes 1 dvpp_direct.avi
ffmpeg version git-2020-04-03-52523b6 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200328
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 77.101 / 58. 77.101
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, lavfi, from 'testsrc=size=720x576':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 720x576 [SAR 1:1 DAR 5:4], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> dvvideo (native))
Press [q] to stop, [?] for help
Output #0, avi, to 'dvpp_direct.avi':
  Metadata:
    ISFT            : Lavf58.42.100
    Stream #0:0: Video: dvvideo (dvsd / 0x64737664), yuv420p, 720x576 [SAR 1:1 DAR 5:4], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.77.101 dvvideo
frame=    1 fps=0.0 q=-0.0 Lsize=     146kB time=00:00:00.04 bitrate=29957.2kbits/s speed=2.67x
video:141kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.018055%

If you check the content of "vprp" chunck with an AVI debug tool, you can see e.g.:
010F4   Video properties (76 bytes)
010F4    Header (8 bytes)
010F4     Name:                               vprp
010F8     Size:                               68 (0x00000044)
010FC    VideoFormatToken:                    0 (0x00000000)
01100    VideoStandard:                       0 (0x00000000)
01104    VerticalRefreshRate:                 25 (0x00000019)
01108    HTotalInT:                           720 (0x000002D0)
0110C    VTotalInLines:                       576 (0x00000240)
01110    FrameAspectRatio Height:             4 (0x0004)
01112    FrameAspectRatio Width:              5 (0x0005)
01114    FrameWidthInPixels:                  720 (0x000002D0)
01118    FrameHeightInLines:                  576 (0x00000240)
0111C    FieldPerFrame:                       1 (0x00000001)
01120    Field (32 bytes)
01120     CompressedBMHeight:                 576 (0x00000240)
01124     CompressedBMWidth:                  720 (0x000002D0)
01128     ValidBMHeight:                      576 (0x00000240)
0112C     ValidBMWidth:                       720 (0x000002D0)
01130     ValidBMXOffset:                     0 (0x00000000)
01134     ValidBMYOffset:                     0 (0x00000000)
01138     VideoXOffsetInT:                    0 (0x00000000)
0113C     VideoYValidStartLine:               0 (0x00000000)

***

ffmpeg -i dvpp_fiel.mov -c:v copy dvpp_fiel.avi
ffmpeg version git-2020-04-03-52523b6 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200328
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 77.101 / 58. 77.101
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'dvpp_fiel.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Manual edited
  Duration: 00:00:00.04, start: 0.000000, bitrate: 29085 kb/s
    Stream #0:0: Video: dvvideo (dvcp / 0x70637664), yuv420p(bottom coded first (swapped)), 720x576 [SAR 16:15 DAR 4:3], 28800 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      timecode        : 00:00:00:00
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s
    Metadata:
      handler_name    : TimeCodeHandler
      timecode        : 00:00:00:00
Output #0, avi, to 'dvpp_fiel.avi':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    ISFT            : Lavf58.42.100
    Stream #0:0: Video: dvvideo (dvsd / 0x64737664), yuv420p(bottom coded first (swapped)), 720x576 [SAR 16:15 DAR 4:3], q=2-31, 28800 kb/s, 25 fps, 25 tbr, 50 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      timecode        : 00:00:00:00
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-1.0 Lsize=     146kB time=00:00:00.02 bitrate=59936.8kbits/s speed=  20x
video:141kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.056944%

If you check the content of "vprp" chunck with an AVI debug tool, you can see e.g.:
010F4   Video properties (108 bytes)
010F4    Header (8 bytes)
010F4     Name:                               vprp
010F8     Size:                               100 (0x00000064)
010FC    VideoFormatToken:                    0 (0x00000000)
01100    VideoStandard:                       0 (0x00000000)
01104    VerticalRefreshRate:                 50 (0x00000032)
01108    HTotalInT:                           720 (0x000002D0)
0110C    VTotalInLines:                       576 (0x00000240)
01110    FrameAspectRatio Height:             3 (0x0003)
01112    FrameAspectRatio Width:              4 (0x0004)
01114    FrameWidthInPixels:                  720 (0x000002D0)
01118    FrameHeightInLines:                  576 (0x00000240)
0111C    FieldPerFrame:                       2 (0x00000002)
01120    Field (32 bytes)
01120     CompressedBMHeight:                 288 (0x00000120)
01124     CompressedBMWidth:                  720 (0x000002D0)
01128     ValidBMHeight:                      288 (0x00000120)
0112C     ValidBMWidth:                       720 (0x000002D0)
01130     ValidBMXOffset:                     0 (0x00000000)
01134     ValidBMYOffset:                     0 (0x00000000)
01138     VideoXOffsetInT:                    0 (0x00000000)
0113C     VideoYValidStartLine:               1 (0x00000001)
01140    Field (32 bytes)
01140     CompressedBMHeight:                 288 (0x00000120)
01144     CompressedBMWidth:                  720 (0x000002D0)
01148     ValidBMHeight:                      288 (0x00000120)
0114C     ValidBMWidth:                       720 (0x000002D0)
01150     ValidBMXOffset:                     0 (0x00000000)
01154     ValidBMYOffset:                     0 (0x00000000)
01158     VideoXOffsetInT:                    0 (0x00000000)
0115C     VideoYValidStartLine:               0 (0x00000000)

ffmpeg -i dvpp_fiel.avi -c:v copy dvpp_fiel2.avi
ffmpeg version git-2020-04-03-52523b6 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200328
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 77.101 / 58. 77.101
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, avi, from 'dvpp_fiel.avi':
  Metadata:
    encoder         : Lavf58.42.100
  Duration: 00:00:00.04, start: 0.000000, bitrate: 29968 kb/s
    Stream #0:0: Video: dvvideo (dvsd / 0x64737664), yuv420p, 720x576 [SAR 16:15 DAR 4:3], 50 fps, 25 tbr, 50 tbn, 25 tbc
Output #0, avi, to 'dvpp_fiel2.avi':
  Metadata:
    ISFT            : Lavf58.42.100
    Stream #0:0: Video: dvvideo (dvsd / 0x64737664), yuv420p, 720x576 [SAR 16:15 DAR 4:3], q=2-31, 50 fps, 25 tbr, 50 tbn, 50 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=    2 fps=0.0 q=-1.0 Lsize=     146kB time=00:00:00.04 bitrate=29966.8kbits/s speed=N/A
video:141kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.051389%

If you check the content of "vprp" chunck with an AVI debug tool, you can see e.g.:
010F4   Video properties (76 bytes)
010F4    Header (8 bytes)
010F4     Name:                               vprp
010F8     Size:                               68 (0x00000044)
010FC    VideoFormatToken:                    0 (0x00000000)
01100    VideoStandard:                       0 (0x00000000)
01104    VerticalRefreshRate:                 50 (0x00000032)
01108    HTotalInT:                           720 (0x000002D0)
0110C    VTotalInLines:                       576 (0x00000240)
01110    FrameAspectRatio Height:             3 (0x0003)
01112    FrameAspectRatio Width:              4 (0x0004)
01114    FrameWidthInPixels:                  720 (0x000002D0)
01118    FrameHeightInLines:                  576 (0x00000240)
0111C    FieldPerFrame:                       1 (0x00000001)
01120    Field (32 bytes)
01120     CompressedBMHeight:                 576 (0x00000240)
01124     CompressedBMWidth:                  720 (0x000002D0)
01128     ValidBMHeight:                      576 (0x00000240)
0112C     ValidBMWidth:                       720 (0x000002D0)
01130     ValidBMXOffset:                     0 (0x00000000)
01134     ValidBMYOffset:                     0 (0x00000000)
01138     VideoXOffsetInT:                    0 (0x00000000)
0113C     VideoYValidStartLine:               0 (0x00000000)

Attachments (1)

dvpp_fiel.mov (142.0 KB ) - added by Jérôme Martinez 4 years ago.
DV25 in MOV with "fiel" atom

Download all attachments as: .zip

Change History (1)

by Jérôme Martinez, 4 years ago

Attachment: dvpp_fiel.mov added

DV25 in MOV with "fiel" atom

Note: See TracTickets for help on using tickets.