Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#3257 closed defect (fixed)

Undesired "bitrate tolerance too small for bitrate" error for simple case

Reported by: Clément Bœsch Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: mjpeg
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Working command:

☭ ./ffmpeg -f lavfi -i testsrc=s=hd1080 -vf scale=80:40,tile=5x1 -frames:v 1 -y out.jpg
ffmpeg version N-59434-gd890db5 Copyright (c) 2000-2013 the FFmpeg developers
  built on Dec 30 2013 11:31:28 with gcc 4.8.2 (GCC) 20131219 (prerelease)
  configuration: --enable-nonfree --enable-gpl --enable-libx264 --enable-libmp3lame --enable-x11grab --enable-libvorbis --samples=/home/ux/fate-samples --enable-libvpx --cpu=native --enable-libfaac --cc='ccache cc' --assert-level=2
  libavutil      52. 59.100 / 52. 59.100
  libavcodec     55. 47.100 / 55. 47.100
  libavformat    55. 22.101 / 55. 22.101
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.103 /  4.  0.103
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, lavfi, from 'testsrc=s=hd1080':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
[swscaler @ 0x298b140] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'out.jpg':
  Metadata:
    encoder         : Lavf55.22.101
    Stream #0:0: Video: mjpeg, yuvj444p, 400x40 [SAR 8:9 DAR 80:9], q=2-31, 200 kb/s, 90k tbn, 5 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> mjpeg)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.20 bitrate=N/A    
video:12kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.184502%

Non-working one:

☭ ./ffmpeg -f lavfi -i testsrc=s=hd1080 -vf fps=0.10,scale=80:40,tile=5x1 -frames:v 1 -y out.jpg
ffmpeg version N-59434-gd890db5 Copyright (c) 2000-2013 the FFmpeg developers
  built on Dec 30 2013 11:31:28 with gcc 4.8.2 (GCC) 20131219 (prerelease)
  configuration: --enable-nonfree --enable-gpl --enable-libx264 --enable-libmp3lame --enable-x11grab --enable-libvorbis --samples=/home/ux/fate-samples --enable-libvpx --cpu=native --enable-libfaac --cc='ccache cc' --assert-level=2
  libavutil      52. 59.100 / 52. 59.100
  libavcodec     55. 47.100 / 55. 47.100
  libavformat    55. 22.101 / 55. 22.101
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.103 /  4.  0.103
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, lavfi, from 'testsrc=s=hd1080':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
[swscaler @ 0x1b11140] deprecated pixel format used, make sure you did set range correctly
[mjpeg @ 0x1b3f2c0] bitrate tolerance too small for bitrate
[mjpeg @ 0x1b1c8e0] ff_frame_thread_encoder_init failed
Output #0, image2, to 'out.jpg':
    Stream #0:0: Video: mjpeg, yuvj444p, 400x40 [SAR 8:9 DAR 80:9], q=2-31, 200 kb/s, 90k tbn, 0.02 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> mjpeg)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

The bitrate out of the filtergraph should be extremely low (see the scale), but it seems based on the input one anyway. I have no idea why the fps filter makes a difference here.

As a workaround, we can add -q:v 0 to avoid the bitrate tolerance check.

Change History (2)

comment:1 by Michael Niedermayer, 11 years ago

Reproduced by developer: set
Resolution: fixed
Status: newclosed

comment:2 by Carl Eugen Hoyos, 11 years ago

Keywords: mjpegenc removed
Note: See TracTickets for help on using tickets.