VideoHelp Forum
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. 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)
    Last edited by marcorocchini; 27th Apr 2014 at 16:06.
    Quote Quote  
  2. 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.
    Quote Quote  
  3. 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
    Quote Quote  
  4. Hi _Al_

    Seems to me that your batch use mediainfo to extract info from .mxf files, but I wonder: can the only findstr work directly in .mxf files? without using mediainfo? thank you
    Quote Quote  
  5. kindly I should have another question:

    considering my .avi file Click image for larger version

Name:	EXAMPLE.JPG
Views:	185
Size:	159.8 KB
ID:	24859 I would like to change mjpg in MJPG
    can I do this directly from dos-command? of course I think the avi file have to be rewrite but what is the command to do this? thank you
    Quote Quote  
  6. 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
    )
    )
    Quote Quote  
  7. 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.
    Quote Quote  
  8. 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)
    that line
    Code:
    findstr /c:"Commercial name : XDCAM HD422" "mediainfo.txt"
    did not worked
    Quote Quote  
  9. sorry, the working in my pc is this

    Click image for larger version

Name:	IMAGE.JPG
Views:	189
Size:	276.5 KB
ID:	24866
    Quote Quote  
  10. Originally Posted by _Al_ View Post
    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)
    that line
    Code:
    findstr /c:"Commercial name : XDCAM HD422" "mediainfo.txt"
    did not worked
    Hi al, please can you see my post:

    https://forum.videohelp.com/threads/364382-batch-to-extract-with-ffmpeg-%28initial%29ti...47#post2320147

    thanks!!
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!