下面的命令在我的程序中循环用于拍摄快照ffmpeg.exe -ss 720 -i WIn_0_0.wmv -vframes 1 -vf "[in]drawtext=fontsize=18:fontcolor=Red:fontfile='/Windows/Fonts/arial.ttf':text='0\:12\:0':x=(w)-75:y=(h)-20" WIn_0_0_60.jpg
上述代码在 00 秒时拍摄快照。在循环运行时,我有时会得到类似这样的图像
有没有什么办法可以解决这个问题?我在 1 小时内拍摄了 3600 张快照,我发现大约有 20 到 30 张这样的快照,导致最终的缩略图看起来很糟糕。
这是 ffmpeg 控制台消息
ffmpeg.exe -ss 720 -i WIn_0_0.wmv -vframes 1 -vf "[in]drawtext=fontsize=18:fontcolor=Red:fontfile='/Windows/Fonts/arial.ttf':text='0\:12\:0':x=(w)-75:y=(h)-20" WIn_0_0_60.jpg
ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Sep 26 2013 01:50:16 with gcc 4.8.1 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Input #0, asf, from 'C:\Users\CSK\Desktop\totest\1\Report\WIn_0_0.wmv':
Metadata:
WMFSDKNeeded : 0.0.0.0000
DeviceConformanceTemplate: @
WMFSDKVersion : 12.0.7600.16385
IsVBR : 1
VBR Peak : 604576
Buffer Average : 4021058
encoder : Lavf55.12.100
Duration: 01:00:00.06, start: 0.000000, bitrate: 210 kb/s
Stream #0:0: Video: wmv2 (WMV2 / 0x32564D57), yuv420p, 320x240, 14.58 tbr, 1k tbn, 1k tbc
Output #0, image2, to 'C:\Users\CSK\Desktop\totest\1\Report\WIn_0_0\WIn_0_0_60.jpg':
Metadata:
WMFSDKNeeded : 0.0.0.0000
DeviceConformanceTemplate: @
WMFSDKVersion : 12.0.7600.16385
IsVBR : 1
VBR Peak : 604576
Buffer Average : 4021058
encoder : Lavf55.12.100
Stream #0:0: Video: mjpeg, yuvj420p, 320x240, q=2-31, 200 kb/s, 90k tbn, 14.58 tbc
Stream mapping:
Stream #0:0 -> #0:0 (wmv2 -> mjpeg)
Press [q] to stop, [?] for help
[wmv2 @ 024eeb80] warning: first frame is no keyframe
frame= 1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.06 bitrate=N/A dup=0 drop=12