简体   繁体   English

ffmpeg和mpeg的麻烦

[英]Ffmpeg and mpeg trouble

I want to keep video quality when converting from one format to another, specifically from avi to mpeg. 从一种格式转换为另一种格式时,尤其是从avi到mpeg,我想保持视频质量。 I have tried with the option offered ffmpeg target and I achieved the same quality of video but the resulting file size is large compared to the original, how I can reduce that size? 我尝试使用提供的ffmpeg 目标选项,获得了相同的视频质量,但是与原始文件相比,文件大小很大, 如何减小该大小?

I've tried this: 我已经试过了:

ffmpeg -i input_file.avi -target ntsc-dvd output_file.mpeg

What codec is used in the original? 原件使用什么编解码器? You may not be able to achieve the same quality/filesize point as the original if the codec used in the AVI is better than the MPEG-2 codec used in NTSC DVDs. 如果AVI中使用的编解码器优于NTSC DVD中使用的MPEG-2编解码器,则可能无法获得与原始文件相同的质量/文件大小。

Also ntsc-dvd specifies a resolution as well. ntsc-dvd也指定了分辨率。 If it is higher than the AVI resolution, this will raise the filesize. 如果它高于AVI分辨率,则将增加文件大小。 If you don't need to hit the DVD resolution exactly, I would just keep the same resolution. 如果您不需要精确地达到DVD分辨率,我将保持相同的分辨率。 You could do something like: 您可以执行以下操作:

ffmpeg -i input_file.avi -vcodec mpeg2video -b 1000k outfile.mpg

The -b argument allows you to set the output video bitrate. -b参数允许您设置输出视频的比特率。 I have found this to be the easiest parameter to adjust on when I want to try to get to the right quality/filesize tradeoff. 我发现这是我想要尝试正确的质量/文件大小权衡时最容易调整的参数。

There are a lot of other advanced options that may help you get the filesize down while keeping the quality, but they usually are on the margins compared to the benefits you can get by reducing resolution or using a better codec like H.264. 还有许多其他高级选项可以帮助您降低文件大小,同时保持质量,但是与降低分辨率或使用更好的编解码器(例如H.264)可以获得的好处相比,它们通常处于边缘。

When you convert video there will always be a data loss. 转换视频时,始终会丢失数据。 Especially when converting to mpeg and other ancient formats. 特别是在转换为mpeg和其他古老格式时。 Maybe F4V or MKV is usable? 也许F4V或MKV可用?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM