简体   繁体   English

使用 ffmpeg 水平翻转 mp4 视频而不会降低质量,并且不会增加文件大小(太多)

[英]Use ffmpeg to flip mp4 video horizontally without losing quality, and inceasing file size (too much)

As the title says, I want to flip an mp4 video horizontally, without losing quality, and without increasing the file size (if possible).正如标题所说,我想水平翻转 mp4 视频,而不会降低质量,也不会增加文件大小(如果可能的话)。 Apparently due to having to re-encode, the file size will increase no matter what.显然由于必须重新编码,无论如何文件大小都会增加。

My current command is something like:我目前的命令是这样的:

ffmpeg -i input.mp4 -vf hflip -qscale 0 -c:a copy output.mp4

Technically, not possible.从技术上讲,不可能。 Filtering requires encoding.过滤需要编码。 When using lossy encoders you lose quality and have generation loss .使用有损编码器时,您会损失质量并产生代数损失 Best you can do is provide a quality level or bitrate that provides an acceptable tradeoff between quality loss and file size.您能做的最好的事情是提供一个质量级别或比特率,在质量损失和文件大小之间提供可接受的权衡。 Assuming you are encoding with libx264 see FFmpeg Wiki: H.264 for detailed instructions.假设您使用 libx264 进行编码,请参阅FFmpeg Wiki:H.264了解详细说明。

One method to keep quality and file size is flipping during playback, but I doubt that is an acceptable solution:保持质量和文件大小的一种方法是在播放期间翻转,但我怀疑这是一个可接受的解决方案:

ffplay -vf hflip input.mp4

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

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