我正在使用 ffmpeg 库来转换和压缩视频。但没有以最小尺寸获得最佳结果,但对结果不满意。
使用提供的选项使用 ffmpeg 库压缩视频的最佳方法是什么?
任何人都可以给我最好的选择吗?
最佳答案
视频转换和压缩主要取决于五个因素,即fps/video bitrate/audio sample rate/profile/Constant Rate Factor。尝试操纵这三个因素,在一种规范下,您一定会得到最好的结果。
ffpmpeg -i <input_file> -y -strict experimental -acodec copy -ab *<audio bitrate>* -ac 2 -ar 48000 -vcodec copy -vprofile *<profile you want i.e. either baseline or main>* -level 30 -g 48 -b *<video_bitrate>* -crf *<within 18-24>* -r *<frame_rate/fps>* <output_file>
关于php - 用于转换和压缩视频的 ffmpeg 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35029316/