Some nifty stuff ffmpeg can do

reddit

# play a video ffplay output.mp4 # play audio only ffplay -nodisp output.mp4 # audio streaming of a youtube video youtube-dl https://www.youtube.com/watch?v=dQw4w9WgXcQ -f bestaudio -o - | ffplay - -nodisp WAYLAND USERS, LOOK AWAY! # record screen and save as video ffmpeg -f x11grab -i :0.0 -f pulse -i 0 output.mp4 # record part of the screen as gif for 5 seconds # with 800x600 resolution, 0 x-offset and 30 the y-offset ffmpeg -f x11grab -framerate 10 -video_size 800x600 -i :0.0+0,30 -t 5 output.gif # take a screenshot and save as png ffmpeg -f x11grab -i :0 -t 1 -f mjpeg output.png 

Note: the last three commands obviously requires X11, and ffplay may require installing ffmpeg-full on some distros (which is only 2 MiB if ffmpeg is already installed, at least on NixOs)

To be honest, I'm still reading ffmpeg's man page and I don't understand these commands much myself, I just shamelessly copied them from various websites. It all started this morning when I wanted to record the screen using peek (gif screen recorder) which didn't work due to some missing GTK dependency, did some Google-fu and now I'm uninstalling peek in addition to mpv, scrot and kazam (which IMO only serve as wrappers for ffmpeg) … I can say that things escalated quickly.

submitted by /u/wqzz
[link] [comments]