ffmpeg -resize and scale
来源:互联网 发布:java函数命名规范 编辑:程序博客网 时间:2024/06/05 15:56
resize 的意思是改变长和宽,scale意思是用scale filter改变帧的大小。
1.Resizing video
宽和高用-s选项进行设置。要在output filename 之前设置。
例如:初始化分辨率为320*240
ffmpeg -i input_file -s 320*240 output_file
2.预定义视频帧的大小
下面的两个cmd有同样的效果
ffmpeg -i input.avi -s 640*480 output.avi
ffmpeg -i input.avi -s vga output.avi
3.奈奎斯特采样定理
在进行模拟/数字信号的转换过程中,当采样频率fs.max大于信号中最高频率fmax的2倍时(fs.max>2fmax),采样之后的数字信号完整地保留了原始信号中的信息,一般实际应用中保证采样频率为信号最高频率的5~10倍;采样定理又称奈奎斯特定理。
例如:
视频分辨率为800*600(SVGA)分辨率,包含2pixels宽。当转为640 * 480(VGA)分辨率的时候,标度比是0.8和2 pixels 被转换成了2pixels。
640 pixels / 800 pixels = 0.8;
2 pixels * 0.8 = 1.6 = 2pixels;
但是当转换为160*120分辨率时,信息丢失:
160 pixels / 800 pixels = 0.2;
2 pixels * 0.2 = 0.4 = 0 pixels;
4.Special enlargeing filter
转换视频为一个较大的帧也是较为特殊的。
例如:转128 * 96 为 256 * 192
ffmpeg -i phone_video.3gp -vf super2xsai output.mp4
5.高级转化
例如:下面的两个有同一个效果:
ffmpeg -i input.mpg -s 320*240 output.mp4
ffmpeg -i input.mpg -vf scale=320:240 output.mp4
6.Scaling video
成比例的转换视频
不知道输入帧的大小,他的分辨率可以通过ih和iw成比例的改变。例如:创建一个一半视频大小。
ffmpeg -i input.mpg -vf scale=iw/2:ih/2 output.mp4
90%大小:
ffmpeg -i input.mpg -vf scale=iw*0.9:ih*0.9 output.mp4
7.转换为预定义的宽度和高度
例如:设置输出宽度为400pixels,高度按比例。
ffmpeg -i input.avi -vf scale=400:400/a;
改变输出高度到300pixes, 宽度按比例
ffmpeg -i input.avi -vf scale=300*a:300;
- ffmpeg-resize and scale
- ffmpeg -resize and scale
- Scale-up and Scale-out
- Scale-up and Scale-out
- Scale up and Scale out
- [转]Scale-up and Scale-out
- size and resize (STL Sample)
- Resize images and save thumbnails
- 使用ffmpeg 对视频做resize
- ffmpeg用filter实现视频scale
- Storage of Scale and Precision
- KB: Rotate and scale bitmaps
- Saliency, Scale and Image Description
- resize
- resize
- keyboard show and hide resize view
- UIView / UIImage 截圖(capture), 縮放(scale), 設定大小(resize), 儲存(save)
- 图片的处理大概就分 截图(capture), 缩放(scale),设定大小(resize), 存储(save)
- 指针的长度
- 解析数据出错:reason: '-[__NSCFArray bytes]: unrecognized selector sent to instance 0x18056b30'
- sequence序列概念及作用
- 计算机中的M(兆)和国际单位制中的M(兆)怎么去理解?
- Windows线程(一)
- ffmpeg -resize and scale
- Children’s Queue
- ipnut (表单)
- WPF控件之ScrollViewer
- css自动换行问题
- AES加密/解密算法 128bit、192bit、256bit秘钥 支持CBC 可直接在MCU上运行
- Server.MapPath()
- hive账单表算连续逾期以及累计逾期
- jquery 根据name属性查找元素