From 749dc9c46907a837ea4c643224a252a08cb1e985 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Thu, 12 May 2022 22:28:34 +0200 Subject: [PATCH] Added ffmpeg's notes to the knowledge base --- knowledge base/ffmpeg.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 knowledge base/ffmpeg.md diff --git a/knowledge base/ffmpeg.md b/knowledge base/ffmpeg.md new file mode 100644 index 0000000..1dd62af --- /dev/null +++ b/knowledge base/ffmpeg.md @@ -0,0 +1,30 @@ +# ffmpeg + +## TL;DR + +```shell +# Convert a webm file to GIF. +ffmpeg -y -i rec.webm -vf palettegen palette.png \ + && ffmpeg -y -i rec.webm -i palette.png \ + -filter_complex paletteuse -r 10 out.gif +``` + +## Format conversion + +### Webm to GIF + +```shell +ffmpeg -y -i rec.webm -vf palettegen palette.png +ffmpeg -y -i rec.webm -i palette.png -filter_complex paletteuse -r 10 out.gif +``` + +Here `rec.webm` is the recorded video. +The first command creates a palette out of the webm file. The second command converts the webm file to gif using the created palette. + +## Sources + +- [Convert a webm file to gif] +- [How to convert a webm video to a gif on the command line] + +[convert a webm file to gif]: https://mundanecode.com/posts/convert-webm-to-gif +[how to convert a webm video to a gif on the command line]: https://askubuntu.com/questions/506670/how-to-do-i-convert-an-webm-video-to-a-animated-gif-on-the-command-line