Hi, here a ***
and however
my example out:Code:for /F "tokens=1,2 delims=^=" %%g in ('FFProbe -hide_banner -loglevel fatal -pretty -show_streams -select_streams v:0 -show_streams %FirstFile% 2^>^&1') DO ( if "%%~g"=="time_base" set "time_base=%%~h" if "%%~g"=="r_frame_rate" set "frame_rate=%%~h" if "%%~g"=="duration_ts" set "duration_ts=%%~h" if "%%~g"=="pix_fmt" set "pixel_fmt=%%~h" ) for /F "tokens=1,2 delims=/" %%g in ("%time_base%") do ( set "time_base_denom=%%~g" set /a "time_base_num=%%~h" ) for /F "tokens=1,2 delims=/" %%g in ("%frame_rate%") do ( set /a "frame_rate_num=%%~g" set "frame_rate_denom=%%~h" ) Set /a "fps_b=(%frame_rate_num%)/(%frame_rate_denom%)" echo 1 %frame_rate_num% echo 2 %frame_rate_denom% echo 3 %time_base_denom% echo 4 %time_base_num% echo 5 %r_frame_rate% echo 6 %frame_rate% echo 7 %fps_b% echo 8 %pixel_fmt%
but I need to get the result of fps_b = 29,970 and not simply 29Code:1 30000 2 1001 3 1 4 30000 5 6 30000/1001 7 29 8 yuv420p
How can I do? thanks
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 4 of 4
Thread
-
-
You can do it with fixed point math:
https://stackoverflow.com/questions/25951196/set-command-floating-point-numbers
But make your life simple: download a command line calculator app that natively support floating point:
https://sourceforge.net/projects/cmdlinecalc/files/ -
yes but I'm inside a batch
for the moment seems that this works but is rudimental
assuming %firstFile% as input
Code:echo %firstFile% rem #### SEARCH for durations: advanced #### Set AUCount=0; Set VDCount=0; Set STCount=0; Set "V_Number_Of_Frames=" for /f "tokens=1,2 delims=^=" %%g in ('FFProbe -hide_banner -loglevel fatal -pretty -show_format -show_streams %FirstFile% 2^>^&1') DO ( CALL :Process_Item "%%~g" "%%~h" ) if "%V_Time_Base%"=="" ( echo ERROR: V_Time_Base not found, impossibile rilevare il FrameRate ) if NOT "%V_Time_Base%"=="" ( for /F "tokens=1,2 delims=/" %%g in ("%V_Time_Base%") do ( set "V_Time_Base_Denom=%%~g" set /a "V_Time_Base_Num=%%~h*10000" ) ) if "%V_Frame_Rate%"=="" ( echo ERROR: V_Frame_Rate, impossibile rilevare il FrameRate ) if NOT "%V_Frame_Rate%"=="" ( for /F "tokens=1,2 delims=/" %%g in ("%V_Frame_Rate%") do ( set /a "V_Frame_Rate_Pure=%%~g" set "V_Frame_Rate_Denom_cat=%%~h*100" set /a "V_Frame_Rate_Num=%%~g*10000" set "V_Frame_Rate_Denom=%%~h" ) ) if "%V_Number_Of_Frames%"=="" Set /a "V_Number_Of_Frames=V_Duration/((V_Time_Base_Num/V_Time_Base_Denom)/(V_Frame_Rate_Num/V_Frame_Rate_Denom))" set /a "FPSforVirtualdubX2=%V_Number_Of_Frames%" set /a "FPSforVirtualdubdiv2=%V_Number_Of_Frames%/2" set "FPSforVirtualdub=%V_Number_Of_Frames%" rem #### calculate realFPS with 2 fps calculators echo WScript.Echo Eval^(WScript.Arguments^(0^)^)>"%~dp1FPScalculator1.vbs" echo Result=Replace^(Result,",","."^)>>"%~dp1FPScalculator1.vbs" echo WScript.Echo Result>>"%~dp1FPScalculator1.vbs" IF NOT "%V_Frame_Rate_Pure%"=="" IF NOT "%V_Frame_Rate_Denom%"=="" for /f %%n in ('cscript //nologo "%~dp1FPScalculator1.vbs" "%V_Frame_Rate_Pure%/%V_Frame_Rate_Denom%"') do (set RealFPS2temp=%%n) echo %RealFPS2temp%>"%~dp1RealFPS2temp.txt" v:\automazioneclip\system\fart.exe "%~dp1RealFPS2temp.txt" , "." set /p RealFPS2=<"%~dp1RealFPS2temp.txt" echo Numerator = WScript.Arguments^(0^)>"%~dp1FPScalculator2.vbs" echo Denom = WScript.Arguments^(1^)>>"%~dp1FPScalculator2.vbs" echo Result=Numerator/Denom>>"%~dp1FPScalculator2.vbs" echo WScript.Echo Result>>"%~dp1FPScalculator2.vbs" echo Result=Replace^(Result,",","."^)>>"%~dp1FPScalculator2.vbs" echo WScript.Echo Result>>"%~dp1FPScalculator2.vbs" echo Result=Round^(Numerator/Denom,2^)>>"%~dp1FPScalculator2.vbs" echo Result=Replace^(Result,",","."^)>>"%~dp1FPScalculator2.vbs" echo WScript.Echo Result>>"%~dp1FPScalculator2.vbs" setlocal ENABLEDELAYEDEXPANSION set fcount=1 IF NOT "%V_Frame_Rate_Pure%"=="" IF NOT "%V_Frame_Rate_Denom%"=="" FOR /F "tokens=* USEBACKQ" %%F IN (`cscript /nologo "%~dp1FPScalculator2.vbs" %V_Frame_Rate_Pure% %V_Frame_Rate_Denom%`) DO (set var!fcount!=%%F set /a fcount=!fcount!+1 ) echo %var2%>"%~dp1RealFPStemp.txt" endlocal set /p RealFPS=<"%~dp1RealFPStemp.txt" IF EXIST RealFPS2temp.txt DEL RealFPS2temp.txt if exist "%cd%\FPScalculator1.vbs" del "%cd%\FPScalculator1.vbs" if exist "%cd%\FPScalculator2.vbs" del "%cd%\FPScalculator2.vbs" if exist "%cd%\RealFPStemp.txt" del "%cd%\RealFPStemp.txt" if exist "%cd%\RealFPStemp2.txt" del "%cd%\RealFPStemp2.txt" goto :continuazione :Process_Item <item_field> <item_data> color if "%~2"=="N/A" goto :eof if "%~1"=="[/STREAM]" ( set "CType=" goto :eof ) if "%~1"=="[/FORMAT]" ( set "CType=" goto :eof ) if "%~1"=="[FORMAT]" ( set "CType=FORMAT" goto :eof ) if "%~1"=="index" Set "cur_index=%~2" if "%~1"=="codec_name" Set "cur_codec=%~2" if "%~1"=="codec_type" ( if "%~2"=="audio" ( set /a AUCount+=1 set "CType=audio" ) if "%~2"=="video" ( Set /a VDCount+=1 set "CType=video" ) if "%~2"=="subtitle" ( Set /a STCount+=1 set "CType=subtitle" ) goto :eof ) if "%CType%"=="FORMAT" ( if "%~1"=="TAG:company_name" set "T_Company_Name=%~2" if "%~1"=="TAG:product_name" set "T_Product_Name=%~2" if "%~1"=="TAG:product_version" set "T_Product_Version=%~2" if "%~1"=="TAG:timecode" set "TIMECODE=%~2" goto :eof ) if "%CType%"=="video" ( if %VDCount% GTR 1 ( echo Multiple Video Streams!!!! pause ) if "%~1"=="time_base" set "V_Time_Base=%~2" if "%~1"=="r_frame_rate" set "V_Frame_Rate=%~2" if "%~1"=="duration_ts" set "V_Duration=%~2" if "%~1"=="width" set "V_Width=%~2" if "%~1"=="height" set "V_Height=%~2" if "%~1"=="sample_aspect_ratio" set "V_PAR=%~2" if "%~1"=="nb_frames" set "V_Number_Of_Frames=%~2" goto :eof ) goto :eof :continuazione echo RealFPS is %RealFPS% echo RealFPS2 is %RealFPS2% echo %firstFile%
Similar Threads
-
QTGMC mov 29.970 (Constant fps) Ends up 58.42 FPS rather than 59.940
By VidNew23 in forum Video ConversionReplies: 9Last Post: 7th Apr 2021, 23:21 -
batch for change fps with multi streams
By nacho1191 in forum Newbie / General discussionsReplies: 0Last Post: 24th Jan 2021, 21:57 -
how can I mux 25 fps audio into 23.438 fps (1024 spf) ?
By precipizio in forum AudioReplies: 12Last Post: 16th Apr 2020, 14:06 -
Ultimate Guide for Interlaced (29,97 fps) to Progressive (23,976/59,94 fps)
By kalemvar1 in forum Video ConversionReplies: 9Last Post: 22nd Dec 2018, 06:49 -
How to make 1080i 59.940 FPS video to 29.970 FPS
By Joycon in forum Newbie / General discussionsReplies: 2Last Post: 10th Dec 2018, 13:47