Files
oam/knowledge base/ffmpeg.md
2024-05-04 12:44:14 +02:00

1.4 KiB

ffmpeg

  1. TL;DR
  2. Format conversion
    1. WebM to GIF
    2. WebM to MP4
  3. Sources

TL;DR

# 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

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.

WebM to MP4

ffmpeg -i 'input.webm' -c 'copy' 'output.mp4'
ffmpeg -fflags '+genpts' -r '24' -i 'input.webm' 'output.mp4'

Sources