Log in

View Full Version : avi to mp4 conversion, mp4 to mp4 aspect-ratio fix command line?


UFOxyz
22nd December 2024, 09:49
how well or optimally convert with this command?
ffmpeg.exe -i aa.avi bb.mp4

super user stack exchange went like this for the aspect-ratio correction command line
a top guy said
>ffmpeg -i aa.mp4 -vf scale=720:540 -c:v <Video_Codec> aaaa.mp4

> the other guys said.. on the other hand
ffmpeg -i aa.mp4 -aspect 720:540 -c copy aaaa.mp4

>then the next guys said "nonsense you cant use -c copy".... use this -aspect
> then next guys said " nonsense you cant use -aspect here, use this -bsf:v

no one knew how, none of them worked
so i went
ffmpeg -i aa.mp4 -vf scale=720:540 aaaa.mp4
worked but an 124mega byte video turned into a 30mb video
what do i need to fill in -c:v <Video_Codec> to convert with the maybe same codec that the original used. then how good is the conversion with ffmpeg -i aa.mp4 -vf scale=720:540 aaaa.mp4 in this command line?

Jamaika
22nd December 2024, 09:55
what do i need to fill in -c:v <Video_Codec> to convert with the maybe same codec that the original used. but avi to mp4 is already a different codec, then how good is the conversion with ffmpeg -i aa.mp4 -vf scale=720:540 aaaa.mp4 in this command line?
The vfw avi codec isn't the same as the mp4 codec. Lossy reconversion is recommended, e.g. x264.
Unfortunately there is no x266 codec which should be used to convert today. I don't recommend vvenc.

tebasuna51
22nd December 2024, 10:37
- Use MediaInfo to know the audio/video codecs and resolution/aspect of original avi file. (put the log here)

- Visit https://en.wikipedia.org/wiki/Comparison_of_video_container_formats to know if video/audio codecs from avi are supported in mp4 container.

If the codecs aren't supported you must recode to recommended h264/aac.
If you need recode the video is better change the resolution with -vf scale=W:H
If you can copy the video because is supported in mp4 is enough use -aspect W:H

Of course W:H can be different for each avi, to know them read the MediaInfo.

EDIT: if original resolution is greater than 720:540 it is normal obtain less size, also if original video codec (MPEG2 from DVD's for instance) is less efficient than default codec h264.