forked from scummvm/scummvm-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
convert_dxa.sh
executable file
·50 lines (42 loc) · 1.31 KB
/
convert_dxa.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#! /bin/bash
# Script for converting SMK video to ScummVM DXA format
#
# Put this batch file into the game directory you want to convert.
# This script will search for all SMK files in all subtree directories,
# and encode them as DXA files next to the original files.
#
# (c) 2006-2022 ScummVM Team
# (c) 2006 crowley
#
echo ScummVM SMK2DXA batch convertor
###################################################################
## Edit audio parameter to mp3/vorbis/flac and additional params ##
###################################################################
AUDIO=--vorbis
AUDIO_PARAMS=
###################################################################
## Default paths for tools and ffmpeg ##
###################################################################
FFMPEG=ffmpeg
SCUMMVM_TOOLS_CLI=scummvm-tools-cli
for i in $(find $1 -name "*.SMK")
do
in=`basename "$i" .SMK`;
folder=`dirname "$i"`;
mv "$i" "$folder/$in.smk";
done
for i in $(find $1 -name "*.smk")
do
in=`basename "$i" .smk`;
folder=`dirname "$i"`;
if [ ! -f "$folder/$in.dxa" ]
then
$FFMPEG -i "$i" -f image2 "$folder/$in.smk%03d.png";
$FFMPEG -i "$i" -acodec pcm_u8 "$folder/$in.wav";
previous=$cwd
cd $folder
$SCUMMVM_TOOLS_CLI --tool encode_dxa $AUDIO $AUDIO_PARAMS "$in.smk";
rm $in*.png "$in.wav";
cd $previous
fi
done