简体   繁体   English

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

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

I want to convert .AVI files coming from a camera-trap to individuals frames, ideally using ffmpeg. 我想将来自相机陷阱的.AVI文件转换为单个帧,最好使用ffmpeg。 Up to now I am not succeeding. 到目前为止,我还没有成功。

The most simple thing I tried, to try to locate the problem, is this (I want all frames and my test file is test.avi): 我尝试找到问题最简单的方法是(我想要所有框架,我的测试文件是test.avi):

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

It fails with the following console message: 它失败,并显示以下控制台消息:

[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

The actual video duration is 10s (when read using vlc for instance, and this is indeed the length of video programmed on the camera-trap. ffmpeg says the duration is 10.50s, and says there is a problem with header parsing (see above). 实际的视频持续时间为10秒(例如,使用vlc读取时,这的确是在相机陷阱上编程的视频长度。ffmpeg表示持续时间为10.50秒,并且报头解析存在问题(请参见上文) 。

I have no idea how to sort this, despite having looked at more than many ffmpeg 'convert video to frames' post. 尽管看过很多ffmpeg的“将视频转换为帧”帖子,但我不知道如何排序。 Any hint would be appreciated, thanks. 任何提示将不胜感激,谢谢。

If you look at the error message, you will see that the file has 2 video streams. 如果查看错误消息,您将看到该文件具有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

and ffmpeg is trying to read for the second one: ffmpeg正在尝试阅读第二篇:

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

You can use -map 0:0 to select the first stream. 您可以使用-map 0:0选择第一个流。

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

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