Created
March 7, 2022 13:18
-
-
Save fsalehpour/bcaeb077d65546d632638d9af2dc2036 to your computer and use it in GitHub Desktop.
ffmpeg tips
This file contains hidden or 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
# create hardsubs for a video from a SRT file using FFMPEG | |
# https://stackoverflow.com/a/21369850/1887369 | |
ffmpeg -i video.mp4 -vf "subtitles=subs.srt:force_style='Fontname=Times New Roman,Fontsize=24,PrimaryColour=&H0000ff&'" output.mp4 | |
## to take only a section of the video: | |
ffmpeg -ss 00:02:00 -copyts -i video.mkv -ss 00:02:00 -vf "subtitles=subs.srt:force_style='Fontsize=24,Fontname=Times New Roman'" -to 00:02:30 cut.mp4 | |
# convert the pixel format using the format filter | |
# https://stackoverflow.com/a/54196619/1887369 | |
ffmpeg -i in_file -filter:v "format=yuv420p" out_file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment