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基操
创建数据表: create table tt1( id int, name varchar(20), age int,sex boolean ); insert into tt1 values(1,& ...
- 清除控制台 console
清除控制台 console.log(1) // console.clear() // CTRL + K // Ctrl + L // process.stdout.write('\033c'); // ...
- 【HNOI 2016】网络
Problem Description 一个简单的网络系统可以被描述成一棵无根树.每个节点为一个服务器.连接服务器与服务器的数据线则看做一条树边.两个服务器进行数据的交互时,数据会经过连接这两个服务器 ...
- 阿里云Hadoop集群DataNode连接不上NameNode
在logs日志中可以看见DataNode多次去连NameNode,但是都失败了. 经过长时间的研究百度,终于知道了原因. 原因就是安全组限制了端口的开放,所以我们只要把相应的端口打开即可.
- 【GO】【LiteIDE】
https://blog.csdn.net/qq_32034593/article/details/82986311 下载地址:https://www.golangtc.com/download/li ...
- Laravel Not Found Exceptions 取数据的一个小技巧
从 model 中取数据的时候, 用下面的方法, 而不是简单的 find(1), 或 first(), 这样如果刚好要查询的数据没有, 就会返回比较友好的 404 页面: $model = App\F ...
- 1047 Integer Inquiry
String 大数加法模板 #include<stdio.h> #include<string> #include<iostream> using namespac ...
- vue_全局注册过滤器
在一个项目中, 某些过滤器全局都有可能用的到, 统一管理并自动化全局注册是很方便的. 代码如下, 后续只需要在src/filters/index.js中添加方法就可以全局使用过滤器了. // src/ ...
- Centos7 防火墙frewalld规则设置
配置firewalld-cmd 查看版本: firewall-cmd --version 查看帮助: firewall-cmd --help 显示状态: firewall-cmd --state 查看 ...
- zoj2930
各点向S连推迟的花费,向T连提前的花费,S表示提前,T表示推迟.a推迟b也推迟b往a连INF.最小割后从各点出发,能直接或间接到T的就是必须推迟的,剩下的就是能提前的. #include < ...