我试图通过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
2
您使用的是旧的FFmpeg版本(版本0.6.x是2010年),请先尝试更新到最新版本。这可能解决了你的问题。
—
Nick van Tilborg
@NickvanTilborg我知道这是一个愚蠢的问题,但这是ffmpeg的最新版本?以及如何在终端更新。弗兰基,我是linux系统的新手,我找不到它的位置; 给我一些提示:D
—
Juneyoung哦2013年
在我看来,最好的方法是从FFmpeg Downloads下载最新的源文件。然后运行
—
Nick van Tilborg
configure
和make
命令来编译程序。编译FFmpeg可以帮到你。此外,一个简单的谷歌在服务器上安装FFmpeg会引发数千次点击。
如果你不想构建任何东西,你也可以从下载页面(ffmpeg.org/download.html)运行静态构建,如果你的内核不是太旧了。
—
slhck 2013年
我在2015年3月16日13:26:50与gcc 4.6.3建立的avconv命令上有相同的错误消息。这个问题根本没有本地化,也没有及时,请重新开放
—
Zac