Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
24
rated 0 times [  24] [ 0]  / answers: 1 / hits: 149291  / 3 Years ago, wed, august 18, 2021, 2:24:15

I would like to use ffmpeg to transform an mp4 video file into avi but with the same quality, even if it takes up more space. If I simply do:



ffmpeg -i file.mp4 file.mp4.avi


The resulting avi file is very low-quality and pixelated. How can I do this transformation while keeping the video and audio quality?


More From » ffmpeg

 Answers
7

You always lose a little quality whenever you transcode from one codec to another, video or audio, but perhaps you can avoid it if you only want to change from MP4 container type to an AVI container. codec:copy may be helpful if you don't have a reason to transcode (and it should be faster).



If you must transcode because you need to use a particular video codec
I hope you can use zetah's suggestion above in his comment and use the -sameq switch. Alternatively, you may want to use the qscale option to set the quality manually. The lower the number the better the quality, but the more space your file will take.



The last time I transcoded video I used qscale=8.0, but I'd suggest that you experiment to find the optimum to match the quality of your input.



Marty Jay helpfully mentions that sameq means same quantizer as in the input, which may not result in the same quality. The article he quotes mentions using multi-pass conversion, which is a good way to achieve better compression without sacrificing quality.


[#41803] Thursday, August 19, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
iedncommon

Total Points: 200
Total Questions: 95
Total Answers: 132

Location: Tonga
Member since Mon, Aug 2, 2021
3 Years ago
iedncommon questions
Sat, Jun 4, 22, 18:20, 2 Years ago
Mon, Apr 4, 22, 08:10, 2 Years ago
Tue, Jul 6, 21, 15:11, 3 Years ago
;