Last active
January 31, 2020 14:46
-
-
Save hieuns/19783de9d1b098b24c7457fe01340391 to your computer and use it in GitHub Desktop.
ffmpeg commands collection
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
$ cat files.txt | |
file '/path/to/file1' | |
file '/path/to/file2' | |
file '/path/to/file3' | |
$ ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp4 |
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
ffmpeg -i input.mp4 -ss 00:01:06.65 -to 00:01:08:10 -c:v copy -c:a copy -c:s copy out.mp4 |
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
# Edit file resolution and quality | |
# -crf value from 0 to 51, the higher the value, the lower quantity of output file (recommended value: 23) | |
ffmpeg -i MyMovie.mkv -vf scale=-1:720 -c:v libx264 -crf 0 -preset veryslow -c:a copy MyMovie_720p.mkv | |
# or | |
ffmpeg -i input.mkv -map 0:1 [-map 0:x] -c:v libx264 -crf 23 -preset veryslow -c:a copy -c:s copy output.mkv | |
# or using x265 encoder with main10 profile (crf 28, default value) | |
ffmpeg -i input.mkv -map 0:1 [-map 0:x] -c:v libx265 -preset veryslow -c:a copy -c:s copy -pix_fmt yuv420p10le output.mkv |
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
# Convert soft sub to hard sub | |
# Source: https://superuser.com/questions/1024850/how-can-i-convert-a-mkv-to-mp4-using-ffmpeg-and-hardsub-the-subtitles | |
ffmpeg -i old_video.mkv -vf subtitles=old_video.mkv -acodec copy new_video.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment