mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-08 21:34:25 +00:00
chore(ffmpeg): add source
This commit is contained in:
2
Makefile
2
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}'
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
# ffmpeg
|
||||
|
||||
## Table of contents <!-- omit in toc -->
|
||||
|
||||
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.<br/>
|
||||
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]
|
||||
|
||||
<!--
|
||||
References
|
||||
@@ -39,3 +47,4 @@ The first command creates a palette out of the webm file. The second command con
|
||||
<!-- Others -->
|
||||
[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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^19.2.2",
|
||||
"@commitlint/cli": "^19.3.0",
|
||||
"@commitlint/config-conventional": "^19.2.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user