Last active
April 17, 2022 14:50
-
-
Save Londeren/ecbfa38c16848c7e09de7c3b146b4d5f to your computer and use it in GitHub Desktop.
ffmpeg useful commands
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
for filename in *.mp4; do ffmpeg -ss 12 -i "$filename" -c copy out-"$filename";done; # trim first 12 seconds | |
for filename in *.mp4; do printf "file '%s'\n" "$filename" >> ffmpeg_concat.txt;done;ffmpeg -f concat -i ffmpeg_concat.txt -c copy output-result.mp4; rm ffmpeg_concat.txt # concat ffmpeg | |
for filename in *.mp4; do ffmpeg -i "$filename" 2>&1 | grep Duration | awk '{print $2}' | tr -d , >> ffmpeg_concat.txt;done; # video duration time | |
ffmpeg -i video.mp4 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - > out.gif # video to gif | |
ffmpeg -i input.mp4 -c:v libx264 -crf 23 -preset medium -c:a copy video-out.mp4 #optimize reduce size | |
ffmpeg -i video.mp4 -q:a 0 -map a audio.mp3 #audio from video |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment