每隔X秒生成一个缩略图

时间:2013-08-01 12:33:58

标签: ffmpeg

我正在尝试每分钟生成一个缩略图,但我收到以下错误:

ffmpeg -i Hung.mp4 -f image2 -vf fps=fps=1/60 img%03d.jpg

[mjpeg @ 0x2f06da0] bitrate tolerance too small for bitrate
[mjpeg @ 0x2f1b7c0] ff_frame_thread_encoder_init failed
Output #0, image2, to 'img%03d.jpg':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: mp41
    Stream #0:0(eng): Video: mjpeg, yuvj420p, 1280x536 [SAR 1:1 DAR 160:67], q=2-31, 200 kb/s, 90k tbn, 0.02 tbc
    Metadata:
      creation_time   : 2013-07-22 00:01:41
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

1 个答案:

答案 0 :(得分:0)

您需要使用-bt设置bitrate tolerence。例如:

ffmpeg -i Hung.mp4 -f image2 -bt 20M -vf fps=fps=10/60 img%03d.jpg

有相关讨论here和错误报告here