simple x11 grab using ffplay 'ffplay -f x11grab -follow_mouse centered -framerate 10 -video_size 640x480 -i :0.0'
feeding the output of ffmpeg into ffplay
ffmpeg -f x11grab -follow_mouse centered -framerate 5 -video_size 1920x1060 -i :0.0 -f rawvideo -vcodec rawvideo -pixel_format bgr0 -video_size 1920x1060 - | ffplay -f rawvideo -vcodec rawvideo -pixel_format bgr0 -video_size 1920x1060 -
The more complicated command line also allows us to play with colour space by changing pixel format .
ffmpeg -f x11grab -follow_mouse centered -framerate 5 -video_size 1280x720 -i :0.0 -f rawvideo -vcodec rawvideo -pix_fmt monob -video_size 1280x720 - | ffplay -f rawvideo -vcodec rawvideo -pix_fmt monob -video_size 1280x720 -
in this case from a colour format bgr0 to a black and white dithered format monob
or we could change the output codec from rawvideo to a strange format like tmv ( created by enthusiasts to enable video playback on the original ibm 8088 powered pc)
ffmpeg -f x11grab -follow_mouse centered -framerate 5 -video_size 1280x720 -i :0.0 -f rawvideo -vcodec rawvideo -pix_fmt monob -video_size 1280x720 - | ffplay -f rawvideo -vcodec tmv -pix_fmt monob -video_size 1280x720 -
or we could use ffmpegs displacement function
ffmpeg -f x11grab -follow_mouse centered -framerate 23 -video_size 640x640 -i :0.0 -f x11grab -follow_mouse centered -framerate 23 -video_size 640x640 -i :0.0 -lavfi '[1]split
- [y],[0]
- [y]displace' -f rawvideo -pix_fmt pal8 - | ffplay -f rawvideo -pix_fmt pal8 -vf "rotate=1.23" -s 640x640 -
FINAL WINDOWS
3 vertical one square rotating
normal vertical
ffmpeg -f x11grab -follow_mouse centered -framerate 5 -video_size 640x1060 -i :0.0 -f rawvideo -vcodec rawvideo -pix_fmt bgr0 -video_size 640x1060 - | ffplay -f rawvideo -vcodec rawvideo -pixel_format bgr0 -video_size 640x1060 -
hflip vertical
ffmpeg -f x11grab -follow_mouse centered -framerate 5 -video_size 640x1060 -i :0.0 -f rawvideo -vcodec rawvideo -pix_fmt bgr0 -video_size 640x1060 - | ffplay -f rawvideo -vcodec rawvideo -pixel_format bgr0 -vf hflip -video_size 640x1060 -
vflip vertical
ffmpeg -f x11grab -follow_mouse centered -framerate 5 -video_size 640x1060 -i :0.0 -f rawvideo -vcodec rawvideo -pix_fmt bgr0 -video_size 640x1060 - | ffplay -f rawvideo -vcodec rawvideo -pixel_format bgr0 -vf vflip -video_size 640x1060 -
square monob rotating
ffmpeg -f x11grab -follow_mouse centered -framerate 23 -video_size 640x640 -i :0.0 -f x11grab -follow_mouse centered -framerate 23 -video_size 640x640 -i :0.0 -f rawvideo -pix_fmt monob - | ffplay -f rawvideo -pix_fmt monob -vf "rotate=1.23" -s 640x640 -
finally so using simple tools we can convert the desktop into a complex environment to experiment with feedback and by adding video playback we can also make it even more complex and rich.
And experimenting with ffmpeg filters can take it even further.