Opened 6 weeks ago

Last modified 6 weeks ago

#7880 open defect

Video codec qtrle inputs are truncated in output

Reported by: Acru Owned by:
Priority: important Component: ffmpeg
Version: git-master Keywords: qtrle regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:

When transcoding with a mov/qtrle video as the source (one of the few formats supporting alpha channel), frames are being lost from the end of the output, notably if the last frame is blank and repeats but possibly in other cases too.

This issue seems to have appeared between release 4.0.2 and 4.1, and persists to at least build 20190505-e384f6f.

Tested with windows 32/64-bit static builds.

How to reproduce:

Create a video from a few identical blank pngs; (eg. 256x256 white, 8 frames)
ffmpeg -framerate 1 -i Test\%04d.png -c:v qtrle -y TestIn.mov
Transcode into any other format;
ffmpeg -i TestIn.mov -c:v qtrle -y TestOut.mov

Check resulting frame counts; (Or check video duration)
ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 TestIn.mov
ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 TestOut.mov

Log:

>ffmpeg -framerate 1 -i Test\%04d.png -c:v qtrle -y TestIn.mov
ffmpeg version N-93762-ge384f6f2f9 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.3.1 (GCC) 20190414
  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-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-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 52.100 / 58. 52.100
  libavformat    58. 27.103 / 58. 27.103
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 50.100 /  7. 50.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, image2, from 'Test\%04d.png':
  Duration: 00:00:08.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: png, rgba(pc), 256x256 [SAR 3780:3780 DAR 1:1], 1 fps, 1 tbr, 1 tbn, 1 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> qtrle (native))
Press [q] to stop, [?] for help
Output #0, mov, to 'TestIn.mov':
  Metadata:
    encoder         : Lavf58.27.103
    Stream #0:0: Video: qtrle (rle  / 0x20656C72), argb, 256x256 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 1 fps, 16384 tbn, 1 tbc
    Metadata:
      encoder         : Lavc58.52.100 qtrle
frame=    8 fps=0.0 q=-0.0 Lsize=       4kB time=00:00:07.00 bitrate=   4.5kbits/s speed= 778x
video:3kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 25.383633%

>ffmpeg -i TestIn.mov -c:v qtrle -y TestOut.mov
ffmpeg version N-93762-ge384f6f2f9 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.3.1 (GCC) 20190414
  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-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-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 52.100 / 58. 52.100
  libavformat    58. 27.103 / 58. 27.103
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 50.100 /  7. 50.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'TestIn.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf58.27.103
  Duration: 00:00:08.00, start: 0.000000, bitrate: 3 kb/s
    Stream #0:0(eng): Video: qtrle (rle  / 0x20656C72), argb(progressive), 256x256, 3 kb/s, SAR 1:1 DAR 1:1, 1 fps, 1 tbr, 16384 tbn, 16384 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.52.100 qtrle
Stream mapping:
  Stream #0:0 -> #0:0 (qtrle (native) -> qtrle (native))
Press [q] to stop, [?] for help
Output #0, mov, to 'TestOut.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf58.27.103
    Stream #0:0(eng): Video: qtrle (rle  / 0x20656C72), argb, 256x256 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 1 fps, 16384 tbn, 1 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.52.100 qtrle
frame=    1 fps=0.0 q=-0.0 Lsize=       4kB time=00:00:00.00 bitrate=501114.8kbits/s speed=0.00762x
video:3kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 24.098734%

>ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 TestIn.mov
8

>ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 TestOut.mov
1

Leave a note if you find a workaround, reverted to ffmpeg version 4.0.2 in the mean time.

Change History (5)

comment:1 Changed 6 weeks ago by richardpl

This is caused by one of fixes by Michael.
Any duplicate frame is simply dropped.

comment:2 follow-up: Changed 6 weeks ago by richardpl

Try to use -vsync cfr as input option.

comment:3 Changed 6 weeks ago by cehoyos

  • Keywords regression added; duration removed
  • Priority changed from normal to important
  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from 4.1 to git-master

comment:4 in reply to: ↑ 2 Changed 6 weeks ago by Acru

Replying to richardpl:

Try to use -vsync cfr as input option.

I tried -vsync with 0 1 and 2, as input option (and output just to be sure), though no effect.

comment:5 Changed 6 weeks ago by cehoyos

Of course, there would be no issue if that worked.

Note: See TracTickets for help on using tickets.