Skip to content

Latest commit

 

History

History
66 lines (40 loc) · 2.59 KB

cheatsheet-ffmpeg.md

File metadata and controls

66 lines (40 loc) · 2.59 KB

Useful ffmpeg commands for common video editing tasks

Cutting video

From time 00:03 to 00:06 without reencoding(fast)

ffmpeg -i infile.mp4 -ss 00:03 -to 00:06 -c copy outfile.mp4

Merging multiple videos in one file

ffmpeg -f concat -i filesToJoin.txt combined.mp4
// filesToJoin.txt content
// file infile1.mp4
// file infile2.mp4

Converting file to another format

mov to mp4

ffmpeg -i infile.mov outfile.mp4

Convert video to GIF

The dirty way ffmpeg -i infile.mp4 -vf "fps=10,scale=320:-2:flags=lanczos" outfile.gif

GIF color issues might be there as gif has only 256 color pallette. To create better gif, first create color pallette and use that to create gif.

Overlay

Overlay a logo

ffmpeg -i video_clip.mp4 -i logo.png -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" video.mp4

Creating video preview

Using ffmpeg-generate-video-preview to create screenshots collage

generate-video-preview infile.mp4 previewCollage.jpg --width 160 --rows 5 --cols 6 --padding 4 --margin 4

References

  1. Learn ffmpeg the hard way
  2. ffmpeg for social media
  3. awesome-ffmpeg
  4. editly : minimal command line video editing
  5. vidgear; video processing with access to multiple libraries e.g. opencv, ffmpeg
  6. auto-motion
  7. scripts by donald feury
  8. some ffmpeg video editing commands
  9. seeking in ffmpeg
  10. concatenate videos in ffmpeg
  11. deinterlacing algo in ffmpeg
  12. preset ffmpeg
  13. .ass subtitles ffmpeg
  14. ffmpeg cheatsheet by steven2358
  15. Adding subtitle to the video