[Scummvm-cvs-logs] scummvm-tools master -> a0a7cb6f0cbb1d750341d86e7f69fd3d914bd918

Littleboy littleboy22 at gmail.com
Tue Jun 28 11:53:27 CEST 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .

Summary:
70b85662e3 TOOLS: Handle video frames starting at 1 in EncodeDXA::execute()
a0a7cb6f0c TOOLS: Update convert_dxa.sh


Commit: 70b85662e3fbd1965c2d6d51010266f1ef28e7f6
    https://github.com/scummvm/scummvm-tools/commit/70b85662e3fbd1965c2d6d51010266f1ef28e7f6
Author: Littleboy (littleboy at users.sourceforge.net)
Date: 2011-06-28T02:45:48-07:00

Commit Message:
TOOLS: Handle video frames starting at 1 in EncodeDXA::execute()

binkconv frame numbering starts at 0, whereas ffmpeg starts at 1.

Changed paths:
    encode_dxa.cpp



diff --git a/encode_dxa.cpp b/encode_dxa.cpp
index af562c7..79ec5bd 100644
--- a/encode_dxa.cpp
+++ b/encode_dxa.cpp
@@ -28,6 +28,7 @@
 
 #include "encode_dxa.h"
 #include "common/endian.h"
+#include "common/str.h"
 
 const uint32 typeDEXA = 0x41584544;
 const uint32 typeFRAM = 0x4d415246;
@@ -584,12 +585,16 @@ void EncodeDXA::execute() {
 
 	uint8 *image = NULL;
 	uint8 *palette = NULL;
-	int framenum = 0;
-
-	print("Encoding video...");
 
 	char fullname[1024];
 	strcpy(fullname, inpath.getFullPath().c_str());
+
+	// Check starting frame (binkconv starts at 0, ffmpeg starts at 1)
+	int framenum = 0;
+	if (!Common::Filename(Common::String::printf("%s%04d.png", fullname, framenum).c_str()).exists())
+		framenum++;
+
+	print("Encoding video...");
 	for (int f = 0; f < frames; f++) {
 		char strbuf[1024];
 		if (frames > 999)


Commit: a0a7cb6f0cbb1d750341d86e7f69fd3d914bd918
    https://github.com/scummvm/scummvm-tools/commit/a0a7cb6f0cbb1d750341d86e7f69fd3d914bd918
Author: Littleboy (littleboy at users.sourceforge.net)
Date: 2011-06-28T02:49:40-07:00

Commit Message:
TOOLS: Update convert_dxa.sh

 - Use ffmpeg instead of wine+bink
 - Handle subfolders when converting smk files
 - Use new scummvm-tools-cli

Changed paths:
    convert_dxa.sh



diff --git a/convert_dxa.sh b/convert_dxa.sh
index 3f7e09d..edf5cce 100755
--- a/convert_dxa.sh
+++ b/convert_dxa.sh
@@ -1,37 +1,50 @@
 #! /bin/bash
-# Script for converting Feeble Files video to ScummVM format
+# Script for converting SMK video to ScummVM DXA format
 #
-# modify the paths below
+# 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 ScummVM Team
+# (c) 2006-2011 ScummVM Team
 # (c) 2006 crowley
 #
-# $URL$
-#
-# $Id$
 
-WINE=wine
-VIDEO_PATH=~/games/Feeble/video
-BINK=~/.wine/drive_c/Program\ Files/RADVideo/binkconv.exe
-ENCODE_DXA=~/scummvm/tools/encode_dxa
-FORMAT=vorbis
+echo ScummVM SMK2DXA batch convertor
+
+###################################################################
+## Edit audio parameter to mp3/vorbis/flac and additional params ##
+###################################################################
+
+AUDIO=--vorbis
+AUDIO_PARAMS=
 
-cd "$VIDEO_PATH"
+###################################################################
+## Default paths for tools and ffmpeg                            ##
+###################################################################
 
-for i in *.SMK
+FFMPEG=ffmpeg
+SCUMMVM_TOOLS_CLI=scummvm-tools-cli
+
+for i in $(find $1 -name "*.SMK")
 do
-    in=`basename "$i" .SMK`;
-    mv "$i" "$in.smk";
+	in=`basename "$i" .SMK`;
+	folder=`dirname "$i"`;
+	mv "$i" "$folder/$in.smk";
 done
 
-for i in *.smk
+for i in $(find $1 -name "*.smk")
 do
-    in=`basename "$i" .smk`;
-    if [ ! -f "$in.dxa" ]
-    then
-	$WINE "$BINK" "$i" "$in.png" /n-1 /z1 /#;
-	$WINE "$BINK" "$i" "$in.wav" /v /#;
-	$ENCODE_DXA --$FORMAT "$in.smk";
-	rm *.png *.wav;
-    fi
+	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
+






More information about the Scummvm-git-logs mailing list