File indexing completed on 2024-04-21 03:40:24

0001 #!/bin/bash
0002 
0003  # ============================================================
0004  #
0005  # This file is a part of digiKam project
0006  # http://www.digikam.org
0007  #
0008  # Date        : 2022-12-26
0009  # Description : convert WEBM screencast to animated WEBP using ffmpeg
0010  #               First argument is the WEBM file to convert.
0011  #
0012  # SPDX-FileCopyrightText: 2021-2022 by Gilles Caulier <caulier dot gilles at googlemail dot com>
0013  #
0014  # SPDX-License-Identifier: BSD-3-Clause
0015  #
0016  # ============================================================ */
0017 
0018 # Create a palette from webm file for the gif encoding
0019 ffmpeg -y -i $1 -vf palettegen palette.png
0020 
0021 # Convert WEBM to GIF using palette.
0022 ffmpeg -y -i $1  -i palette.png  -filter_complex paletteuse -loop 0 -r 10 $(basename "$1" | cut -d. -f1).webp
0023 
0024 rm -f palette.png