将H264视频转换为原始的YUV格式 [英] convert H264 video to raw YUV format

查看:1235
本文介绍了将H264视频转换为原始的YUV格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用ffmpeg从H264编码视频创建原始的YUV视频?我想用matlab打开视频,并逐帧访问Luma,Cb和Cr组件。

Is it possible to create a raw YUV video from H264 encoded video using ffmpeg? I want to open the video with matlab and access Luma, Cb and Cr components frame by frame.

推荐答案

是的,你可以,你只需要具体的像素格式。获取整个格式的列表:

Yes you can, you just have to specific the pixel format. to get the whole list of the format:

ffmpeg -pix_fmts

例如,如果要将mp4文件的第一个视频轨道保存为yuv420p(p表示平面)文件:

For example if you want to save the 1st video track of an mp4 file as a yuv420p (p means planar) file:

ffmpeg -i video.mp4 -c:v rawvideo -pix_fmt yuv420p out.yuv

这篇关于将H264视频转换为原始的YUV格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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