Answer the question
In order to leave comments, you need to log in
ffmpeg avi to mp4 h 264?
There are avi files on the server from 1 to 2 GB in size, I want to convert avi format to mp4 with h 264 support, there are about 200 avi video files on the server, I type the command:
ffmpeg -i file.avi -c:v libx264 -pix_fmt yuv420p -movflags faststart file.mp4
Answer the question
In order to leave comments, you need to log in
The processor is important here, I can suggest playing with the presets.
Here is an option similar to yours
Here's a faster option, but the quality is a little worse
You can add the option -t 00:00:30 to convert only the first 30 seconds for the test
Comrade Nc_Soft gave quite workable commands, and actually your original one too.
UPD: as noted by Nc_Soft , it was fixed about threads (I read 0 as 1, it happens).
I note that -threads 0 should be duplicated before -i and after: the position of the option plays a role: before -i - parameters for entering (how the decoder will be parallelized), after -i - parameters for exiting (how the encoder will be parallelized). The value of the parameter is the number of threads. 0 - the optimal number will be selected (usually by the number of cores, taking into account hyperthreading), specify more than it is - you will start paying a lot for context switching.
With codec parameters it is better to study: ffmpeg.org/ffmpeg-codecs.html#libx264_002c-libx264rgband play around with the settings you want. Quality, like color and taste, is a very subjective parameter.
Another option for speeding up (if the processor is idle and you run into IO): at least write the result to tmpfs, and then put it where you need it. Well, or move completely to the SSD.
Threat wondering who signed me up as an expert?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question