如何使用ffmpeg从YUV视频中提取帧(或perticular帧) [英] How to extract frames(or a perticular frame) from a YUV video using ffmpeg

查看:1856
本文介绍了如何使用ffmpeg从YUV视频中提取帧(或perticular帧)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是从 MP4 视频中提取帧的代码。
ffmpeg -i above_marathon_250.mp4图像%03d.bmp
但是相同的代码对于 YUV 格式视频。
有没有人知道如何从 YUV 格式的视频中提取帧?

Here is the code for extracting frames from a MP4 video. ffmpeg -i above_marathon_250.mp4 images%03d.bmp But the same code does not work for YUV format video. Does anyone knows how it is possible to extract frame(s) from YUVformat video?

推荐答案

因为yuv文件没有标题,所以ffmpeg不知道文件是什么大小/ pixfmt,所以不起作用。您需要手动指定分辨率和pixmt:

It's not working because yuv files have no header, so ffmpeg doesn't know what size/pixfmt the file is. You need to specify resolution and pixmt manually:

ffmpeg -video_size 1920x1080 -r 25 -pixel_format yuv422p -i file.yuv output-%d。 png

然后调整大小/ pixfmt以匹配您的特定视频。

And then adjust size/pixfmt to match your particular video.

我也建议今后在超级用户上发布这样的问题,这与编程无关。

[edit] I'd also suggest to post such questions on superuser in the future, this has nothing to do with programming.

这篇关于如何使用ffmpeg从YUV视频中提取帧(或perticular帧)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆