VideoHelp Forum


Try StreamFab All-in-One and rip Netflix video! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 1 of 1
Thread
  1. Member
    Join Date
    Sep 2018
    Location
    Europe
    Search Comp PM
    ffmpeg bitrate subtraction
    Sorry my english is not that good.
    Need help.
    Have a Windows batch which reads the video bit rate with ffprobe
    and this reinserts for encoding.
    The problem is with GPU h264_amf which grabs me 100 kBit's data rate. would have to deduct 100 kBit's.
    Copy %% ~ jk is the data rate.
    So need "%% ~ j-100k"
    But it doesn't work as %% ~ j-100k

    k=kbits

    or so
    Code:
    set / p a = %% ~ j:
    set / p b = 100:
    set / a total =% a% -% b%
    -b: v% total% k -maxrate% total% k -bufsize% total% k
    Does not work either. who showed how to do it?

    MY FFMPEG CODE:

    Code:
    @echo off 
    cls & color 0B
    Mode con cols=60 lines=13
    cd /d "%~dp0"
    setlocal enabledelayedexpansion
    
    set "_ffmpeg=C:\ffmpeg\bin\ffmpeg.exe"
    set "_ffprobe=C:\ffmpeg\bin\ffprobe.exe"
    
    for %%# in (*.mp4) do (
    
         for /f "tokens=2,6 delims=, " %%i in ('2^>^&1 "!_ffprobe!" -show_entries stream^=bit_rate "%%~f#" ^| "%__APPDIR__%findstr.exe" /e [0-9].kb/s') do (
             
             if %%~j gtr 10 (
             
                 2>&1 "!_ffmpeg!" -y -i "%%~f#" -hide_banner -filter_complex "scale=1280:trunc(ow/a/2)*2" -f mp4 -c:v h264_amf -preset fast -b:v %%~jk -maxrate %%~jk -bufsize %%~jk -vsync 2 -r 24000/1001 -movflags +faststart -ac 2 -c:a aac -strict -2 -b:a 128k "end\%%~n#.mp4" 
    
                 
               ) else (
                 
                 set /a "_c+=1+0"
                 set "_skp_!_c!=Skipped File: %%~nx# Duration: %%~i Bit Rate: %%~j"
    
                     
               )
          )
        
      )
    
    echo.
    for /f "tokens=2 delims==" %%i in ('2^>nul set _skp_')do echo\%%~i
    
    %__APPDIR__%timeout.exe -1 
    endlocal
    Last edited by djjogy; 15th Apr 2021 at 13:55.
    Quote Quote  



Similar Threads