VideoHelp Forum
+ Reply to Thread
Page 3 of 3
FirstFirst 1 2 3
Results 61 to 63 of 63
Thread
  1. Some cosmetic:
    Code:
    scale=640:trunc(ow/a/2)*2
    can be replaced by
    Code:
    scale=640:-2
    (modulo 2 = -2, modulo 16=-16 ...).
    Simpler way for normalization is peak2peak -3.0103dBFS - safest and fastest and at the same only 0.5 bit loss (best DAC dynamic range usage).
    Quote Quote  
  2. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    It's been a while since I posted.
    This deals with MKV videos. To extract only the English streams.
    The batch file, ffmpeg.exe and your MKV videos go in the one folder
    Run the batch file. Output in NEW\

    Usually the first stream is a video, the second, to however many are audio, and the last subtitles, if any.
    The first pass copies the file, setting the video language tag to English. It may already be.
    The second pass copies only the English video+audio streams.
    There will be no audio in the output if the language tag is not set to English for the audio stream.
    It usually is, as the video tag is now.

    Code:
    @echo off
    if not exist NEW\*.* md NEW
    if exist temp\*.* (del /q temp\*.*) else md temp
    
    for %%a in ("*.mkv") do call :Process "%%a"
    goto :end
    
    :Process
    :: Set the first stream, normally the video, to English. (In case it's not.)
    ffmpeg -i "%~1" -vcodec copy -acodec copy -metadata:s:0 language=eng -y "temp\%~1"
    :: Copy the English streams (video+audio) to a new video.
    ffmpeg -i "temp\%~1" -vcodec copy -acodec copy -map 0:m:language:eng -y "NEW\%~1"
    goto :eof
    
    :end
    rd /s /q temp
    Warning! There be Dragons.
    I do not have a single MKV with multiple audio tracks.
    For testing I used videos with only an English audio track.

    Cheers.

    Edit:
    Change the first ffmpeg pass to the following to set the first TWO streams to English if you wish to try that.
    Hopefully they'll be the English video and audio streams.
    Code:
    ffmpeg -i "%~1" -vcodec copy -acodec copy -metadata:s:0 language=eng -metadata:s:1 language=eng -y "temp\%~1"
    Last edited by pcspeak; 15th Feb 2018 at 00:43.
    Quote Quote  
  3. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    Should give a list of MKV videos that do NOT have an English audio track tagged.
    A work in progress.
    The batch file, MediaInfo.exe(command line version) and your MKV videos go in the one folder.
    Run the batch file.

    The output format is:
    video file name#language/language/language

    Code:
    @echo off
    if exist NoEnglish-List.txt del /q NoEnglish-List.txt
    if exist temp*.* del /q temp*.*
    
    for %%a in ("*.mkv") do call :Process "%%a"
    
    echo List of All videos with NO Englist audio track defined in the file's METADATA > NoEnglish-List.txt
    echo Does NOT mean there is no English audio track!!! >> NoEnglish-List.txt
    
    :: Find videos with NO English defined.
    find /v "English" temp2.txt >> NoEnglish-List.txt
    del /q temp*.*
    goto end
    
    :Process
    setlocal
    set video=%~1
    mediainfo.exe "--Inform=General;%%Audio_Language_List%%" "%video%" > temp.txt
    set /p Languages= < temp.txt
    del temp.txt
    echo "%video%"#%Languages% >> temp2.txt
    endlocal
    goto :eof
    
    :end
    start /i NoEnglish-List.txt
    Cheers.
    Last edited by pcspeak; 16th Feb 2018 at 18:04. Reason: Forgot to comment out a line.
    Quote Quote  



Similar Threads

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