首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FFmpeg毁掉我的图片

FFmpeg毁掉我的图片
EN

Stack Overflow用户
提问于 2015-09-14 05:58:24
回答 2查看 124关注 0票数 0

Rightnow我正在尝试渲染一个Video reading my image文件夹,其中包含大约83个图像。我正在使用这个FFMPEG片段:

代码语言:javascript
复制
 ffmpeg -f image2   -i images/*.jpg  -b 450k -r 30  zoom100.avi  2>&1

但是我真的很沮丧,FFMPEG总是用第一张图片替换我所有的图片。它还创建了大约2帧长的视频,这里是FFMPEF反馈

代码语言:javascript
复制
ffmpeg version 0.8.17-4:0.8.17-0ubuntu0.12.04.1, Copyright (c) 2000-2014 the Libav developers
  built on Mar 16 2015 13:26:50 with gcc 4.6.3
The ffmpeg program is only provided for script compatibility and will be removed
in a future release. It has been deprecated in the Libav project to allow for
incompatible command line syntax improvements in its replacement called avconv
(see Changelog for details). Please use avconv instead.
Input #0, image2, from 'images/0750.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mjpeg, yuvj420p, 1280x1280 [PAR 72:72 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
[buffer @ 0x24a4220] w:1280 h:1280 pixfmt:yuvj420p
[buffer @ 0x24a4a00] w:1280 h:1280 pixfmt:yuvj420p
[buffer @ 0x24a52c0] w:1280 h:1280 pixfmt:yuvj420p
[buffer @ 0x24a5b20] w:1280 h:1280 pixfmt:yuvj420p
.....
.....
.....
.....
.....
.....

[buffer @ 0x24d4320] w:1280 h:1280 pixfmt:yuvj420p
Incompatible pixel format 'yuvj420p' for codec 'mpeg4', auto-selecting format 'yuv420p'
[buffer @ 0x24d03c0] w:1280 h:1280 pixfmt:yuvj420p
[avsink @ 0x24ceea0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x24cc460] w:1280 h:1280 fmt:yuvj420p -> w:1280 h:1280 fmt:yuv420p flags:0x4
Output #0, image2, to 'images/0751.jpg':
  Metadata:
    encoder         : Lavf53.21.1
    Stream #0.0: Video: mjpeg, yuvj420p, 1280x1280 [PAR 72:72 DAR 1:1], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Output #1, image2, to 'images/0752.jpg':
  Metadata:
    encoder         : Lavf53.21.1
    Stream #1.0: Video: mjpeg, yuvj420p, 1280x1280 [PAR 72:72 DAR 1:1], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Output #2, image2, to 'images/0753.jpg':
  Metadata:
    encoder         : Lavf53.21.1
    Stream #2.0: Video: mjpeg, yuvj420p, 1280x1280 [PAR 72:72 DAR 1:1], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    ....
    ....
    ....
    ....
Output #82, image2, to 'images/0833.jpg':
  Metadata:
    encoder         : Lavf53.21.1
    Stream #82.0: Video: mjpeg, yuvj420p, 1280x1280 [PAR 72:72 DAR 1:1], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Output #83, avi, to 'zoom100.avi':
  Metadata:
    ISFT            : Lavf53.21.1
    Stream #83.0: Video: mpeg4, yuv420p, 1280x1280 [PAR 1:1 DAR 1:1], q=2-31, 450 kb/s, 30 tbn, 30 tbc
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.0 -> #1.0
  Stream #0.0 -> #2.0
  Stream #0.0 -> #3.0
  Stream #0.0 -> #4.0
    ....
    ....

  Stream #0.0 -> #80.0
  Stream #0.0 -> #81.0
  Stream #0.0 -> #82.0
  Stream #0.0 -> #83.0
Press ctrl-c to stop encoding
frame=    1 fps=  0 q=7.0 Lq=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=7.0 q=6.5 size=      -0kB time=0.03 bitrate=  -5.3kbits/s    
video:16698kB audio:0kB global headers:0kB muxing overhead -100.000129%
EN

回答 2

Stack Overflow用户

发布于 2015-09-14 07:56:46

不要在不使用-pattern_type glob的情况下单独使用*:否则它将假定第一个图像是唯一的输入,其余的是输出。如果使用-y,这尤其危险,因为它会在没有询问您的情况下覆盖输入图像。

Glob模式

代码语言:javascript
复制
ffmpeg -framerate 30 -pattern_type glob -i "images/*.jpg" output

可能在Windows上不受支持。

序列模式

代码语言:javascript
复制
ffmpeg -framerate 30 -i images/%04d.png output

假设您的输入名为0001.png0002.png0003.png等。

另请参阅

票数 2
EN

Stack Overflow用户

发布于 2015-09-14 07:19:53

代码语言:javascript
复制
ffmpeg -f image2   -i images/%04d.jpg  -b 450k -r 30  zoom100.avi

否则,shell将其展开,其中第一个图像是输入文件,其他图像是输出文件。这样,它们都是输入文件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32554928

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档