1
0
mirror of https://github.com/vector-im/element-android.git synced 2025-04-19 09:22:16 +03:00
element-android/tools/compressVideo.sh
Benoit Marty d4e3d451ba Apply dual licenses: AGPL + Element Commercial to file headers.
2 replace all actions have been performed:
- "SPDX-License-Identifier: AGPL-3.0-only" to "SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial"
- "Please see LICENSE in the repository root for full details." to "Please see LICENSE files in the repository root for full details."
2025-01-14 10:27:57 +01:00

16 lines
530 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright 2021-2024 New Vector Ltd.
#
# SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
# Please see LICENSE files in the repository root for full details.
set -e
echo "Converting file $1"
file=$(echo $1 | sed 's/\.[^.]*$//')
ffmpeg -i $1 -filter_complex "[0:v] fps=12,scale=480:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" $file-tmp.gif
echo "Converting to Gif"
gifsicle -O3 --lossy=80 -o $file.gif $file-tmp.gif
rm $file-tmp.gif
echo "Done, $file.gif has been generated"