K
K
karpo5182018-04-15 17:05:09
fmpeg
karpo518, 2018-04-15 17:05:09

How to transcode video to ffmpeg mp4 without quality loss and maximum web compatibility?

There are a large number of videos that contain errors. Unfortunately, simply copying a video with -copy causes an error. Suggest a ffmpeg call string that will allow you to transcode the video while maintaining the original video quality or minimize quality degradation. It is important that the video has maximum compatibility with all devices for viewing from the web. I will add that the videos have different resolutions from 360p to 1080p+
What I googled does not inspire confidence in me:
For example:

ffmpeg -vpre videobam -y -i input.avi -s 320x240 -vcodec libx264 -acodec libfaac -threads 0 -ab 64k -b 400k -bt 500k -g 24 -r 24 temp.mp4

1. The line contains a completely incomprehensible fragment -vpre videobam -y, which I cannot interpret
2. The libfaac codec is used, which is not currently part of ffmpeg, i.e. is obsolete
3. The -b parameter specifies a fixed bitrate, and its value (judging by the permissions mapping tables) may be insufficient in some cases, i.e. worsen the quality.
I'm pretty new to ffmpeg and haven't explored all of the options in the line above at the moment, but I believe some of the other options are compromises aimed at size/quality or speed/quality optimizations.
I would like to receive an exhaustive answer (the line itself + explanations), which will clarify.
The biggest problem I've encountered is using default values ​​for unspecified parameters. It would seem that the program is required to store them as in the source, since they were not given, but it replaces them. As a result, in order to save these parameters, you need to read them, and then set them again. It turns out that you need to write a bash script that will do all this. Surprisingly, the usual coding to eliminate the error turns into a whole quest if quality is to be maintained. And yes, I still have not figured out how to transcode a video without losing quality, without increasing its size, even in an unlimited time.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Shirshov, 2018-04-15
@sindzicat

How about this instruction ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question