我正在尝试通过 ffmpeg 命令截取一些缩略图。我的文件名是“aaa.ts”,我想每秒截取一些缩略图。
说实话,它能用,但是终端里有 4 条红线。你能告诉我我遇到了什么问题并给我一些解决方案吗?
我的命令是:
ffmpeg -i aaa.ts -r 1 screenshot%03d.png
它在目录中制作了一些 png,但最开始的两个或三个完全是灰色的,并且命令的输出有这四个错误。
- [mpeg2video @ 0x24bed10]mpeg_decode_postinit() 失败
- [mpeg2video @ 0x24bed10]警告:第一帧没有关键帧
- [mpeg2video @ 0x24bed10]ac-tex 在 31 60 处损坏
- [mpeg2video @ 0x24bed10]警告 MV 不可用
完整日志
[juneyoungoh@localhost Videos]$ ffmpeg -i aaa.ts -r 1 screenshot%03d.pngFFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 23:55:02 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mpeg2video @ 0x2609d10]mpeg_decode_postinit() failure
Last message repeated 10 times
Input #0, mpegts, from 'aaa.ts':
Duration: 00:00:04.62, start: 16912.065044, bitrate: 18146 kb/s
Program 1
Stream #0.0[0x11]: Video: mpeg2video, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 19190 kb/s, 34.70 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0.1[0x14](): Audio: ac3, 48000 Hz, stereo, s16, 384 kb/s
Output #0, image2, to 'screenshot%03d.png':
Metadata:
encoder : Lavf52.64.2
Stream #0.0: Video: png, rgb24, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 1 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
[mpeg2video @ 0x2609d10]warning: first frame is no keyframe
frame= 3 fps= 0 q=0.0 size= -0kB time=3.00 bitrate= -0.1kbits/s dup=0 frame= 4 fps= 3 q=0.0 size= -0kB time=4.00 bitrate= -0.0kbits/s dup=0 frame= 5 fps= 3 q=0.0 size= -0kB time=5.00 bitrate= -0.0kbits/s dup=0 frame= 6 fps= 2 q=0.0 size= -0kB time=6.00 bitrate= -0.0kbits/s dup=0 [mpeg2video @ 0x2609d10]ac-tex damaged at 31 60
[mpeg2video @ 0x2609d10]Warning MVs not available
[mpeg2video @ 0x2609d10]concealing 960 DC, 960 AC, 960 MV errors
frame= 6 fps= 2 q=0.0 Lsize= -0kB time=6.00 bitrate= -0.0kbits/s dup=0 drop=122
video:12381kB audio:0kB global headers:0kB muxing overhead -100.000174%
[juneyoungoh@localhost Videos]$ ffmpeg -r 1 -i aaa.ts screenshot%03d.pngFFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 23:55:02 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mpeg2video @ 0x20c3d10]mpeg_decode_postinit() failure
Last message repeated 10 times
Input #0, mpegts, from 'aaa.ts':
Duration: 00:00:04.62, start: 16912.065044, bitrate: 18146 kb/s
Program 1
Stream #0.0[0x11]: Video: mpeg2video, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 19190 kb/s, 34.70 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0.1[0x14](): Audio: ac3, 48000 Hz, stereo, s16, 384 kb/s
Output #0, image2, to 'screenshot%03d.png':
Metadata:
encoder : Lavf52.64.2
Stream #0.0: Video: png, rgb24, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
[mpeg2video @ 0x20c3d10]warning: first frame is no keyframe
frame= 10 fps= 0 q=0.0 size= -0kB time=0.33 bitrate= -0.5kbits/s dup=9 frame= 12 fps= 11 q=0.0 size= -0kB time=0.40 bitrate= -0.4kbits/s dup=9 frame= 14 fps= 8 q=0.0 size= -0kB time=0.47 bitrate= -0.4kbits/s dup=9 frame= 16 fps= 6 q=0.0 size= -0kB time=0.53 bitrate= -0.3kbits/s dup=9 frame= 18 fps= 5 q=0.0 size= -0kB time=0.60 bitrate= -0.3kbits/s dup=9 frame= 19 fps= 5 q=0.0 size= -0kB time=0.63 bitrate= -0.3kbits/s dup=9 frame= 21 fps= 4 q=0.0 size= -0kB time=0.70 bitrate= -0.3kbits/s dup=9 frame= 23 fps= 4 q=0.0 size= -0kB time=0.77 bitrate= -0.2kbits/s dup=9 frame= 24 fps= 4 q=0.0 size= -0kB time=0.80 bitrate= -0.2kbits/s dup=9 frame= 26 fps= 4 q=0.0 size= -0kB time=0.87 bitrate= -0.2kbits/s dup=9 frame= 28 fps= 4 q=0.0 size= -0kB time=0.93 bitrate= -0.2kbits/s dup=9 frame= 30 fps= 4 q=0.0 size= -0kB time=1.00 bitrate= -0.2kbits/s dup=9 frame= 31 fps= 4 q=0.0 size= -0kB time=1.03 bitrate= -0.2kbits/s dup=9 frame= 33 fps= 4 q=0.0 size= -0kB time=1.10 bitrate= -0.2kbits/s dup=9 frame= 35 fps= 4 q=0.0 size= -0kB time=1.17 bitrate= -0.2kbits/s dup=9 frame= 36 fps= 3 q=0.0 Lsize= -0kB time=1.20 bitrate= -0.1kbits/s dup=9 drop=0
video:60368kB audio:0kB global headers:0kB muxing overhead -100.000036%
[juneyoungoh@localhost Videos]$ ffmpeg -i aaa.ts -r 1 screenshot%03d.png
FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 23:55:02 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mpeg2video @ 0x24bed10]mpeg_decode_postinit() failure
Last message repeated 10 times
Input #0, mpegts, from 'aaa.ts':
Duration: 00:00:04.62, start: 16912.065044, bitrate: 18146 kb/s
Program 1
Stream #0.0[0x11]: Video: mpeg2video, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 19190 kb/s, 34.70 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0.1[0x14](): Audio: ac3, 48000 Hz, stereo, s16, 384 kb/s
Output #0, image2, to 'screenshot%03d.png':
Metadata:
encoder : Lavf52.64.2
Stream #0.0: Video: png, rgb24, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 1 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
[mpeg2video @ 0x24bed10]warning: first frame is no keyframe
frame= 3 fps= 0 q=0.0 size= -0kB time=3.00 bitrate= -0.1kbits/s dup=0 frame= 4 fps= 3 q=0.0 size= -0kB time=4.00 bitrate= -0.0kbits/s dup=0 frame= 5 fps= 3 q=0.0 size= -0kB time=5.00 bitrate= -0.0kbits/s dup=0 frame= 6 fps= 2 q=0.0 size= -0kB time=6.00 bitrate= -0.0kbits/s dup=0 [mpeg2video @ 0x24bed10]ac-tex damaged at 31 60
[mpeg2video @ 0x24bed10]Warning MVs not available
[mpeg2video @ 0x24bed10]concealing 960 DC, 960 AC, 960 MV errors
frame= 6 fps= 2 q=0.0 Lsize= -0kB time=6.00 bitrate= -0.0kbits/s dup=0 drop=122
video:12381kB audio:0kB global headers:0kB muxing overhead -100.000174%
非常感谢。这个问题已经解决了。就像 Nick 说的一样,这是版本问题。再次感谢 :D