Last active
May 15, 2021 18:24
-
-
Save greg-randall/a75d5a0824f609430924c737f6c6244e to your computer and use it in GitHub Desktop.
Hardcode Subs with FFMPEG - SRT & WebVTT both seem to work.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i input-without-subs.mp4 -c:v libx264 -vb 20M -c:a copy -vf subtitles=subs.srt output-with-subs.mp4 | |
To change the font size use this one: | |
ffmpeg -i input.mp4 -c:a copy -c:v libx264 -vb 20M -vf "subtitles=try_1.en_us.srt:force_style='Fontsize=24'" output-with-subs.mp4 | |
To do a two pass encode while hardcoding subs: | |
ffmpeg -y -i input.mp4 -vf subtitles=subs.srt -c:v libx264 -b:v 5000k -pass 1 -an -f mp4 /dev/null | |
ffmpeg -y -i input.mp4 -vf subtitles=subs.srt -c:v libx264 -b:v 5000k -pass 2 -c:a copy output.mp4 |
I don't know laravel well but in PHP you could use exec. You'd need ffmpeg installed on the server. https://www.php.net/manual/en/function.exec.php
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can this be used on laravel?