Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg -r option

Tags:

ffmpeg

I am trying to use ffmpeg (under linux) to add a small title to a video. So, I use:

ffmpeg -i hk.avi -r 30000/1001 -metadata title="SOF" hk_titled.avi

The addition of title seems to work, but, the problem is the output file is about a 1/3rd of the file size of the input file and I was wondering why this is? Is this at the expense of quality of the video? I am unsure.. How do I preserve the same quality/size as the input file?

The main point I am unable to figure out is the use of -r option. Going through the ffmpeg docs, it seems to suggest that -r is frames per second (The input video is 23.9fps). At the moment, (30000/1001) works out to 29 fps, but I was unsure if I should be using this value.

Thanks for your time.

like image 899
AJW Avatar asked Apr 09 '26 02:04

AJW


1 Answers

The default settings for ffmpeg do not always provide a good quality output when you encode, but this depends on your output format and the available encoders. With your output ffmpeg will use the default of -b 200k or -b:v 200k.

However, you can tell ffmpeg to simply copy the input streams without re-encoding and this is recommended if you just want to add or edit metadata. These examples do the same thing but use different syntax depending on your ffmpeg version:

ffmpeg -i hk.avi -vcodec copy -acodec copy -metadata title="SOF" hk_titled.avi
ffmpeg -i hk.avi -c copy -metadata title="SOF" hk_titled.avi
like image 161
llogan Avatar answered Apr 13 '26 04:04

llogan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!