# # nwnbink2ogm v0.3.1 -- http://delirare.com/stuff/nwnbink2ogm.php # # This file is provided "as is", without any express or implied warranty. # WINE=wine IMGTYPE=tga BINKCONV=binkconv.exe MENCODER=mencoder MENCP1=-ovc xvid -xvidencopts pass=1 MENCP2= OENCOPTS=-q 3 # # You shouldn't need to change anything below this line. # (if you need to to make it work, let me know.) # # Support both old and new mencoder multifile format NEW_MF=$(shell if mencoder mf:// 2>&1 | grep -q "Unknown protocol"; then \ echo 0; else echo 1; fi) ifeq ($(NEW_MF),1) MF_ON= MF_FORMAT=mf:// MF_AST=* else MF_ON=on: MF_FORMAT= MF_AST=\* endif # What FPS to use for what files FPS_CASES=\ *Logo) echo 30 ;; \ *Chap?|fge_logo_black|XP1_*) echo 15 ;; \ NWNintro|XP2_Intro) echo 29.97 ;; \ *) echo 14.89 # Targets default: usage game: prelude.ogm prelude_chap1.ogm \ Chap1_Chap2.ogm Chap2_Chap3.ogm Chap3_Chap4.ogm ending.ogm intro: NWNintro.ogm logos: AtariLogo.ogm BiowareLogo.ogm WOTCLogo.ogm credits: credits.ogm all-nwn: intro logos game credits xp1: fge_logo_black.ogm XP1_Chap1_Chap2.ogm XP1_Chap2_Chap3.ogm \ XP1_Closing.ogm XP1_Intro.ogm xp2: XP2_Intro.ogm all: all-nwn xp1 xp2 # # End of config # usage: @echo "Usage: $(MAKE) -f nwnbink2ogm.mk [VAR=value [VAR=.. ..]] target [target ..]" @echo "Version 0.3 - Now with SoU and HoTU support!" @echo @echo "Targets are one or more of:" @echo "game Convert in-game movies from the OC (prelude, chapters, ending)." @echo "intro Convert intro movie." @echo "logos Convert logo movies (Atari, Bioware, WOTC)." @echo "credits Convert credits movie." @echo "all-nwn Convert all of the above (no expansion packs)." @echo "xp1 Convert all movies from the first expansion (SoU)." @echo "xp2 Convert all movies form the second expansion (HoTU)." @echo "all Convert everything!" @echo @echo "Variables used are:" @echo "WINE Wine binary. [wine]" @echo "BINKCONV binkconv.exe binary. [binkconv.exe]" @echo "MENCODER mencoder binary. [mencoder]" @echo "IMGTYPE Temporary image type. Must be supported by both binkconv and mencoder." @echo " tga is nice for speed, png saves space [tga]." @echo "MENCP1 mencoder options, pass 1. [-ovc xvid]" @echo " See mplayer/mencoder manpage for info" @echo "MENCP2 mencoder options, pass 2. (off by default)" @echo " For two-pass encoding. Remember to add pass info to both passes." @echo "OENCOPTS oggenc options (quality, etc). [-q 3]" @echo " See oggenc manpage for info" @echo @echo "Defaults are ok, but you probably need to change BINKCONV to the correct path." @echo "To change these variables permanently, edit the makefile." @echo @echo "NO WARRANTY! You run this at your own risk. Heh heh." %.ogm: %.bik @echo "*** $* ***" $(WINE) -- $(BINKCONV) $< $*.$(IMGTYPE) $(WINE) -- $(BINKCONV) $< $*.wav $(MENCODER) $(MENCP1) -mf \ $(MF_ON)type=$(IMGTYPE):fps=`case $* in $(FPS_CASES);; esac` \ $(MF_FORMAT)$*$(MF_AST).$(IMGTYPE) -o $*.avi if test ! -z "$(MENCP2)"; then \ $(MENCODER) $(MENCP2) -mf \ $(MF_ON)type=$(IMGTYPE):fps=`case $* in $(FPS_CASES);; esac` \ $(MF_FORMAT)$*$(MF_AST).$(IMGTYPE) -o $*.avi; fi rm $**.$(IMGTYPE) oggenc $(OENCOPTS) $*.wav rm $*.wav ogmmerge -o $*.ogm $*.avi $*.ogg rm $*.avi $*.ogg