Opened 8 years ago

Closed 7 years ago

#5888 closed defect (fixed)

ffv1 rgb48le encoding broken without -level 3

Reported by: LordHDL Owned by:
Priority: minor Component: avcodec
Version: git-master Keywords: ffv1
Cc: jerome@mediaarea.net Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug: Cannot encode ffv1 video using rgb48le.
How to reproduce: Record a rawvideo file and attempt to encode it with ffv1 using -pix_fmt rgb48le.

Last login: Thu Oct 13 09:51:16 on ttys000
HDLs-MacBook-Pro:~ HDL$ ffmpeg -i /Users/HDL/Desktop/Fusion.mov -c:v ffv1 -level 3 -pix_fmt rgb48le -c:a copy ~/Desktop/rgb48.nut
ffmpeg version N-81960-g1bda0ee-tessus Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.38)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --as=yasm --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb
  libavutil      55. 32.100 / 55. 32.100
  libavcodec     57. 61.100 / 57. 61.100
  libavformat    57. 51.103 / 57. 51.103
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 63.100 /  6. 63.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  2.100 /  2.  2.100
  libpostproc    54.  0.100 / 54.  0.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/HDL/Desktop/Fusion.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2016-10-13T11:06:59.000000Z
  Duration: 00:00:43.68, start: 0.000000, bitrate: 148727 kb/s
    Stream #0:0(eng): Video: rawvideo (raw  / 0x20776172), argb, 320x240, 147132 kb/s, 59.87 fps, 60 tbr, 6k tbn, 6k tbc (default)
    Metadata:
      creation_time   : 2016-10-13T11:06:59.000000Z
      handler_name    : Apple Alias Data Handler
      encoder         : None
    Stream #0:1(eng): Audio: pcm_s16be (lpcm / 0x6D63706C), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2016-10-13T11:06:59.000000Z
      handler_name    : Apple Alias Data Handler
[ffv1 @ 0x7fcae401fa00] 16bit RGB is experimental and under development, only use it for experiments
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> ffv1 (native))
  Stream #0:1 -> #0:1 (copy)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
HDLs-MacBook-Pro:~ HDL$ 

Change History (10)

comment:1 by Carl Eugen Hoyos, 8 years ago

Keywords: rgb removed
Reproduced by developer: set

The fact that rgb48 ffv1 encoding or decoding is broken is not a regression afaict, reproducible with 62f5e601.
Related to ticket #4882.

comment:2 by Carl Eugen Hoyos, 8 years ago

Status: newopen

comment:3 by Jérôme Martinez, 8 years ago

I think that it is the expected behavior: this is experimental and there is no " -strict experimental" on your command line; and behavior is different on my side if I set " -strict experimental" on the command line, examples:

error if experimental flag is not present:

>ffmpeg -y -f lavfi -i mandelbrot=s=1920x1080 -r 25 -t 2 -c:v ffv1 -level 3 -pix_fmt rgb48le rgb48.nut
ffmpeg version N-81989-g7845c13 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 32.100 / 55. 32.100
  libavcodec     57. 61.103 / 57. 61.103
  libavformat    57. 52.100 / 57. 52.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 64.100 /  6. 64.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  2.100 /  2.  2.100
  libpostproc    54.  0.100 / 54.  0.100
Trailing options were found on the commandline.
Input #0, lavfi, from 'mandelbrot=s=1920x1080':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[0] / 0x424752), rgb0, 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
[ffv1 @ 00000000025b36e0] 16bit RGB is experimental and under development, only use it for experiments
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> ffv1 (native))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

success if experimental flag is present:

>ffmpeg -y -f lavfi -i mandelbrot=s=1920x1080 -r 25 -t 2 -c:v ffv1 -level 3 -pix_fmt rgb48le -strict experimental rgb48.nut
ffmpeg version N-81989-g7845c13 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 32.100 / 55. 32.100
  libavcodec     57. 61.103 / 57. 61.103
  libavformat    57. 52.100 / 57. 52.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 64.100 /  6. 64.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  2.100 /  2.  2.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, lavfi, from 'mandelbrot=s=1920x1080':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[0] / 0x424752), rgb0, 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
[ffv1 @ 0000000000e07440] bits_per_raw_sample > 8, forcing range coder
Output #0, nut, to 'rgb48.nut':
  Metadata:
    encoder         : Lavf57.52.100
    Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), rgb48le, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 51200 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.61.103 ffv1
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> ffv1 (native))
Press [q] to stop, [?] for help
frame=   50 fps=5.4 q=-0.0 Lsize=  211718kB time=00:00:01.96 bitrate=884884.4kbits/s speed=0.213x
video:211716kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001012%

comment:4 by Carl Eugen Hoyos, 8 years ago

I believe you forgot to run ffmpeg -i rgb48.nut.

comment:5 by Carl Eugen Hoyos, 8 years ago

Priority: normalminor
Summary: ffv1 rgb48le encode errorffv1 rgb48le encoding broken without -level 3

Or I forgot -level 3...

$ ffmpeg -f rawvideo -pix_fmt rgb48 -s qcif -i /dev/zero -vframes 1 -vcodec ffv1 -strict -2 out.nut
ffmpeg version N-81983-g4d81f96 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      55. 32.100 / 55. 32.100
  libavcodec     57. 61.103 / 57. 61.103
  libavformat    57. 52.100 / 57. 52.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 63.100 /  6. 63.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  2.100 /  2.  2.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, rawvideo, from '/dev/zero':
  Duration: N/A, start: 0.000000, bitrate: 30412 kb/s
    Stream #0:0: Video: rawvideo (RGB0 / 0x30424752), rgb48le, 176x144, 30412 kb/s, 25 tbr, 25 tbn, 25 tbc
[ffv1 @ 0x2961580] bits_per_raw_sample > 8, forcing range coder
Output #0, nut, to 'out.nut':
  Metadata:
    encoder         : Lavf57.52.100
    Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), rgb48le, 176x144, q=2-31, 200 kb/s, 25 fps, 51200 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.61.103 ffv1
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> ffv1 (native))
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-0.0 Lsize=       1kB time=00:00:00.00 bitrate=424800.0kbits/s speed=0.00499x
video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 38.101429%
$ ffmpeg -i out.nut
ffmpeg version N-81983-g4d81f96 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      55. 32.100 / 55. 32.100
  libavcodec     57. 61.103 / 57. 61.103
  libavformat    57. 52.100 / 57. 52.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 63.100 /  6. 63.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  2.100 /  2.  2.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, nut, from 'out.nut':
  Metadata:
    encoder         : Lavf57.52.100
  Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), bgr0, 176x144, 25 tbr, 51200 tbn, 51200 tbc
    Metadata:
      encoder         : Lavc57.61.103 ffv1
At least one output file must be specified

in reply to:  5 comment:6 by Jérôme Martinez, 8 years ago

Replying to cehoyos:

Or I forgot -level 3...

More precisely: actually without -level option and with small resolution (in order to select level 0 as default, it is level 3 if it is e.g SDTV or higher), or with -level 0.
levels 1, 2, 3 are OK.

Last edited 8 years ago by Jérôme Martinez (previous) (diff)

comment:7 by Jérôme Martinez, 8 years ago

Cc: jerome@mediaarea.net added

comment:8 by LordHDL, 8 years ago

It works when I use -strict -2 but the format named is gbrp16le. Is that intended?

in reply to:  8 comment:9 by Carl Eugen Hoyos, 8 years ago

Replying to LordHDL:

It works when I use -strict -2 but the format named is gbrp16le. Is that intended?

I don't think intended is the right word: It's how lossless compression of 16bit rgb is implemented in ffv1.

comment:10 by Carl Eugen Hoyos, 7 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.