Difference between revisions of "Anri-chan/Source/statid.bat"

From SDA Knowledge Base

Jump to: navigation, search
(New page: <code><nowiki>@echo off echo This batch will create a preview version of your Station ID called statid_preview.avi on your desktop. echo cd "%HOMEPATH%\Desktop" set statid1= set statid2...)
 
m (Problem with parentheses in path.)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<code><nowiki>@echo off
+
<pre><nowiki>
 +
@echo off
  
 
echo This batch will create a preview version of your Station ID called statid_preview.avi on your desktop.
 
echo This batch will create a preview version of your Station ID called statid_preview.avi on your desktop.
echo
+
echo.
  
cd "%HOMEPATH%\Desktop"
+
SET anri_dir=%~dp0
 +
XCOPY /Y /Q "%anri_dir%anridesktoploc.bat" "%appdata%" > NUL
 +
REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /V "Desktop" | "%anri_dir%sed" -n s/.\+REG_SZ.\+\\\(.\+\)[^\\]*/\1/gp >> "%appdata%\anridesktoploc.bat"
 +
CALL "%appdata%\anridesktoploc.bat" > NUL 2>&1
 +
SET DESKTOP=%HOMEDRIVE%%HOMEPATH%\%DESKTOP%
 +
DEL "%appdata%\anridesktoploc.bat"
 +
CD "%DESKTOP%"
  
 
set statid1=
 
set statid1=
Line 12: Line 19:
 
set /P statid2=Station ID Line 2 (normally game name, run type and time):  
 
set /P statid2=Station ID Line 2 (normally game name, run type and time):  
 
set /P statid3=Station ID Line 3 (normally game name, run type and time continued if necessary):  
 
set /P statid3=Station ID Line 3 (normally game name, run type and time continued if necessary):  
 +
IF NOT DEFINED statid1 (SET statid1= )
 +
IF NOT DEFINED statid2 (SET statid2= )
 +
IF NOT DEFINED statid3 (SET statid3= )
 +
REM Replace quotes from user
 +
(SET statid1=%statid1:"="+chr(34)+"%)
 +
(SET statid2=%statid2:"="+chr(34)+"%)
 +
(SET statid3=%statid3:"="+chr(34)+"%)
  
 +
COPY /Y "%anri_dir%ntsc_d1.png" > NUL
 
echo global pal=false > statid_preview.avs
 
echo global pal=false > statid_preview.avs
echo import("%PROGRAMFILES%\anrichan\nate.avs") >> statid_preview.avs
+
echo import("%anri_dir%nate.avs") >> statid_preview.avs
echo run=blankclip(fps=29.97).audiodub(wavsource("%PROGRAMFILES%\anrichan\silence_stereo_48000.wav")) >> statid_preview.avs
+
echo run=blankclip(fps=29.97).audiodub(wavsource("%anri_dir%silence_stereo_48000.wav")) >> statid_preview.avs
echo nate_statid_d1(run,"%statid1%","%statid2%","%statid3%").Lanczos4Resize(640,480).converttoyv12 >> "statid_preview.avs"
+
echo nate_statid_d1(run,"%statid1%","%statid2%","%statid3%").Lanczos4Resize(640,480).converttoyv12 >> statid_preview.avs
  
"%PROGRAMFILES%\anrichan\xvid_encraw.exe" -i "statid_preview.avs" -bitrate 512 -pass1 "statid_preview.stats"
+
"%anri_dir%xvid_encraw.exe" -i "statid_preview.avs" -bitrate 512 -pass1 "statid_preview.stats"
"%PROGRAMFILES%\anrichan\xvid_encraw.exe" -i "statid_preview.avs" -bitrate 512 -pass2 "statid_preview.stats" -avi "statid_preview.avi"
+
"%anri_dir%xvid_encraw.exe" -i "statid_preview.avs" -bitrate 512 -pass2 "statid_preview.stats" -avi "statid_preview.avi"
del statid_preview.stats
+
del statid_preview.stats statid_preview.avs ntsc_d1.png
del statid_preview.avs
+
  
 
set statid1=
 
set statid1=
Line 27: Line 41:
 
set statid3=
 
set statid3=
  
@echo on</nowiki></code>
+
ECHO.
 +
ECHO  Finished! You will find statid_preview.avi on your Desktop. You can view this video in any player that supports DivX/Xvid.
 +
ECHO.
 +
PAUSE
 +
@echo on
 +
</nowiki></pre>

Latest revision as of 15:57, 30 March 2008

@echo off

echo This batch will create a preview version of your Station ID called statid_preview.avi on your desktop.
echo.

SET anri_dir=%~dp0
XCOPY /Y /Q "%anri_dir%anridesktoploc.bat" "%appdata%" > NUL
REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /V "Desktop" | "%anri_dir%sed" -n s/.\+REG_SZ.\+\\\(.\+\)[^\\]*/\1/gp >> "%appdata%\anridesktoploc.bat"
CALL "%appdata%\anridesktoploc.bat" > NUL 2>&1
SET DESKTOP=%HOMEDRIVE%%HOMEPATH%\%DESKTOP%
DEL "%appdata%\anridesktoploc.bat"
CD "%DESKTOP%"

set statid1=
set statid2=
set statid3=
set /P statid1=Station ID Line 1 (normally runner name): 
set /P statid2=Station ID Line 2 (normally game name, run type and time): 
set /P statid3=Station ID Line 3 (normally game name, run type and time continued if necessary): 
IF NOT DEFINED statid1 (SET statid1= )
IF NOT DEFINED statid2 (SET statid2= )
IF NOT DEFINED statid3 (SET statid3= )
REM Replace quotes from user
(SET statid1=%statid1:"="+chr(34)+"%)
(SET statid2=%statid2:"="+chr(34)+"%)
(SET statid3=%statid3:"="+chr(34)+"%)

COPY /Y "%anri_dir%ntsc_d1.png" > NUL
echo global pal=false > statid_preview.avs
echo import("%anri_dir%nate.avs") >> statid_preview.avs
echo run=blankclip(fps=29.97).audiodub(wavsource("%anri_dir%silence_stereo_48000.wav")) >> statid_preview.avs
echo nate_statid_d1(run,"%statid1%","%statid2%","%statid3%").Lanczos4Resize(640,480).converttoyv12 >> statid_preview.avs

"%anri_dir%xvid_encraw.exe" -i "statid_preview.avs" -bitrate 512 -pass1 "statid_preview.stats"
"%anri_dir%xvid_encraw.exe" -i "statid_preview.avs" -bitrate 512 -pass2 "statid_preview.stats" -avi "statid_preview.avi"
del statid_preview.stats statid_preview.avs ntsc_d1.png

set statid1=
set statid2=
set statid3=

ECHO.
ECHO  Finished! You will find statid_preview.avi on your Desktop. You can view this video in any player that supports DivX/Xvid.
ECHO.
PAUSE
@echo on
Personal tools