YUV数据查阅方法

1、window 下载7yuv工具 查阅
2、ubuntu 使用ffplay

首先,先安装ffmpeg,它会默认附带ffplay。当然,也可以自己下载ffmpeg源码,编译安装。

sudo apt-get install ffmpeg

安装成功,就有ffplay了,命令如下:

ffplay -i raw_yuv420p_1.yuv -pixel_format yuv420p -s 1280x720
以上命令不行,就试一下以下命令,ffplay版本差异导致指令格式有所变化。

ffplay -f rawvideo -video_size 1280x720 p_1_1.1280x720.nv12 -pixel_format nv12
ffplay -f rawvideo -video_size 1280x720 p_1_1.1280x960.yuyv -pixel_format yuyv422

关键的参数,是pixel_format,代表YUV的格式。
这年头,最常用的就是yuv420p和nv12,因为它两和android最基本的两个颜色参数是一样的。

yuv420p
大小:width * height * 3 / 2
排列方式:YYYYYYYY UU VV。
即存储里,先把Y写满了,再把U写满了,再把V写满。对应Android的颜色:
MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar

nv12
大小:width * height * 3 / 2
排列方式:YYYYYYYY UVUV
即Y先写满,UV交错,U先开始。对应Android颜色:
MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar

从我目前的经历看,如果Android上用MediaCodec来编码YUV数据,那么几乎所有的机型,都能保证支持COLOR_FormatYUV420SemiPlanar。

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
UVTools are a set of software utilities to play, convert and analyze YUV or RGB video data in their raw formats. The main features of YUVTools are: It accepts (plays, converts, edits and analyzes) the combination of following formats: YUV in 4:4:4, 4:2:2 or 4:2:0 sample format, RGB in 4:4:4 sampling format; in different component order, like YUV, YVU, UYV, RGB, BGR, etc. in progressive (one single frame) or interlaced (two fields) format; in planar (YYY...UUU...VVV...) or packed (YUV, YUV....) pixel format; in predefined or arbitrary resolutions; Support FOURCC ( refer to: http://www.fourcc.org/). An image preview function to help guess the video format interactively. YUV Player can open multiple player dialogs and play different files in each dialog separately, or play multiple video files in one player dialog one by one sequentially. The detailed format of any opened or generated files will be logged, and the user can directly select any file to play back from the history list. YUV Converter can convert any combination of the format to another format, or convert to (or from) a sequence of BMP files. Other conversion functions include: scaling, join, crop, flip, padding, merge and separation of color components. YUV Analyzer can be used to calculate PSNR between two YUV files, or compare pixel by pixel to check the difference between the corresponding frames of two files, or overlay block type or motion vectors on top of each frame. Another useful feature is to help check the motion between two adjacent frames. YUV Editor can be used to edit the images pixel by pixel, or overlay one YUV image on top of another YUV image file. Convert YUV file to AVI format or vice versa; Setting options include grid display, different YUV to RGB conversion formula, etc. Many of above functions can also be performed in command line mode, which are useful for batch process or scripting.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值