Skip to content

Instantly share code, notes, and snippets.

@andreykin
Last active June 5, 2019 09:28
Show Gist options
  • Save andreykin/b1dcfe5193ecbe2a533df4df45d084a0 to your computer and use it in GitHub Desktop.
Save andreykin/b1dcfe5193ecbe2a533df4df45d084a0 to your computer and use it in GitHub Desktop.
ffmpeg
# convert video to telegram autoplay (not as file)
ffmpeg -i input.mp4 -c:v libx264 -crf 26 -vf scale=640:-1 out.mp4
# convert vertical video to horizontal video with blur on both sides
ffmpeg \
-i Sequence02.mpeg \
-i Sequence02.mpeg \
-filter_complex \
"[0:v]scale=-1:720[scaled_video]; \
[1:v]scale=1280:720,boxblur=16[blur_image];\
[blur_image][scaled_video]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2[outv]" \
-aspect 1280/720 -map [outv] -map 0:a -c:a copy result.mp4
# POWERSHELL batch convert multiple files to mp4. filtered by date
forfiles /P E:\DCIM\100CANON /S /D +03.11.2018 /M "*.mov" /C "cmd /c ffmpeg -i @FILE D:\мое\фотки\2018\Эстония\\@FNAME.mp4 -hide_banner"
# concat files
ffmpeg -f concat -safe 0 -i mylist.txt -c copy output
# mylist.txt (word 'file' is required)
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'
# static image with audio
# https://superuser.com/questions/1041816/combine-one-image-one-audio-file-to-make-one-video-using-ffmpeg
ffmpeg -loop 1 -i image.jpg -i audio.wav -c:v libx264 -tune stillimage -c:a aac -b:a 192k -shortest out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment