diff --git a/Makefile b/Makefile index ad1629b..8dd3979 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ override venv ?= ${shell git rev-parse --show-toplevel}/.venv create-venv: override python_version ?= 3.12 create-venv: ${shell which 'python${python_version}'} @python${python_version} -m 'venv' '${venv}' - @${venv}/bin/pip --require-virtualenv install -U -r 'requirements.txt' + @${venv}/bin/pip --require-virtualenv install -r 'requirements.txt' recreate-venv: @rm -r '${venv}' diff --git a/knowledge base/ffmpeg.md b/knowledge base/ffmpeg.md index 7f0e15a..1eaa736 100644 --- a/knowledge base/ffmpeg.md +++ b/knowledge base/ffmpeg.md @@ -1,10 +1,9 @@ # ffmpeg -## Table of contents - 1. [TL;DR](#tldr) 1. [Format conversion](#format-conversion) - 1. [Webm to GIF](#webm-to-gif) + 1. [WebM to GIF](#webm-to-gif) + 1. [WebM to MP4](#webm-to-mp4) 1. [Sources](#sources) ## TL;DR @@ -17,7 +16,7 @@ ffmpeg -y -i 'rec.webm' -i 'palette.png' -filter_complex 'paletteuse' -r 10 'out ## Format conversion -### Webm to GIF +### WebM to GIF ```sh ffmpeg -y -i 'rec.webm' -vf 'palettegen' 'palette.png' @@ -25,12 +24,21 @@ ffmpeg -y -i 'rec.webm' -i 'palette.png' -filter_complex 'paletteuse' -r 10 'out ``` 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. +The first command creates a palette out of the webm file. The second command converts the webm file to gif using the +created palette. + +### WebM to MP4 + +```sh +ffmpeg -i 'input.webm' -c 'copy' 'output.mp4' +ffmpeg -fflags '+genpts' -r '24' -i 'input.webm' 'output.mp4' +``` ## Sources - [Convert a webm file to gif] - [How to convert a webm video to a gif on the command line] +- [WebM to MP4 conversion using ffmpeg] [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 +[webm to mp4 conversion using ffmpeg]: https://stackoverflow.com/questions/18123376/webm-to-mp4-conversion-using-ffmpeg diff --git a/package.json b/package.json index 431f8af..bf29ead 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "devDependencies": { - "@commitlint/cli": "^19.2.2", + "@commitlint/cli": "^19.3.0", "@commitlint/config-conventional": "^19.2.2" } } diff --git a/snippets/convert-between-formats.sh b/snippets/convert-between-formats.sh index b1fbde4..46338a3 100644 --- a/snippets/convert-between-formats.sh +++ b/snippets/convert-between-formats.sh @@ -1,8 +1,12 @@ -#!sh +#!/usr/bin/env sh # svg to png rsvg-convert -ah '96' 'icon.svg' -o 'icon-96.png' +# webm 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' + # webm to mp4 ffmpeg -i 'input.webm' -c 'copy' 'output.mp4' ffmpeg -fflags '+genpts' -r '24' -i 'input.webm' 'output.mp4'