【问题标题】:How to convert mp4 to YUV file using ffmpeg?如何使用 ffmpeg 将 mp4 转换为 YUV 文件?
【发布时间】:2017-08-31 02:01:27
【问题描述】:

将 yuv 文件从 mp4 格式转换为 YUV 420 格式后,我无法正常播放。我在播放视频时已经对视频的宽度和高度进行了编程。下面的ffmpeg转换命令正确吗?

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

【问题讨论】:

  • 你玩的怎么样?

标签: video ffmpeg


【解决方案1】:

几乎所有视频都解码为 YCbCr 4:2:0,即 IYUV (fourcc),因此

ffmpeg -i sample.mp4 out.yuv

足够了。

要查看它,您可以使用 ffplaydisplay from imagemagick、my own toolvooya

一些例子:

# Using ffmpeg
ffplay -s WxH file.yuv

# Using imagemagick and display to look at first frame
display -size WxH -depth 8 -colorspace sRGB 'file.yuv[1]'

【讨论】:

  • 什么意思?它会转换为原始视频的编码格式。请使用ffprobe sample.mp4 检查。 “通常”它说yuv420p,它是 BT.601 中定义的 YCbCr 4:2:0 又名 IYUV。
  • Option -s is deprecated, use -video_size. [rawvideo demuxer @ 006b6f80] Unable to parse option value "WxH" as image size [rawvideo demuxer @ 006b6f80] Error setting option video_size to value WxH.
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-01-14
  • 2021-02-07
  • 1970-01-01
  • 1970-01-01
  • 2014-11-17
  • 2012-04-14
  • 2015-09-03
相关资源
最近更新 更多