减少相同格式的视频大小并减少帧大小 [英] Reducing video size with same format and reducing frame size

查看:29
本文介绍了减少相同格式的视频大小并减少帧大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题可能很基础

有没有办法减少有损压缩(WMV、MPEG)格式的帧大小/速率,以获得更小、更小、格式相同的视频.

Is there a way to reduce the frame size/rate of Lossy compressed (WMV, MPEG) format, to get a smaller video, of lesser size, with same format.

是否有任何开源或专有的 api?

Are there any open source or proprietary apis for this?

推荐答案

ffmpeg 提供了此功能.您需要做的就是运行类似

ffmpeg provides this functionality. All you need to do is run someting like

ffmpeg -i <inputfilename> -s 640x480 -b 512k -vcodec mpeg1video -acodec copy <outputfilename>

对于较新版本的 ffmpeg,您需要将 -b 更改为 -b:v:

For newer versions of ffmpeg you need to change -b to -b:v:

ffmpeg -i <inputfilename> -s 640x480 -b:v 512k -vcodec mpeg1video -acodec copy <outputfilename>

使用 MPEG 1 视频编解码器将输入视频文件转换为大小为 640 x 480 且比特率为 512 KB/秒的视频,并仅复制原始音频流.当然,您可以插入您需要的任何值并调整大小和比特率以实现您正在寻找的质量/大小权衡.文档

to convert the input video file to a video with a size of 640 x 480 and a bitrate of 512 kilobits/sec using the MPEG 1 video codec and just copying the original audio stream. Of course, you can plug in any values you need and play around with the size and bitrate to achieve the quality/size tradeoff you are looking for. There are also a ton of other options described in the documentation

运行 ffmpeg -formatsffmpeg -codecs 以获取所有可用格式和编解码器的列表.如果您不必为最终输出指定特定的编解码器,则可以使用 H.264 等最先进的编解码器以最小的质量损失实现更好的压缩率.

Run ffmpeg -formats or ffmpeg -codecs for a list of all of the available formats and codecs. If you don't have to target a specific codec for the final output, you can achieve better compression ratios with minimal quality loss using a state of the art codec like H.264.

这篇关于减少相同格式的视频大小并减少帧大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆