Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFMPEG Command to format videos to TikTok's specs?

Tags:

ffmpeg

tiktok

I'm trying upload a video exported by windows video editor to tiktok. It's a .mp4 file, and while it does upload, it isn't "TikTok'd", meaning, it only takes up the middle of screen. I was wondering what the ffmpeg command would be to output a video to TikToks specs.

Here's how it currently looks.

TikTok bad format

And here's how I want it to look.

enter image description here

like image 441
Christopher Sparks Avatar asked Oct 26 '25 07:10

Christopher Sparks


1 Answers

Use the crop filter to convert horizontal to vertical video:

ffmpeg -i input.mp4 -vf "crop=ih*(9/16):ih" -crf 21 -c:a copy output.mp4
  • This will make it 9:16 aspect ratio.
  • -crf controls quality. See FFmpeg Wiki: H.264. 18-23 should be a good enough for a TikTok video.
  • Audio is stream copied (-c:a copy). If you get an error because your audio isn't compatible with MP4 then remove -c:a copy and AAC will be automatically used instead.
like image 53
llogan Avatar answered Oct 29 '25 03:10

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!