Hi cats
please inside a batch I need to change
for example
c:\cats\vid.avi into c : \ c a t s \ v i d . a v i
or
filenameandpath into f i l e n a m e a n d p a t h
and load it on a envoriment variable, how can I do? thanks
+ Reply to Thread
Results 1 to 23 of 23
-
-
Code:
#include <stdio.h> main(int argc, char**argv) { int i=0; if (argc <= 1) exit(1); while(argv[1][i] != 0) printf("%c ", argv[1][i++]); exit(0); }
-
thanks jagabo
for example I have a batch that at a certain point I have
Code:echo %cd%
with your script where I have to put %cd% so that I can get another string c : \ c a t s ? -
Groucho2004Guest
-
It's not for me, a cat tell me how he can do. He have to batch automate using Elecard Converter Studio that save the batch list in a .csb file
the batch script have to insert a filename and path but it have spaces (it's like "unicode"?)
I have do the same thing for Mainconcept totalcode, but it don't need spaces in path
Code:@rem unless otherwise specified for debugging reasons turn echo off @if "%EMode%"=="" Set EMode=ON @ECHO %EMode% @ECHO off xcopy /y v:\automazioneclip\system\morgan\m3jpegHD.dll c:\windows\system32 xcopy /y v:\automazioneclip\system\morgan\MMIJG32.dll c:\windows\system32 xcopy /y v:\automazioneclip\system\morgan\m3jpegSD.dll c:\windows\system32 xcopy /y v:\automazioneclip\system\x264VFW.dll c:\windows\system32 xcopy /y v:\automazioneclip\system\pvmjpg40.dll c:\windows\system32 xcopy /y v:\automazioneclip\system\morgan\MMIJG30.dll c:\windows\system32 xcopy /y v:\automazioneclip\system\morgan\m3jpSD.INI c:\windows xcopy /y v:\automazioneclip\system\morgan\m3jpHD.ini c:\windows if exist c:\windows\SysWOW64 xcopy /y v:\automazioneclip\system\morgan\m3jpegHD.dll c:\windows\SysWOW64 if exist c:\windows\SysWOW64 xcopy /y v:\automazioneclip\system\morgan\MMIJG32.dll c:\windows\SysWOW64 if exist c:\windows\SysWOW64 xcopy /y v:\automazioneclip\system\morgan\m3jpegSD.dll c:\windows\SysWOW64 if exist c:\windows\SysWOW64 xcopy /y v:\automazioneclip\system\morgan\MMIJG30.dll c:\windows\SysWOW64 if exist c:\windows\SysWOW64 xcopy /y v:\automazioneclip\system\x264VFW.dll c:\windows\SysWOW64 if exist c:\windows\SysWOW64 xcopy /y v:\automazioneclip\system\pvmjpg40.dll c:\windows\SysWOW64 md c:\windows\spvideo xcopy /y v:\automazioneclip\system\wavdest.ocx c:\windows\spvideo xcopy /y v:\automazioneclip\system\SamplesDropper.ocx c:\windows\spvideo xcopy /y v:\automazioneclip\system\SP_audio.ocx c:\windows\spvideo xcopy /y v:\automazioneclip\system\dv_grabber.ocx c:\windows\spvideo xcopy /y v:\automazioneclip\system\SP_video.ocx c:\windows\spvideo regsvr32 /s c:\windows\spvideo\wavdest.ocx regsvr32 /s c:\windows\spvideo\SamplesDropper.ocx regsvr32 /s c:\windows\spvideo\SP_audio.ocx regsvr32 /s c:\windows\spvideo\dv_grabber.ocx regsvr32 /s c:\windows\spvideo\SP_video.ocx regedit /s v:\automazioneclip\system\VDreg.reg regedit /s v:\automazioneclip\system\PICreg.reg regedit /s v:\automazioneclip\system\drivers.reg cls SetLocal DisableDelayedExpansion Set "EXTLIST=*.*" Set "DoPop=0" Set "ARGLVL=0" Set "FileName-DQ=" Set Totalcode_Loc="C:\Program Files\Mainconcept\TotalCode Studio\tcstudio.exe" set "DestFolder=." Set "WorkFolder=%DestFolder%" rem process the arguments one by one :ARGS rem if there are no further arguments then exit the batch. if [%1]==[] ( if "%ARGLVL%"=="0" ( CALL :GetTargetName EndLocal pause ) goto :eof ) rem wildcard processing Set "FileName=%~1" if "%FileName%"=="" ( SHIFT goto :ARGS ) rem if the argument doesn't exist in the file system in any form skip it. if NOT EXIST %1 ( SHIFT goto :ARGS ) if NOT [%1]==[] if NOT "%FileName:^*=%%FileName:^?=%"=="%FileName%%FileName%" ( for %%w in (%1) DO ( Set /a ARGLVL+=1 CALL :ARGS "%%~fw" Set /a ARGLVL-=1 ) SHIFT goto :ARGS ) Set "FileName=" rem Set search/recursion variables Set "Pattern=%EXTLIST%" Set "STARTLVL=0" Set "FOUNDLVL=1024" rem if the argument is the current directory then process everything in it. if "%~f1"=="%CD%" ( rem echo Processing Directory "%CD%" CALL :START %1 SHIFT goto :ARGS ) rem Test if the argument is a directory, if it is move to it then process everything in it, if not then move to the file's parent directory and process the file. Then return to starting directory. Type NUL pushd "%~f1" 2> nul if NOT "%errorlevel%"=="0" ( if NOT "%CD%\"=="%~dp1" ( pushd "%~dp1" Set "DoPop=1" ) Set Pattern="%~nx1" ) else ( rem echo Processing Directory "%~f1" Set "DoPop=1" ) CALL :START %1 if "%DoPop%"=="1" ( popd Set "DoPop=0" ) SHIFT goto :ARGS :START <CURRENT_ARG> rem Count is superseded by FOUNDLVL but may still be useful for renaming purposes Set "Count=0" rem Process all files in the current directory fitting the arguments search pattern. for /f "delims=" %%y in ('dir %Pattern% /b /od /a-d') do ( if /I NOT "%%~y"=="File Not Found" CALL :Process_File "%%~fy" ) rem if it didn't find anything search all directories instead goto :eof if "%Count%"=="0" if %STARTLVL% LSS %FOUNDLVL% ( for /d %%b in (*) do ( pushd "%%~fb" rem echo Processing Directory "%%~fb" Set /a STARTLVL+=1 CALL :START "%%~fb" Set /a STARTLVL-=1 popd ) ) goto :eof :Process_File <FILENAME> Set /a Count+=1 Set "FOUNDLVL=%STARTLVL%" SetLocal DisableDelayedExpansion if exist "%~dpn1.wav" ( set "Audio=%~dpn1.wav" ) else ( set "Audio=v:\automazioneclip\system\empty.wav") rem Find TimeCode Info Set AUCount=0; for /f "tokens=1,2 delims=^=" %%g in ('v:\automazioneclip\virtualdub\FFProbe -hide_banner -loglevel fatal -pretty -select_streams v:0 -show_streams -show_entries stream^=codec_type^,r_frame_rate^,width^,height^,sample_aspect_ratio:stream_disposition^=:format_tags^=timecode^,company_name^,product_name^,product_version "%~1" 2^>^&1') DO ( if "%%~g"=="TAG:company_name" set "T_Company_Name=%%~h" if "%%~g"=="TAG:product_name" set "T_Product_Name=%%~h" if "%%~g"=="TAG:product_version" set "T_Product_Version=%%~h" if "%%~g"=="TAG:timecode" set "TIMECODE=%%~h" if "%%~g"=="r_frame_rate" set "Frame_Rate=%%~h" if "%%~g"=="width" set "V_Width=%%~h" if "%%~g"=="height" set "V_Height=%%~h" if "%%~g"=="sample_aspect_ratio" set "V_PAR=%%~h" if "%%~g"=="codec_type" if "%%~h"=="audio" set /a AUCount+=1 ) if "%V_Width%"=="" ( echo ERROR: Video Width NOT FOUND! pause goto :eof ) if "%V_Height%"=="" ( echo ERROR: Video Height NOT FOUND! pause goto :eof ) if "%V_PAR%"=="" ( echo ERROR: Video PAR NOT FOUND! pause goto :eof ) ) if NOT EXIST %Totalcode_Loc% ( echo Um, where the hell is Mainconcept Totalcode? pause ) rem Set "V_Q=UD" rem if %V_Width% LEQ 1920 if %V_Height% LEQ 1120 \\ Set "V_Q=HD" rem if %V_Width% LEQ 1280 if %V_Height% LEQ 752 Set "V_Q=MD" if %V_Width% LEQ 1024 if %V_Height% LEQ 608 Set "V_Q=SD" echo Using %V_Q% Mode echo PAR = %V_PAR% if "%TimeCode%"=="" echo Warning! no TimeCode Found! if NOT "%TimeCode%"=="" echo Timecode= %TIMECODE% if NOT "%TimeCode%"=="" ( SET /a total_frames_tc=((1%timecode:~0,2%-100^) * 90000^) + ((1%timecode:~3,2%-100^) * 1500^) + ((1%timecode:~6,2%-100^) * 25^) + (1%timecode:~-2%-100^) ) ELSE (SET "result=NOT defined") ECHO result with timecode="%timecode%" is %total_frames_tc%) if "%TimeCode%"=="" Set "total_frames_tc=0" rem *** splitter *** v:\automazioneclip\virtualdub\mediainfo.exe "%~1" dumpinfo:unicodefile.txt TYPE unicodefile.txt>mediainfo.txt set "MJPEGtag=0" findstr /c:"Codec ID : MJPG" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "MJPEGtag=1") findstr /c:"Codec ID : YUY2" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "UNCOMPRESSED=1") Set "TokenS=0" Set "isMXF=0" IF "%~x1"==".MXF" Set "TokenS=1" IF "%~x1"==".mxf" Set "TokenS=1" If "%TokenS%"=="1" Set "isMXF=1" Set "TokenS=0" Set "isAVI=0" IF "%~x1"==".AVI" Set "TokenS=1" IF "%~x1"==".avi" Set "TokenS=1" If "%TokenS%"=="1" Set "isAVI=1" Set "TokenS=0" echo %~f1>realINPUTfilename.txt if "%ISavi%"=="1" echo %Audio%>realAudioINPUTfilename.txt echo %~dp1%~n1TotalcodeHDout.mxf>realOUTPUTfilename.txt echo %~f1>realINPUTfilename.txt v:\automazioneclip\system\gsar.exe -s\ -r/ "%~dp1/realINPUTfilename.txt" -f "%~dp1/newinputfilename.txt" v:\automazioneclip\system\gsar.exe -s\ -r/ "%~dp1/realOUTPUTfilename.txt" -f "%~dp1/newOUTPUTfilename.txt" if "%ISavi%"=="1" (v:\automazioneclip\system\gsar.exe -s\ -r/ "%~dp1/realAudioINPUTfilename.txt" -f "%~dp1/newAudioInputfilename.txt") set /p INPUTfilenamefortotalcode=<newINPUTfilename.txt set /p OUTPUTfilenamefortotalcode=<newOUTPUTfilename.txt set /p AudioInputFilenameForTotalcode=<newAudioInputfilename.txt echo new INPUT filename for totalcode is %INPUTfilenamefortotalcode% echo new OUTPUT filename for totalcode is %OUTPUTfilenamefortotalcode% echo new OUTPUT filename for totalcode is %AudioInputFilenameForTotalcode% rem *** check if file is a MP4-CONFI Set "TokenS=0" Set "SD_MP4_CONFI=0" Set "HD_MP4_CONFI=0" Set "isMP4CONFI=0" IF "%~x1"==".MP4" Set "TokenS=1" IF "%~x1"==".mp4" Set "TokenS=1" If "%TokenS%"=="1" Set "isMP4=1" findstr /c:"Width : 720 pixels" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "WidthSD_MP4confi=1") findstr /c:"Height : 576 pixels" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "HeightSD_MP4confi=1") findstr /c:"Scan type : MBAFF" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "MBAAF=1") findstr /c:"Frame rate : 25.000 fps" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "mp4FPS25_confi=1") findstr /c:"Width : 1 920 pixels" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "WidthHD_MP4confi=1") findstr /c:"Height : 1 080 pixels" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "HeightHD_MP4confi=1") IF "%isMP4%"=="1" IF "%WidthSD_MP4confi%"=="1" IF "%HeightSD_MP4confi%"=="1" IF "%MBAAF%"=="1" IF "%mp4FPS25_confi%"=="1" (set "SD_MP4_CONFI=1") IF "%isMP4%"=="1" IF "%WidthHD_MP4confi%"=="1" IF "%HeightHD_MP4confi%"=="1" IF "%MBAAF%"=="1" IF "%mp4FPS25_confi%"=="1" (set "HD_MP4_CONFI=1") Set "TokenS=0" IF "%SD_MP4_CONFI%"=="1" Set "TokenS=1" IF "%HD_MP4_CONFI%"=="1" Set "TokenS=1" IF "%TokenS%"=="1" set "isMP4CONFI=1" Set "TokenS=0" rem *** check if file is a GOPRO MP4 fullHD 50fps progressive Set "TokenS=0" Set "isMP4GOPRO=0" IF "%~x1"==".MP4" Set "TokenS=1" IF "%~x1"==".mp4" Set "TokenS=1" If "%TokenS%"=="1" Set "isMP4=1" findstr /c:"Title : GoPro AVC" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "GoPROAVC=1") if "%ismp4%"=="1" if "%Goproavc%"=="1" (set "MP4gopro=1") findstr /c:"Frame rate : 50.000 fps" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "gopro50fps=yes") findstr /c:"Scan type : Progressive" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "goproProgressive=yes") findstr /c:"Width : 1 920 pixels" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "gopro1920=1") findstr /c:"Height : 1 080 pixels" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "gopro1080=1") IF "%MP4gopro%"=="1" IF "%gopro1920%"=="1" IF "%gopro1080%"=="1" if "%gopro50fps%"=="yes" if "%goproProgressive%"=="yes" (set "MP4goproFullHD50fpsProgressive=1") rem *** check if file is a GOPRO MP4 FullHD 25fps progressive Set "TokenS=0" Set "isMP4GOPRO=0" IF "%~x1"==".MP4" Set "TokenS=1" IF "%~x1"==".mp4" Set "TokenS=1" If "%TokenS%"=="1" Set "isMP4=1" findstr /c:"Title : GoPro AVC" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "GoPROAVC=1") if "%ismp4%"=="1" if "%Goproavc%"=="1" (set "MP4gopro=1") findstr /c:"Frame rate : 25.000 fps" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "gopro25fps=yes") findstr /c:"Scan type : Progressive" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "goproProgressive=yes") findstr /c:"Width : 1 920 pixels" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "gopro1920=1") findstr /c:"Height : 1 080 pixels" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "gopro1080=1") IF "%MP4gopro%"=="1" IF "%gopro1920%"=="1" IF "%gopro1080%"=="1" if "%gopro25fps%"=="yes" if "%goproProgressive%"=="yes" (set "MP4goproFullHD25fpsProgressive=1") Set "TokenS=0" Set "isMXF_OR_GOPROfullHD25_50fps_ORmp4Confi=0" IF "%MP4goproFullHD25fpsProgressive%"=="1" set "TokenS=1" IF "%MP4goproFullHD50fpsProgressive%"=="1" set "TokenS=1" IF "%isMP4CONFI%"=="1" set "TokenS=1" IF "%isMXF%"=="1" set "TokenS=1" IF "%TokenS%"=="1" set "isMXF_OR_GOPROfullHD25_50fps_ORmp4Confi=1" IF "%isMXF_OR_GOPROfullHD25_50fps_ORmp4Confi%"=="1" (CALL :Make_File_STANDARD "%WorkFolder%\%~n1.vcf" "%WorkFolder%\%~n1.avs" "%WorkFolder%\%~n1.avi" "%~f1") if "%ISavi%"=="1" (IF NOT "%MJPEGtag%"=="1" if not "%UNCOMPRESSED%"=="1" (CALL :Make_File_GENERIC "%WorkFolder%\%~n1.vcf" "%WorkFolder%\%~n1.avs" "%WorkFolder%\%~n1.avi" "%~f1")) if "%ISavi%"=="1" if "%MJPEGtag%"=="1" (CALL :Make_File_fromAviMjpeg "%WorkFolder%\%~n1.vcf" "%WorkFolder%\%~n1.avs" "%WorkFolder%\%~n1.avi" "%~f1") if "%ISavi%"=="1" if "%UNCOMPRESSED%"=="1" (CALL :Make_File_fromAviUNCOMPRESSED "%WorkFolder%\%~n1.vcf" "%WorkFolder%\%~n1.avs" "%WorkFolder%\%~n1.avi" "%~f1") if not "%ISavi%"=="1" if not "%UNCOMPRESSED%"=="1" if not "%isMXF_OR_GOPROfullHD25_50fps_ORmp4Confi%"=="1" (CALL :Make_File_GENERIC "%WorkFolder%\%~n1.vcf" "%WorkFolder%\%~n1.avs" "%WorkFolder%\%~n1.avi" "%~f1") if exist "%~dp1mediainfo.txt" del "%~dp1mediainfo.txt" if exist "%~dp1unicodefile.txt" del "%~dp1unicodefile.txt" echo FATTO echo. echo --------------------------------------------- echo. EndLocal goto :eof :Make_File_STANDARD <txt_FILENAME> <txt_FILENAME> <FILENAME> <ORG_FILENAME> cls echo use STANDARD_____________MXF MP4confidenziali GOpro fullHD25/50fps_____________ timeout /t 6 copy /y "v:\automazioneclip\core\HD.mpj" "%~dp1%~n1.mpj" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" W:/inputdirectory/inputfilename.MXF "%INPUTfilenamefortotalcode%" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" V:/uscitaTotalcode/fileoutputtedfromtotalcode.mxf "%OUTPUTfilenamefortotalcode%" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" thisisthetcstringtoinsertinthebatch "%total_frames_tc%" del realINPUTfilename.txt del realOUTPUTfilename.txt del newinputfilename.txt del newOUTPUTfilename.txt if exist "%~dp1tempbatchprocess" del /q "%~dp1tempbatchprocess" %Totalcode_Loc% "%~dp1%~n1.mpj" -transcode -quit del "%~dp1%~n1.mpj" set "name=admin" set "password=pdw-f800" set "server=192.168.0.18" ping %server% |find /i "TTL=" >nul || (echo camera offline, aborting&goto :EOF) set "ftpScript=%~dp1%~n1.ftp.tmp" ( echo open %server% echo %name% echo %password% echo cd clip echo dir echo quit ) > "%ftpScript%" for /f "tokens=8*" %%A in ('ftp -s:"%ftpScript%" ^| findstr /i /e ".mxf"') do @echo %%B >> "%~dp1%~n1.txt" del "%ftpScript%" md "%~dp1tempbatchprocess" ren "%~dp1%~n1.txt" CamFiles.txt for /f "tokens=* delims= " %%a in (CamFiles.txt) do type nul >"%~dp1tempbatchprocess\%%~na.cam" rem for /F "tokens=1 delims= " %%f in (%~dp1%~n1.txt) do (copy nul c:\folderD\%%f /y > nul & @echo Creating File %%f ) echo "%~dp1%~n1" echo "%~dp1" for /L %%a in (700,1,999) do ( if not exist "%~dp1tempbatchprocess\C0%%a.cam" if not exist "%~dp1C0%%a.mxf" (ren "%~dp1%~n1TotalcodeHDout.mxf" "C0%%a.mxf" if exist "%~dp1C0%%a.mxf" set "FilenameForCameraOnline=%~dp1C0%%a.mxf">"%~n1"_rinominato_in_"C0%%a_MXF".log) ) ) cls set "putToCam=putToCam.ftp" ( echo user admin pdw-f800 echo cd /clip echo put "%FilenameForCameraOnline%" echo bye ) > "%putToCam%" ren %putToCam% OutPutToCam.ftp ftp -d -n -i -s:OutPutToCam.ftp %server% if exist "%~dp1tempbatchprocess" del /q "%~dp1tempbatchprocess" if exist "%putToCam%" del "%putToCam%" del CamFiles.txt del OutPutToCam.ftp if exist "%~dp1tempbatchprocess" RD /S /q "%~dp1tempbatchprocess" goto :eof :Make_File_GENERIC <txt_FILENAME> <txt_FILENAME> <FILENAME> <ORG_FILENAME> cls echo procedura GENERIC GENERIC GENERIC GENERIC GENERIC GENERIC GENERIC GENERIC GENERIC GENERIC Make_File_GENERIC (including mpeg-in-avi) using avisynt and ffvideosource as InputDriver timeout /t 5 Set "genericProgressive=0" Set "genericInterlaced=0" Set "genericFPS25=0" Set "goproFile=0" Set "Morgan1088=0" Set "MBAAF=0" v:\automazioneclip\virtualdub\mediainfo.exe %4 dumpinfo:unicodefile.txt TYPE unicodefile.txt>mediainfo.txt findstr /c:"Scan type : Progressive" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "genericProgressive=1") findstr /c:"Scan type : Interlaced" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "genericInterlaced=1") findstr /c:"Frame rate : 25.000 fps" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "genericFPS25=1") findstr /c:"Title : GoPro AVC" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "goproFile=1") findstr /c:"Scan type : MBAFF" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "MBAAF=1") findstr /c:"Original height : 1 088 pixels" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "Morgan1088=1") rem *** TRY extract audio from *.* OTHER TYPE *** v:\automazioneclip\core\ffmpeg.exe -y -i %4 -af "pan=stereo:c0=c0:c1=c1,volume=1" -c:a pcm_s16le "%~dp1%~n1_gen_SD.wav" for %%v in ("%~dp1%~n1_gen_SD.wav") do ( if %%~zv LSS 128 ( echo ERROR!!! Extra Small File Wav Size Detected!!! timeout /t 5 del "%~dp1%~n1_gen_SD.wav" ) ) if exist "%~dp1%~n1_gen_SD.wav" ( set "AudioGeneric=%~dp1%~n1_gen_SD.wav" ) else ( set "AudioGeneric=v:\automazioneclip\system\empty.wav") echo %AudioGeneric%>realAudioGenericINPUTfilename.txt v:\automazioneclip\system\gsar.exe -s\ -r/ "%~dp1/realAudioGenericINPUTfilename.txt" -f "%~dp1/newAudioGenericInputfilename.txt" set /p AudioGenericInputFilenameForTotalcode=<newAudioGenericInputfilename.txt rem *** building .AVS file *** echo Import("C:\Program Files\AviSynth\plugins\IResize.avsi")>%2 echo FFVideoSource^(%4^)>>%2 IF "%genericProgressive%"=="1" (echo ConvertToYUY2^(interlaced=false^)>>%2) else (echo ConvertToYUY2^(interlaced=true^)>>%2) IF "%Morgan1088%"=="1" echo crop^(0,0,1920,1080^)>>%2 if "%dvcam%"=="1" echo ReverseFieldDominance^(^)>>%2 echo src = last >>%2 echo src = src.width==720^&^&src.height==608?src.crop^(0,32,0,0^):src >>%2 echo src = src.width^<721 ^|^| src.height^<609?src.ColorMatrix^(mode="Rec.601->Rec.709"^): src >>%2 Set "TokenS=0" IF "%goproFile%"=="1" set "TokenS=1" IF "%MBAAF%"=="1" set "TokenS=1" IF "%TokenS%"=="1" set "goproFileORmbaaf=1" IF "%goproFileORmbaaf%"=="1" (echo src.width!=1920 ^|^| src.height!=1080 ? src.IResize^(1920,1080^): src >>%2 ) else (echo src.width!=1920 ^|^| src.height!=1080 ? src.LanczosResize^(1920,1080^): src >>%2 ) IF NOT "%genericFPS25%"=="1" echo SmoothFPS2^(50000,1000^)>>%2 IF NOT "%genericFPS25%"=="1" echo AssumeTFF^(^).SeparateFields^(^).SelectEvery^(4,0,3^).Weave^(^) >>%2 echo AssumeFPS^(25^)>>%2 type "%2">"avstemp.avs" copy /y "v:\automazioneclip\core\daAVIgenericProgressiveVersusHD.mpj" "%~dp1%~n1.mpj" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" inputvideopartstring "%~dp1%avstemp.avs" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" inputaudiopartstring "%AudioGenericInputFilenameForTotalcode%" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" W:/casadei/MXForg/PRIME/C0049videopart_out.mxf "%OUTPUTfilenamefortotalcode%" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" thisisthetcstringtoinsertinthebatch "%total_frames_tc%" del realINPUTfilename.txt del realAudioINPUTfilename.txt del realOUTPUTfilename.txt del newinputfilename.txt del newOUTPUTfilename.txt del newAudioInputfilename.txt del realAudioGenericINPUTfilename.txt del newAudioGenericInputfilename.txt %Totalcode_Loc% "%~dp1%~n1.mpj" -transcode -quit if exist "%~dp1%~n1_gen_SD.wav" del "%~dp1%~n1_gen_SD.wav" del "%~dp1%~n1.mpj" del "avstemp.avs" del "%~dp1%~n1.avs" del *.ffindex set "name=admin" set "password=pdw-f800" set "server=192.168.0.18" ping %server% |find /i "TTL=" >nul || (echo camera offline, aborting&goto :EOF) set "ftpScript=%~dp1%~n1.ftp.tmp" ( echo open %server% echo %name% echo %password% echo cd clip echo dir echo quit ) > "%ftpScript%" for /f "tokens=8*" %%A in ('ftp -s:"%ftpScript%" ^| findstr /i /e ".mxf"') do @echo %%B >> "%~dp1%~n1.txt" del "%ftpScript%" md "%~dp1tempbatchprocess" ren "%~dp1%~n1.txt" CamFiles.txt for /f "tokens=* delims= " %%a in (CamFiles.txt) do type nul >"%~dp1tempbatchprocess\%%~na.cam" rem for /F "tokens=1 delims= " %%f in (%~dp1%~n1.txt) do (copy nul c:\folderD\%%f /y > nul & @echo Creating File %%f ) echo "%~dp1%~n1" echo "%~dp1" for /L %%a in (700,1,999) do ( if not exist "%~dp1tempbatchprocess\C0%%a.cam" if not exist "%~dp1C0%%a.mxf" (ren "%~dp1%~n1TotalcodeHDout.mxf" "C0%%a.mxf" if exist "%~dp1C0%%a.mxf" set "FilenameForCameraOnline=%~dp1C0%%a.mxf">"%~n1"_rinominato_in_"C0%%a_MXF".log) ) ) cls set "putToCam=putToCam.ftp" ( echo user admin pdw-f800 echo cd /clip echo put "%FilenameForCameraOnline%" echo bye ) > "%putToCam%" ren %putToCam% OutPutToCam.ftp ftp -d -n -i -s:OutPutToCam.ftp %server% if exist "%~dp1tempbatchprocess" del /q "%~dp1tempbatchprocess" if exist "%putToCam%" del "%putToCam%" del CamFiles.txt del OutPutToCam.ftp if exist "%~dp1tempbatchprocess" RD /S /q "%~dp1tempbatchprocess" goto :eof :Make_File_fromAviMjpeg <txt_FILENAME> <txt_FILENAME> <FILENAME> <ORG_FILENAME> cls echo procedura Make_File_fromAviMjpeg echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ echo ³ AVI MJPEG INPUT PROCEDURE ³ echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ echo. timeout /t 3 Set "Morgan1088=0" v:\automazioneclip\virtualdub\mediainfo.exe %4 dumpinfo:unicodefile.txt TYPE unicodefile.txt>mediainfo.txt findstr /c:"Original height : 1 088 pixels" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "Morgan1088=1") echo Import("C:\Program Files\AviSynth\plugins\IResize.avsi")>%2 echo AviSource^(%4^)>>%2 echo ConvertToYUY2^(interlaced=true^)>>%2 IF "%Morgan1088%"=="1" echo crop^(0,0,1920,1080^)>>%2 echo src = last >>%2 echo src = src.width^<721 ^|^| src.height^<609?src.ColorMatrix^(mode="Rec.601->Rec.709"^): src >>%2 echo AssumeTFF^(^)>>%2 echo AssumeFPS^(25^)>>%2 type "%2">"avstemp.avs" copy /y "v:\automazioneclip\core\daAVImjpegversusHD.mpj" "%~dp1%~n1.mpj" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" W:/casadei/MXForg/PRIME/C0049videopart.avi "%~dp1%avstemp.avs" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" W:/casadei/MXForg/PRIME/C0049audiopart.wav "%AudioInputFilenameForTotalcode%" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" W:/casadei/MXForg/PRIME/C0049videopart_out.mxf "%OUTPUTfilenamefortotalcode%" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" thisisthetcstringtoinsertinthebatch "%total_frames_tc%" del realINPUTfilename.txt del realAudioINPUTfilename.txt del realOUTPUTfilename.txt del newinputfilename.txt del newOUTPUTfilename.txt del newAudioInputfilename.txt %Totalcode_Loc% "%~dp1%~n1.mpj" -transcode -quit del "%~dp1%~n1.mpj" del "avstemp.avs" del "%~dp1%~n1.avs" set "name=admin" set "password=pdw-f800" set "server=192.168.0.18" ping %server% |find /i "TTL=" >nul || (echo camera offline, aborting&goto :EOF) set "ftpScript=%~dp1%~n1.ftp.tmp" ( echo open %server% echo %name% echo %password% echo cd clip echo dir echo quit ) > "%ftpScript%" for /f "tokens=8*" %%A in ('ftp -s:"%ftpScript%" ^| findstr /i /e ".mxf"') do @echo %%B >> "%~dp1%~n1.txt" del "%ftpScript%" md "%~dp1tempbatchprocess" ren "%~dp1%~n1.txt" CamFiles.txt for /f "tokens=* delims= " %%a in (CamFiles.txt) do type nul >"%~dp1tempbatchprocess\%%~na.cam" rem for /F "tokens=1 delims= " %%f in (%~dp1%~n1.txt) do (copy nul c:\folderD\%%f /y > nul & @echo Creating File %%f ) echo "%~dp1%~n1" echo "%~dp1" for /L %%a in (700,1,999) do ( if not exist "%~dp1tempbatchprocess\C0%%a.cam" if not exist "%~dp1C0%%a.mxf" (ren "%~dp1%~n1TotalcodeHDout.mxf" "C0%%a.mxf" if exist "%~dp1C0%%a.mxf" set "FilenameForCameraOnline=%~dp1C0%%a.mxf">"%~n1"_rinominato_in_"C0%%a_MXF".log) ) ) cls set "putToCam=putToCam.ftp" ( echo user admin pdw-f800 echo cd /clip echo put "%FilenameForCameraOnline%" echo bye ) > "%putToCam%" ren %putToCam% OutPutToCam.ftp ftp -d -n -i -s:OutPutToCam.ftp %server% if exist "%~dp1tempbatchprocess" del /q "%~dp1tempbatchprocess" if exist "%putToCam%" del "%putToCam%" del CamFiles.txt del OutPutToCam.ftp if exist "%~dp1tempbatchprocess" RD /S /q "%~dp1tempbatchprocess" goto :eof :Make_File_fromAviUNCOMPRESSED <txt_FILENAME> <txt_FILENAME> <FILENAME> <ORG_FILENAME> cls echo procedura Make_File_fromAviUNCOMPRESSED echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ echo ³ AVI UNCOMPRESSED INPUT PROCEDURE ³ echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ echo. timeout /t 3 Set "Morgan1088=0" v:\automazioneclip\virtualdub\mediainfo.exe %4 dumpinfo:unicodefile.txt TYPE unicodefile.txt>mediainfo.txt findstr /c:"Original height : 1 088 pixels" "mediainfo.txt" IF NOT ERRORLEVEL 1 (set "Morgan1088=1") echo Import("C:\Program Files\AviSynth\plugins\IResize.avsi")>%2 echo DirectShowSource^(%4^)>>%2 echo ConvertToYUY2^(interlaced=true^)>>%2 IF "%Morgan1088%"=="1" echo crop^(0,0,1920,1080^)>>%2 echo src = last >>%2 echo src = src.width^<721 ^|^| src.height^<609?src.ColorMatrix^(mode="Rec.601->Rec.709"^): src >>%2 echo AssumeTFF^(^)>>%2 echo AssumeFPS^(25^)>>%2 type "%2">"avstemp.avs" copy /y "v:\automazioneclip\core\daAVImjpegversusHD.mpj" "%~dp1%~n1.mpj" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" W:/casadei/MXForg/PRIME/C0049videopart.avi "%~dp1%avstemp.avs" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" W:/casadei/MXForg/PRIME/C0049audiopart.wav "%AudioInputFilenameForTotalcode%" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" W:/casadei/MXForg/PRIME/C0049videopart_out.mxf "%OUTPUTfilenamefortotalcode%" v:\automazioneclip\system\fart.exe "%~dp1%~n1.mpj" thisisthetcstringtoinsertinthebatch "%total_frames_tc%" del realINPUTfilename.txt del realAudioINPUTfilename.txt del realOUTPUTfilename.txt del newinputfilename.txt del newOUTPUTfilename.txt del newAudioInputfilename.txt %Totalcode_Loc% "%~dp1%~n1.mpj" -transcode -quit del "%~dp1%~n1.mpj" del "avstemp.avs" del "%~dp1%~n1.avs" set "name=admin" set "password=pdw-f800" set "server=192.168.0.18" ping %server% |find /i "TTL=" >nul || (echo camera offline, aborting&goto :EOF) set "ftpScript=%~dp1%~n1.ftp.tmp" ( echo open %server% echo %name% echo %password% echo cd clip echo dir echo quit ) > "%ftpScript%" for /f "tokens=8*" %%A in ('ftp -s:"%ftpScript%" ^| findstr /i /e ".mxf"') do @echo %%B >> "%~dp1%~n1.txt" del "%ftpScript%" md "%~dp1tempbatchprocess" ren "%~dp1%~n1.txt" CamFiles.txt for /f "tokens=* delims= " %%a in (CamFiles.txt) do type nul >"%~dp1tempbatchprocess\%%~na.cam" rem for /F "tokens=1 delims= " %%f in (%~dp1%~n1.txt) do (copy nul c:\folderD\%%f /y > nul & @echo Creating File %%f ) echo "%~dp1%~n1" echo "%~dp1" for /L %%a in (700,1,999) do ( if not exist "%~dp1tempbatchprocess\C0%%a.cam" if not exist "%~dp1C0%%a.mxf" (ren "%~dp1%~n1TotalcodeHDout.mxf" "C0%%a.mxf" if exist "%~dp1C0%%a.mxf" set "FilenameForCameraOnline=%~dp1C0%%a.mxf">"%~n1"_rinominato_in_"C0%%a_MXF".log) ) ) cls set "putToCam=putToCam.ftp" ( echo user admin pdw-f800 echo cd /clip echo put "%FilenameForCameraOnline%" echo bye ) > "%putToCam%" ren %putToCam% OutPutToCam.ftp ftp -d -n -i -s:OutPutToCam.ftp %server% if exist "%~dp1tempbatchprocess" del /q "%~dp1tempbatchprocess" if exist "%putToCam%" del "%putToCam%" del CamFiles.txt del OutPutToCam.ftp if exist "%~dp1tempbatchprocess" RD /S /q "%~dp1tempbatchprocess" goto :eof :GetTargetName Set "FileName=" Set /p FileName=InputFileName: rem Add or remove double-quotes if necessary if NOT DEFINED FileName ( Set "FileName-DQ=" CALL :ExitPrompt goto :DQSkip ) Set "FileName-DQ=%FileName:"=%" if NOT DEFINED FileName-DQ ( Set "FileName=" Set "FileName-DQ=" CALL :ExitPrompt goto :DQSkip ) if EXIST "%FileName-DQ%" ( if "%FileName-DQ%"=="%FileName-DQ: =%" ( Set "FileName=%FileName-DQ%" ) else ( Set FileName="%FileName-DQ%" ) ) :DQSkip if /I "%FileName-DQ%"=="CD" Set FileName="%CD%" if /I "%FileName-DQ%"=="EXIT" goto :eof if /I "%FileName-DQ%"=="NOEXIT" goto :GetTargetName if DEFINED FileName ( Set /a ARGLVL+=1 CALL :ARGS %FileName% Set /a ARGLVL-=1 ) goto :GetTargetName :ExitPrompt goto :eof
-
Groucho2004Guest
-
It's an ANSI C program. You have to compile and link it. At runtime in converts the first argument on the command line and outputs to stdout -- the console.
If Groucho2004 is right you need to convert ASCII to UNICODE (not add spaces):
http://www.robvanderwoude.com/type.php -
I think is enough add a space between every character
example: HELLO --> H E L L O -
-
Second this.
The OP loves cats. He really really really loves cats. He REALLY REALLY REALLY REALLY loves cats. For all I know he may be a felinophile. I was going to point out that putting spaces in names is really stupid if the files will ever be on a non-Windows system, but you know what? I really do not care at all if he wants to do this, so screw it. Just know that he REALLY gots him some love for the cats.
And the OP may have reached the end of jagabo's patience and THAT, my friends, is quite hard to do. -
I don't love cats, I'm a cat: it's simple
fart search "Thisistheinputfilenamefield" and "thisisthepath" inside the .csb and replace the filename and path with the one suggested as argument by the batch
Code:fart.exe "ConverterStudioProject.csb" Thisistheinputfilenamefield "c a t . a v i" fart.exe "ConverterStudioProject.csb" thisisthepath "c : \ m y c a t s"
and c : \ m y c a t s from c:\mycats -
Groucho2004Guest
So you simply ignore what I told you above? Or do you not understand it? The "spaces" you see may seem like spaces when you open the file in notepad but they are not. Notepad (at least the one in XP) cannot handle Unicode. Open the file in a hex editor and all will become clear.
-
maybe I'm mistake, but using fart.exe over the .csb file I need to replace the string with spaces
for example
Code:fart.exe "ConverterStudioProject.csb" thisisthepath "c : \ m y c a t s"
I'm a stupid cat but also fart.exe is stupid, so I'm looking for a string manupulator that convert
c:\mycats
into
c : \ m y c a t s -