The original video is:

Width                                    : 720 pixels
Height                                   : 400 pixels
Display aspect ratio                     : 4:3
Original display aspect ratio            : 16:9

and i want to adjust it so it can be merged with other file:

Width                                    : 720 pixels
Height                                   : 544 pixels
Display aspect ratio                     : 4:3

merged video had wrong aspect (the part of the file made from 400px piece seemed too wide and not so height)

I am aware that merging is not only about above parameters, but i will need to use same codecs and same audio sampling rate:

ffmpeg -i "input.mp4" -vcodec copy -ar 48000 "output.48kHz.mp4"

but regarding video dimensions and aspect, i think that on Linux i can use command:

ffmpeg -i "input.mp4" -vf "scale=720:544,setdar=4:3,setsar=1" "output.scaled.mp4"

output scaled video seemed OK but other video:

Width                                    : 704 pixels
Height                                   : 400 pixels
Display aspect ratio                     : 16:10
Original display aspect ratio            : 16:9

had wrong aspect after scaling using above mentioned ffmpeg command. But back to the first video i tried to scale, result had too low bit rate/low quality:

input : mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 720x400 [SAR 1:1 DAR 9:5], 1114 kb/s, SAR 20:27 DAR 4:3
output: mpeg4 (FMP4 / 0x34504D46), yuv420p(tv, progressive), 720x544 [SAR 1:1 DAR 45:34], q=2-31, 200 kb/s
  1. Is there any universal ffmpeg parameter to set quality similar to source without need to check actual source bitrate? Maybe "-crf 18" and "qscale=8.0" may work only for some codecs/video extensions and i want resulting file size be also similar to source (not double or such)?

  2. As mentioned, above scaling command does not work in all cases to maintain correct video proportions/aspect. So how to please adjust it so it does maintain it even after defining exact width:height - since i am guessing it have to match with other files if i want to merge these files later - related answer: https://superuser.com/a/1133090 & https://superuser.com/a/1658756 (scale to match other file of choice) ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.