https://dl.dropboxusercontent.com/u/39871584/C0015.MXF
https://dl.dropboxusercontent.com/u/39871584/C0020.mxf
C0015 is a SD-IMX-D10 file
C0020 is a HD xdcam hd 422 file
"simply" I would like the batch
If a word "imx50" is find on the file then ....
if a word "MPEG2HD50" is find on the file then ...
if "imx50" OR "mpeg2hd" are not found GOTO End of File
words in not necessary case sensitive
What the best method to reduce searching time?
ps: oh no sorry: the procedure is
in choosed file---> find imx50
if yes do [procedureSD]
if not---> find mpeg2hd
if yes do [procedureHD]
if not goto EndOf File (error: file not SD, not HD or error file/procedure)
+ Reply to Thread
Results 1 to 10 of 10
-
Last edited by marcorocchini; 27th Apr 2014 at 16:06.
-
download this mediainfo.zip, I took it from Ripbot264, maybe it was modified by its author, so it can dump all mediainfo into text file, script checks horizontal resolution
then something like this would work:
Code:@echo off CD /D %~dp0 for %%a in ("*.MXF") do ( call :process %%a ) pause exit :process :: getting horizontal resolution for video if exist mediainfo.txt del mediainfo.txt MediaInfo.exe "%~n1%~x1" dumpinfo:unicodefile.txt TYPE unicodefile.txt > ascii.txt rename ascii.txt mediainfo.txt findstr /c:"Width :" "mediainfo.txt" > "temp.txt" set /p string= < "temp.txt" SET divider=: CALL SET after=%%string:*%divider%=%% set w=%after: pixels=% set w=%w: =% del "temp.txt" del "unicodefile.txt" if exist "ascii.txt" del "ascii.txt" DEL "mediainfo.txt" if %w% GTR 720 (goto HD_video_found) if %w% LEQ 720 (goto SD_video_found) echo mediainfo could not detect horizontal resolution for %~n1%~x1 video goto :EOF :SD_video_found :: whatever procedure for SD video echo SD video found: %~n1%~x1 goto :EOF :HD_video_found :: whatever procedure for HD video echo HD video found: %~n1%~x1 goto :EOF
Last edited by _Al_; 27th Apr 2014 at 21:24.
-
or if you wanteg go realy for those IMX50 and XDCAM 422 tags only, try this:
Code:@echo off CD /D %~dp0 for %%a in ("*.MXF") do ( call :process %%a ) pause exit :process :: getting commercial name tag for video if exist mediainfo.txt del mediainfo.txt MediaInfo.exe "%~n1%~x1" dumpinfo:unicodefile.txt TYPE unicodefile.txt > ascii.txt rename ascii.txt mediainfo.txt findstr /c:"Commercial name :" "mediainfo.txt" > "temp.txt" set /p string= < "temp.txt" SET divider=: CALL SET name=%%string:*%divider%=%% set name=%name: =% del "temp.txt" del "unicodefile.txt" if exist "ascii.txt" del "ascii.txt" DEL "mediainfo.txt" if "%name%" == "XDCAMHD422" (goto XDCAMHD422_video_found) if "%name%" == "IMX50" (goto IMX50_found) echo no IMX 50 or XDCAM HD 422 found for: %~n1%~x1 video goto :EOF :IMX50_found :: whatever procedure for this video echo IMX50 video found: %~n1%~x1 goto :EOF :XDCAMHD422_video_found :: whatever procedure for this video echo XDCAM HD422 video found: %~n1%~x1 goto :EOF
Last edited by _Al_; 27th Apr 2014 at 23:19. Reason: deleting not needed line
-
-
color 2
regedit /s v:\automazioneclip\virtualdub\accusoftMJPEG.reg
regedit /s v:\automazioneclip\virtualdub\setaccusoftMJPEG.reg
del v:\automazioneclip\output\temp.avi
del v:\automazioneclip\output\temp.wav
@echo on
set "d="
set "done="
set /p "d=Type source path (or press enter for current folder): "
if not defined d set "d=%cd%"
if not exist "%d%" echo Enter valid path - try again & goto :loop
:loop
cd /d "%d%"
del "temp.txt"
del "unicodefile.txt"
if exist "ascii.txt" del "ascii.txt"
DEL "mediainfo.txt"
for /f "delims=" %%a in ('dir *.mxf /b /od /a-d') do (
if defined done goto :EOF
if not exist "v:\automazioneclip\output\%%~na.*" (
echo %d%\%%~na.mxf|clip >nul
if exist mediainfo.txt del mediainfo.txt
v:\automazioneclip\virtualdub\MediaInfo.exe "%d%\%%~na.mxf" dumpinfo:unicodefile.txt
TYPE unicodefile.txt > ascii.txt
rename ascii.txt mediainfo.txt
findstr /c:"Commercial name : XDCAM HD422" "mediainfo.txt"
IF NOT ERRORLEVEL 1 (
v:\automazioneclip\core\ffmpeg.exe -y -i %d%\%%~na.mxf -filter_complex "[0:1] [0:2] amerge,volume=3" -c:a pcm_s16le v:\automazioneclip\output\%%~na.wav
v:\automazioneclip\core\ffmpeg.exe -y -i %d%\%%~na.mxf -filter_complex "[0:3] [0:4] amerge,volume=3" -c:a pcm_s16le v:\automazioneclip\output\%%~na.ch3ch4.wav
v:\automazioneclip\virtualdub\vdub.exe /max %d%\%%~na.mxf /s v:\automazioneclip\virtualdub\scriptHD.vcf
ren v:\automazioneclip\output\temp.avi %%~na.avi)
findstr /c:"Commercial name : IMX 50" "mediainfo.txt"
IF NOT ERRORLEVEL 1 (
v:\automazioneclip\core\ffmpeg.exe -i %d%\%%~na.mxf -map_channel 0.1.0 -map_channel 0.1.1 -af "volume=volume=9dBrecision=fixed" v:\automazioneclip\output\%%~na.wav
v:\automazioneclip\core\ffmpeg.exe -i %d%\%%~na.mxf -map_channel 0.1.2 -map_channel 0.1.3 -af "volume=volume=9dBrecision=fixed" v:\automazioneclip\output\%%~na.ch3ch4.wav
v:\automazioneclip\virtualdub\vdub.exe /max %d%\%%~na.mxf /s v:\automazioneclip\virtualdub\scriptIMX.vcf
ren v:\automazioneclip\output\temp.avi %%~na.avi)
del "temp.txt"
del "unicodefile.txt"
if exist "ascii.txt" del "ascii.txt"
DEL "mediainfo.txt"
goto loop
set done=1
)
) -
Nice ,that part to check for particular string only and check for error level to proceed or not ... good to know it works with findstr,
I do not follow that loop cycling, but nevermind. -
I just tried those error levels and findstr, it worked only like this (and simple FOR DO loop):
that: > nul is there just to not show those found lines it in command prompt window
Code:findstr /c:"XDCAM HD422" "mediainfo.txt" > nul IF NOT ERRORLEVEL 1 (echo HD MXF video found: %~n1%~x1) findstr /c:"IMX 50" "mediainfo.txt" > nul IF NOT ERRORLEVEL 1 (echo SD MXF video found: %~n1%~x1)
Code:findstr /c:"Commercial name : XDCAM HD422" "mediainfo.txt"
-
Hi al, please can you see my post:
https://forum.videohelp.com/threads/364382-batch-to-extract-with-ffmpeg-%28initial%29ti...47#post2320147
thanks!!