繁体   English   中英

使用ffmpeg从视频中提取帧-标头问题?

[英]Extract frames from video with ffmpeg - header problem?

我想将来自相机陷阱的.AVI文件转换为单个帧,最好使用ffmpeg。 到目前为止,我还没有成功。

我尝试找到问题最简单的方法是(我想要所有框架,我的测试文件是test.avi):

ffmpeg -i test.avi output_%04d.png

它失败,并显示以下控制台消息:

[avi @ 0x559fb596f8c0] unknown stream type 73647578
[avi @ 0x559fb596f8c0] Something went wrong during header parsing, tag [0][0]id has size 338702712, I will ignore it and try to continue anyway.
[mjpeg @ 0x559fb59709e0] No JPEG data found in image
    Last message repeated 100 times
[avi @ 0x559fb596f8c0] decoding for stream 0 failed
[avi @ 0x559fb596f8c0] Could not find codec parameters for stream 0 (Video: mjpeg (MJPG / 0x47504A4D), none(bt470bg/unknown/unknown), 1280x720): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[avi @ 0x559fb596f8c0] Could not find codec parameters for stream 1 (Video: none (JUNK / 0x4B4E554A), none, 11025x22050): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, avi, from 'test.avi':
  Duration: 00:00:10.50, start: 0.000000, bitrate: 28129 kb/s
    Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), none(bt470bg/unknown/unknown), 1280x720, 20.01 fps, 20.01 tbr, 20.01 tbn, 20.01 tbc
    Stream #0:1: Video: none (JUNK / 0x4B4E554A), none, 11025x22050, 11025 tbr, 11025 tbn, 11025 tbc
Stream mapping:
  Stream #0:1 -> #0:0 (? (?) -> png (native))
Decoder (codec none) not found for input stream #0:1

实际的视频持续时间为10秒(例如,使用vlc读取时,这的确是在相机陷阱上编程的视频长度。ffmpeg表示持续时间为10.50秒,并且报头解析存在问题(请参见上文) 。

尽管看过很多ffmpeg的“将视频转换为帧”帖子,但我不知道如何排序。 任何提示将不胜感激,谢谢。

如果查看错误消息,您将看到该文件具有2个视频流。

Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), none(bt470bg/unknown/unknown), 1280x720, 20.01 fps, 20.01 tbr, 20.01 tbn, 20.01 tbc
Stream #0:1: Video: none (JUNK / 0x4B4E554A), none, 11025x22050, 11025 tbr, 11025 tbn, 11025 tbc

ffmpeg正在尝试阅读第二篇:

Stream mapping:
  Stream #0:1 -> #0:0 (? (?) -> png (native))

您可以使用-map 0:0选择第一个流。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM