Skip to content

Instantly share code, notes, and snippets.

@bitmvr
Last active March 20, 2025 18:04
Show Gist options
  • Save bitmvr/4ca4252f137a0980009699181ba7b68c to your computer and use it in GitHub Desktop.
Save bitmvr/4ca4252f137a0980009699181ba7b68c to your computer and use it in GitHub Desktop.
ffmpeg References

ffmpeg Reference

Add Subtitles to Video (include language)

ffmpeg -i source_file.mkv -i video_subtitles.sub -map 0 -map 1 -metadata:s:s:0 language=eng -c copy target_file.mkv

Convert Container

ffmpeg -i source_file.mp4 -acodec copy -vcodec copy target_file.mkv

Seek to N Time In File and Output Result

ffmpeg -ss 132 -i source_file.mp3 target_file.mp3

Seek to N1 Time (e.g., 00:60:00) and Output After N2 Seconds of Duration (e.g., 2)

ffmpeg -ss "$n1" -i source_file.mp3 -t "$n2" target_file.mp3

Seek to N1 (e.g., 00:60:00) Time and Output At N2 Time (e.g., 01:02:00)

ffmpeg -ss "$n1" -i source_file.mp3 -to "$n2" target_file.mp3

Seek to N1 Time and Output A Screenshot

ffmpeg -i inputvideo.mp4 -ss 00:00:03 -frames:v 1 foobar.jpeg

Convert from FLAC to MP3 and Keep Album Art

ffmpeg  -i source_file.flac  -c:v copy  -q:a 0  target_file.mp3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment