Interesting things you can do with FFmpeg
Interesting things you can do with FFmpeg. convolution, debug, audi
![Interesting things you can do with FFmpeg](/content/images/size/w2000/2020/11/Screenshot-from-2020-11-28-12-32-26.png)
Download a sample mp4 file and rename it to input.mp4
:
wget http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4
mv ElephantsDream.mp4 input.mp4
Convolution (kernels)
Apply edge enhance
ffmpeg -i input.mp4 -vf convolution="0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128" -c:a copy -c:v h264_nvenc output.mp4
ffmpeg -i input.mp4 -vf convolution="0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128" -c:a copy -c:v h264 output.mp4
![](https://igor.technology/content/images/2023/02/Screenshot-from-2023-02-14-18-33-37.png)
Apply edge detect
ffmpeg -i input.mp4 -vf convolution="0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128" -c:a copy -c:v h264_nvenc output.mp4
![](https://igor.technology/content/images/2023/02/Screenshot-from-2023-02-14-18-55-22.png)
Apply embos
ffmpeg -i input.mp4 -vf convolution="-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2" -c:a copy -c:v h264_nvenc output.mp4
![](https://igor.technology/content/images/2023/02/Screenshot-from-2023-02-15-10-37-11.png)
Apply blur
ffmpeg -i input.mp4 -vf convolution="1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9" -c:a copy -c:v h264_nvenc output.mp4
![](https://igor.technology/content/images/2023/02/Screenshot-from-2023-02-15-11-05-26.png)
Generate macroblock (debug video)
Debug/MacroblocksAndMotionVectors – FFmpeg
![](https://trac.ffmpeg.org/raw-attachment/wiki/Debug/MacroblocksAndMotionVectors/vismv_pf.png)
ffmpeg -flags2 +export_mvs -i input.mp4 -vf codecview=mv=pf+bf+bb output.mp4
![](https://igor.technology/content/images/2023/02/Screenshot-from-2023-02-14-18-54-26.png)
Extract Audio
ffmpeg -i input.mp4 -b:a 320K -vn output-audio.mp3
Sources: