yuv2mp4
>您使用什么类型的YUV像素格式?最常见的格式是YUV4:2:0平面8位(YUV420p)。您可以键入ffmpeg -pix_fmts以获取所有可用格式的列表。
>什么是帧率?在我的例子中,我将使用-r 25 fps。
>你想使用什么编码器? libx264(H.264)编码器是一种伟大的无损压缩。
>你的相框是什么?在我的例子中,我将使用-s 1920×1080
然后我们得到这个命令来做你的压缩。
ffmpeg -f rawvideo -vcodec rawvideo -s 1920×1080 -r 25 -pix_fmt yuv420p -i inputfile.yuv -c:v libx264 -preset ultrafast -qp 0 output.mp4
在转化netflix_4k的视频时命令:ffmpeg -f rawvideo -vcodec rawvideo -s 704*576 -pix_fmt yuv420p -i /home/nkh/Temp/nkh/data_beihang/city_4cif.yuv -c:v libx264 -preset ultrafast -qp 0 /home/nkh/Temp2018/nkh/data_0/city_4cif.mp4
不行,故采用以下:
将 y4m 格式的图像序列转换为 4:2:0 的 YUV 图像序列:
ffmpeg -f yuv4mpegpipe -i test.y4m -pix_fmt yuv420p test.yuv
对所有其他参数的一点解释:
>使用-f rawvideo将输入格式设置为原始视频容器
>使用-vcodec rawvideo将输入文件设置为未压缩
>使用-i inputfile.yuv设置输入文件
>使用-c:v libx264,您设置编码器将视频编码为libx264。
> -preset ultrafast设置只是加速压缩,所以你的文件大小会比设置为veryslow更大。
>使用-qp 0可以设置最大质量。 0是最好的,51是我们的例子中最差的质量。
>然后output.mp4是你的新容器来存储你的数据。
在Adobe Premiere中完成后,您可以通过反转所有参数将其转换回YUV文件。 FFmpeg识别mp4容器中的内容,因此您不需要为输入提供参数。
ffmpeg -i input.mp4 -f rawvideo -vcodec rawvideo -pix_fmt yuv420p -s 1920×1080 -r 25 rawvideo.yuv
修改分辨率:
%20with%20ffmpeg/input.jpg)
If you need to simply resize your video to a specific size (e.g 320x240), you can use the scale filter in its most basic form:
ffmpeg -i input.avi -vf scale=320:240 output.avi
Same works for images too:
ffmpeg -i input.jpg -vf scale=320:240 output_320x240.png
The resulting image will look like this:
%20with%20ffmpeg/output_320x240.png)
As you can see, the aspect ratio is not the same as in the original image, so the image appears stretched. If we'd like to keep the aspect ratio, we need to specify only one component, either width or height, and set the other component to -1. For example, this command line:
ffmpeg -i input.jpg -vf scale=320:-1 output_320.png
will set the width of the output image to 320 pixels and will calculate the height of the output image according to the aspect ratio of the input image. The resulting image will have a dimension of 320x207 pixels.
7.YUV序列播放
ffplay -f rawvideo -video_size 1920x1080 input.yuv
yuv2mp4的更多相关文章
随机推荐
- mysql配置外部允许外部连接
1. 登录到mysql mysql -u root -p 2.进入到mysql 库中 use mysql 3.执行语句 update user set host=‘%’ where user=‘roo ...
- 0 vs null
看图说话 0 如图所示: 0 表示有纸(值), 但是纸(值)是0. 所以取纸(值)的时可以取, 但是没法用. null 如图所示: null 表示没有纸(值), 是真的啥都没有, 现在你抽纸的时候会出 ...
- npm 是node.js下带的一个包管理工具
npm 是node.js下带的一个包管理工具 npm install -g webpack webpack是一个打包工具 gulp是一个基于流的构建工具,相对其他构件工具来说,更简洁 ...
- 安装linux14.04
一.制作Ubuntu启动盘 1.将空的优盘格式化当做启动盘,下载UltralSO并安装,安装成功后打开,点击工具栏中的第二个打开镜像文件工具(或通过文件-打开的方式打开),选择下载好的Ubuntu镜像 ...
- Linux常用命令——网络命令
Linux常用命令——网络命令 Linux ifconfig 描述:查看设置网络IP 安装命令:yum -y install net-tools 语法:ifconfig 示例:ifconfig et ...
- Cannot resolve classpath entry: /Program Files/IBM/SQLLIB/java/db2java.zip
在mybatis的逆向工程中,使用java代码和xml配置文件生成时出现以下的错误 原来自己在复制官方配置文件的参考时将这一句也复制了进来 删掉后运行即可!成功的话控制台是没有输出的
- java枚举通俗实例解析
1 枚举 1.1 枚举的作用 我们经常要定义一些常量值,例如日期(MONDAY,TUESDAY……)或者错误码等.可以将常量组织起来,统一进行管理.常量比较只是值 ...
- Data Block Compression
The database can use table compression to eliminate duplicate values in a data block. This section d ...
- android -------- Hawk数据库
Hawk 是一个非常便捷的数据库 . 操作数据库只需一行代码 , 能存任何数据类型 . github 地址: https://github.com/orhanobut/hawk 一.概念 Share ...
- 使用cookie保存用户名和密码
效果图如下 从数据库中随意使用一个账号登录 登陆成功来到人中心 返回登录界面 实现代码如下 package com.test.controller; import java.io.IOExceptio ...