VideoHelp Forum




+ Reply to Thread
Results 1 to 3 of 3
  1. Hi, I have some files with different situations, For example one file has 2 audio tracks and no subtitle , the other file has 1 audio track 3 subtitle . So i want to have script that remove all tags from all part of video including this settings:
    Remove title and chapters and ags from the file
    Remove (ALL) Video track name and set language to undetermined
    Remove (ALL) Audio track name and set language to undetermined
    Remove (ALL) Subtitle track name and set language to undetermined
    BUT HERE IS MAIN PROBLEM:
    Mkvpropedit only edit file IF the settings are EXACTLY the one we enter for example when try all settings for multiple files in Jmkvpropedit i receive message like this:
    ----------
    The file is being analyzed.
    Error: No track corresponding to the edit specification 's3' was found. The file has not been modified.
    ----------
    So in above example most of my files have been edited but the file which had only s1 and s2 track and the file remains untouched. So I ask if you can help me with this using a script ( IDK much about scripting but I have read some docs and i think it is possible with (for %a) codes or something like that xD.
    And Thank You Very Very Very Much , I am on this for 2 days now.
    Quote Quote  
  2. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    You could try this batch file. It uses ffmpeg.exe. I have nothing to test it with properly.
    Output is in the New\ folder. Should be quite quick.

    Code:
    @echo off
    SETLOCAL
    if not exist New\ md New
    for %%a in ("*.mp4", "*.mkv") do call :process "%%a"
    goto :end
    
    :process
    :: Find all streams and set mapping parameters.
    ffmpeg -i "%~1" -y nul 2>&1 | find "Stream #1" > nul
    if %ERRORLEVEL% lss 1 set map1= -map 1
    ffmpeg -i "%~1" -y nul 2>&1 | find "Stream #2" > nul
    if %ERRORLEVEL% lss 1 set map2= -map 2
    ffmpeg -i "%~1" -y nul 2>&1 | find "Stream #3" > nul
    if %ERRORLEVEL% lss 1 set map3= -map 3
    ffmpeg -i "%~1" -map_chapters -1 -map_metadata -1 -metadata title="" -metadata comment="" -map 0 %map1%%map2%%map3% -c:v copy -c:a copy -c:s copy -y "New\%~1"
    goto :eof
    
    :end
    pause
    Cheers.
    (It's a slightly rubbish script and could be better written. But, if it works.....)
    Last edited by pcspeak; 21st Feb 2022 at 08:58. Reason: left out a colon.
    Quote Quote  
  3. Originally Posted by pcspeak View Post
    You could try this batch file. It uses ffmpeg.exe. I have nothing to test it with properly.
    Output is in the New\ folder. Should be quite quick.

    Code:
    @echo off
    SETLOCAL
    if not exist New\ md New
    for %%a in ("*.mp4", "*.mkv") do call :process "%%a"
    goto :end
    
    :process
    : Find all streams and set mapping parameters.
    ffmpeg -i "%~1" -y nul 2>&1 | find "Stream #1" > nul
    if %ERRORLEVEL% lss 1 set map1= -map 1
    ffmpeg -i "%~1" -y nul 2>&1 | find "Stream #2" > nul
    if %ERRORLEVEL% lss 1 set map2= -map 2
    ffmpeg -i "%~1" -y nul 2>&1 | find "Stream #3" > nul
    if %ERRORLEVEL% lss 1 set map3= -map 3
    ffmpeg -i "%~1" -map_chapters -1 -map_metadata -1 -metadata title="" -metadata comment="" -map 0 %map1%%map2%%map3% -c:v copy -c:a copy -c:s copy -y "New\%~1"
    goto :eof
    
    :end
    pause
    Cheers.
    (It's a slightly rubbish script and could be better written. But, if it works,.....)
    Thank You Very Much , It Worked Perfect.
    Quote Quote  



Similar Threads

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