在 ffmpeg 命令中,如何提取 q 值超过 5.0 的缩略图?

在 ffmpeg 命令中,如何提取 q 值超过 5.0 的缩略图?

我编辑了问题(谢谢建议)。当我从 ffmpeg 中提取缩略图时,我可以在消息的最后收到这样的消息。

# ffmpeg -ss 600 -i /home/juneyoungoh/Videos/T30644_19_120412.ts.pac -vframes 1 -y /home/juneyoungoh/aaaaaaaaaaaaaaaaaaa.jpg
ffmpeg version git-2013-05-31-9d56ccf Copyright (c) 2000-2013 the FFmpeg developers
  built on May 30 2013 21:34:51 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libopus --enable-libvpx --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3
  libavutil      52. 34.100 / 52. 34.100
  libavcodec     55. 12.102 / 55. 12.102
  libavformat    55.  8.102 / 55.  8.102
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 73.100 /  3. 73.100
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[h264 @ 0x32da920] Cannot use next picture in error concealment
[h264 @ 0x32da920] concealing 742 DC, 742 AC, 742 MV errors in P frame
[h264 @ 0x32da920] left block unavailable for requested intra4x4 mode -1 at 0 5
[h264 @ 0x32da920] error while decoding MB 0 5, bytestream (4350)
[h264 @ 0x32da920] Cannot use next picture in error concealment
[h264 @ 0x32da920] concealing 1174 DC, 1174 AC, 1174 MV errors in P frame
[h264 @ 0x32da920] left block unavailable for requested intra4x4 mode -1 at 0 18
[h264 @ 0x32da920] error while decoding MB 0 18, bytestream (1641)
[h264 @ 0x32da920] Cannot use next picture in error concealment
[h264 @ 0x32da920] concealing 589 DC, 589 AC, 589 MV errors in P frame
[h264 @ 0x32da920] left block unavailable for requested intra mode at 0 9
[h264 @ 0x32da920] error while decoding MB 0 9, bytestream (2331)
[h264 @ 0x32da920] Cannot use next picture in error concealment
[h264 @ 0x32da920] concealing 994 DC, 994 AC, 994 MV errors in P frame
[h264 @ 0x32da920] left block unavailable for requested intra mode at 0 22
[h264 @ 0x32da920] error while decoding MB 0 22, bytestream (269)
[h264 @ 0x32da920] Cannot use next picture in error concealment
[h264 @ 0x32da920] concealing 409 DC, 409 AC, 409 MV errors in P frame
[mpegts @ 0x32d68a0] max_analyze_duration 5000000 reached at 5013333 microseconds
Input #0, mpegts, from '/home/juneyoungoh/Videos/T30644_19_120412.ts.pac':
  Duration: 00:59:01.21, start: 10.000000, bitrate: 2309 kb/s
  Program 1 
    Stream #0:0[0x200]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 29.97 tbr, 90k tbn, 59.93 tbc
    Stream #0:1[0x201]: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 187 kb/s
Output #0, image2, to '/home/juneyoungoh/aaaaaaaaaaaaaaaaaaa.jpg':
  Metadata:
    encoder         : Lavf55.8.102
    Stream #0:0: Video: mjpeg, yuvj420p, 720x480 [SAR 8:9 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
[h264 @ 0x32da920] Missing reference picture, default is 0
[h264 @ 0x32da920] decode_slice_header error
[h264 @ 0x32da920] Cannot use next picture in error concealment
[h264 @ 0x32da920] concealing 686 DC, 686 AC, 686 MV errors in P frame
[h264 @ 0x32da920] left block unavailable for requested intra mode at 0 28
[h264 @ 0x32da920] error while decoding MB 0 28, bytestream (6046)
[h264 @ 0x32da920] Cannot use next picture in error concealment
[h264 @ 0x32da920] concealing 139 DC, 139 AC, 139 MV errors in P frame
[h264 @ 0x32da920] Cannot use next picture in error concealment
[h264 @ 0x32da920] concealing 830 DC, 830 AC, 830 MV errors in P frame
[h264 @ 0x32da920] left block unavailable for requested intra mode at 0 17
[h264 @ 0x32da920] error while decoding MB 0 17, bytestream (11936)
[h264 @ 0x32da920] concealing 634 DC, 634 AC, 634 MV errors in I frame
frame=    1 fps=0.0 q=5.0 Lsize=N/A time=00:00:00.03 bitrate=N/A    
video:23kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.091663%

我认为这部分“frame= 1 fps=0.0 q=5.0 Lsize=N/A time=00:00:00.03 bitrate=N/A ”显示了输出文件的信息(在本例中为 jpg 图像文件)。

我正在寻找的是从视频文件中提取缩略图的方法,仅限“q >= 5.0”的情况。(我认为这个“q”表示质量。我知道有一个选项“q”,但可能有不同的含义)

  1. 我将通过“ss”选项访问视频的某个点。
  2. 我将检查这个帧质量是否超过 5.0。
  3. 如果是,则提取缩略图,否则提取质量值超过 5.0 的最近帧。

我可以使用 ffmpeg 选项 + Linux 命令行来做到这一点吗?

相关内容