Example of complete command : ffmpeg -hide_banner -i `ls -rth *mkv | tail -1` -ss 1 -t 5 -filter_complex "[0:v] fps=12,crop=1600:1024:0:0,split [a][b];[a] palettegen [p];[b][p] paletteuse" -y ok.gif; gwenview ok.gif
ffmpeg -i video.mp4 -i audio.mp4a -c:v copy -c:copy output.mp4
ffmpeg -framerate 25 -f x11grab -i :1 -re -f lavfi -i anullsrc -f flv rtmp://video.benetou.fr:1935/live/APIKEY
for i in {0..9}; do ffmpeg -ss $(expr $i \* $( expr $(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 fosdem_metaverse.mp4 | sed "s/\..*//") / 10 )) -i fosdem_metaverse.mp4 -vframes 1 -s 480x300 -f image2 imagefile$i.jpg; done && montage -tile 10x1 -geometry 480x300+0+0 imagefile*jpg mosaic.jpg
ffmpeg -framerate 30 -i %d.png -y output.mp4
I=0; for F in $(ls -1 *png); do let I++; cp $F res/$I.png; done; cd res
rm out.jpg; ffmpeg -f v4l2 -video_size 544x288 -i /dev/video1 -frames 1 out.jpg
ffmpeg -i /dev/video0 -i new.svg -filter_complex "[1]hflip[f],[0][f]overlay=format=auto,format=yuv420p[v]" -map "[v]" -f v4l2 /dev/video2 -nostdin -hide_banner -nostats &
sudo modprobe v4l2loopback
to get /dev/video2
ffmpeg -framerate 25 -f x11grab -i :1 output.mp4
(but no audio)
ffmpeg -f v4l2 -i /dev/video0 -re -f lavfi -i anullsrc -f flv rtmp://video.benetou.fr:1935/live/APIKEY
-framerate 24 -i img%03d.png -vf scale=720:-2 -y output.mp4
-re -loop 1 -i video_test_mire.jpg -vcodec libx264 -f flv rtmp://live.twitch.tv/app/`cat ~/.twitch_key`
to stream an image (or video, or playlist) to an RTMP platform, e.g. Twitch
-filter:v "[in] crop=450:500:0:0 [crop]; [crop] lenscorrection=k2=0.1:k1=-0.4"
to chain filters
-vf "[in] scale=iw*.5:ih*.5 [scaled]; [scaled] setpts=0.5*PTS"
as often used for GIF combining the few filters below
-f x11grab -s 2560x1440 -i :1
for screen capturing on specified resolution and screen
xdpyinfo
for information on resolution and screen, cf https://ffmpeg.org/ffmpeg-devices.html#x11grab
pactl list sources
to get e.g. alsa_output.pci-0000_00_1f.3.analog-stereo.monitor rather than default
which combine all sources including microphone, cf https://ffmpeg.org/ffmpeg-devices.html#pulse
-vf drawtext="text='Complimenti':"
-b:v 2600k
to change video bitrate
-hide_banner
to remove configuration build options
-filter:v "setpts=0.5*PTS"
to double speed (halving the presentation timestamp of a frame)
pause
(to bring to the background) then fg
to bring the process back to life and continue encoding
-vf scale=2048:1024
-vf scale=iw*.5:ih*.5
-filter:v "crop=720:420:0:450"
following the format "crop=out_w:out_h:x:y"
-ss 5 -t 25
, especially important to test without wasting time
-to 1:25
to use the ending time
-ss 0:1:59
format (to avoid using bc to calculate starting time)
-an
ffmpeg -i input-video.mkv -vn -acodec copy opus
-y
to confirm e.g. to replace existing file
My notes on Tools gather what I know or want to know. Consequently they are not and will never be complete references. For this, official manuals and online communities provide much better answers.