Depending on the frame rate (29.97 or 59.94) I want to apply different processing paths to .wtv files.
With MediaInfo CLI, I can get the value into a text file, but I can't figure how to get it into a variable to process further.
"MediaInfo.exe", "--inform=Video;%%FrameRate%% " "C:\Users\Superuser\Desktop\dance.wtv" > "C:\Users\Superuser\Desktop\test.txt"
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 7 of 7
Thread
-
-
Check the Windows help for the FOR /F command (type for /? on the command line). If you would post the meidainfo output file I could be more specific.
-
Code:
set /p fps= < "C:\Users\Superuser\Desktop\test.txt" echo %fps%
normally asks for some user string input, and it will store that string in input variable, but when you give it a text like in that line above, it is done automaticallyLast edited by _Al_; 23rd Sep 2014 at 15:12.
-
Much obliged.
I was getting nowhere until you steered me right.
@ echo off
"MediaInfo.exe", "--inform=Video;%%FrameRate%% " "C:\Users\Superuser\Desktop\dance.wtv" > "C:\Users\Superuser\Desktop\test.txt"
set /p fps= < "C:\Users\Superuser\Desktop\test.txt"
if not %fps% == 59.940 goto test29
echo %fps%
:test29
if not %fps% == 29.970 goto eof
echo %fps%
:eof -
Just a hint. When comparing strings using variables, it's a good idea to include some character(s) in those strings to avoid errors in case the variables are empty. In your example, if %fps% is an empty string you'll get an error because the left part of the comparison can't be empty.
So, you should use instead:
IF NOT "%fps%" == "59.940" GOTO test29
or
IF NOT [%fps%] == [59.940] GOTO test29
I used "" and [], but, in fact, you can use almost any characther. This way, if %fps% is empty, the left part of the comparison would be "" or []."The greatest trick the Devil ever pulled was convincing the world he didn't exist."