Hi cats,
I have this batch that get all .mxf files from a ftp site (in this case my camera) and put it in the current directory (the same of the .bat file)
and
buid a concatList.txt for example
file 'c:\C0050.MXF'
file 'c:\C0057.MXF'
file 'c:\C0097.MXF'
file 'c:\C0131.MXF'
file 'c:\C0138.MXF'
file 'c:\C0142.MXF'
and launch ffmpeg to encode all files in that dir in a one output file
This is the batch:
I wonder:Code:@Echo Off color 6 del *.tmp set "d=" if not defined d set "d=%cd%" del concatList.txt rem xcopy /y v:\automazioneclip\core\processaTuttiFileMxfSenzaSovrascrivereAVI_SD.bat "%d%" rem start call "%d%\processaTuttiFileMxfSenzaSovrascrivereAVI_SD.bat" REM -- Define File Filter, i.e. files with extension .txt Set FindStrArgs=/E /C:".MXF" REM -- Extract Ftp Script to create List of Files Set "FtpCommand=ls" Call:extractFileSection "[Ftp Script 1]" "-">"%temp%\%~n0.ftp" Rem Notepad "%temp%\%~n0.ftp" REM -- Execute Ftp Script, collect File Names Set "FileList=" For /F "Delims=" %%A In ('"Ftp -v -i -s:"%temp%\%~n0.ftp"|Findstr %FindStrArgs%"') Do ( Call Set "FileList=%%FileList%% "%%A"" ) REM -- Extract Ftp Script to download files that don't exist in local folder Set "FtpCommand=mget" For %%A In (%FileList%) Do If Not Exist "%%~A" Call Set "FtpCommand=%%FtpCommand%% "%%~A"" Call:extractFileSection "[Ftp Script 1]" "-">"%temp%\%~n0.ftp" Rem Notepad "%temp%\%~n0.ftp" For %%A In (%FtpCommand%) Do Echo.%%A REM -- Execute Ftp Script, download files ftp -i -s:"%temp%\%~n0.ftp" Del "%temp%\%~n0.ftp" SETLOCAL Disabledelayedexpansion del concatList.txt set mypath= call :treeProcess goto :eof :treeProcess setlocal for %%f in (*.mxf) do echo file '%cd%\%mypath%%%f' >> "concatList.txt" for /D %%d in (*) do ( set mypath=%mypath%%%d\ cd %%d call :treeProcess cd .. ) endlocal rem In this red point rem v:\automazioneclip\core\ffmpeg.exe -y -f concat -i concatList.txt -af "pan=stereo:c0=c0:c1=c1,volume=1.8" -vf crop=720:576:0:32,scale=interl=1:in_range=tv:out_range=tv -pix_fmt yuv422p -c:v libx264 -profile:v high422 -level:v 3 -g 33 -bf 1 -crf 18 -flags +ilme+ildct -top 1 -x264opts tff=1 -c:a libvo_aacenc -b:a 320k -aspect 16:9 concatPerTgRbologna420.mp4 v:\automazioneclip\core\ffmpeg.exe -y -f concat -i concatList.txt -vcodec copy -an -aspect 16:9 concatPerTgRbolognaMPG.mxf rem del concatList.txt GOTO:EOF :extractFileSection StartMark EndMark FileName -- extract a section of file that is defined by a start and end mark :: -- [IN] StartMark - start mark, use '...:S' mark to allow variable substitution :: -- [IN,OPT] EndMark - optional end mark, default is first empty line :: -- [IN,OPT] FileName - optional source file, default is THIS file :$created 20080219 :$changed 20100205 :$categories ReadFile :$source http://www.dostips.com SETLOCAL Disabledelayedexpansion set "bmk=%~1" set "emk=%~2" set "src=%~3" set "bExtr=" set "bSubs=" if "%src%"=="" set src=%~f0& rem if no source file then assume THIS file for /f "tokens=1,* delims=]" %%A in ('find /n /v "" "%src%"') do ( if /i "%%B"=="%emk%" set "bExtr="&set "bSubs=" if defined bExtr if defined bSubs (call echo.%%B) ELSE (echo.%%B) if /i "%%B"=="%bmk%" set "bExtr=Y" if /i "%%B"=="%bmk%:S" set "bExtr=Y"&set "bSubs=Y" ) [Ftp Script 1]:S !Title Connecting... open 192.168.0.18 admin pdw-f800 !Title Preparing... cd clip lcd %cd% binary hash !Title Processing... %FtpCommand% %FtpCommand% !Title Disconnecting... disconnect bye
in the red point, all .mxf files are downloaded and are present in the directory, for example:
C0001.mxf
C0002.mxf
C0003.mxf
C0004.mxf
etc..
now I would like build a routine that check in all mxf files that they have the same "commercial name" for example:
Commercial name : XDCAM HD422
If ALL files have the same commercial name, tha batch can continue
If one file, or more file, don't have exactly the same "commercial name" ---> goto EOF and exit
This routine have to act only on the .mxf files
How can I do, possibly using ffprobe? thanks
+ Reply to Thread
Results 1 to 5 of 5
-
-
yes but I'm a cat!! :=)
my problem is I cannot apply the rule: for all the mxf files contained in a directory do...