is something in the COM interface to get the actual bitrate from a QSF


aargghh, never mind. my keyboard skills are not the best.
"Find" did not find the obvious thing I was looking for, an average bitrate, something is there as EstimatedVideoBitrate" though.


I have a situation where after a QSF I need to parse the VRD logfile to determine the actual bitrate which VRD determined is occurring in the QSF file (I search the log for the string "Actual Video Bitrate: ").

That works for v5 and v6 but when only when one single instance of, say vrd v6, is running at any one time and I can catch and parse a "clean" log file.

I tried using COM in a vbscript to find out the bitrate using FileGetOpenedFileProgramInfo
Dim Args, argCount
Dim inputFile
Dim VideoReDoSilent
Dim VideoReDo
Dim openflag, closeflag
Dim xml_string
Set Args = Wscript.Arguments
argCount = Wscript.Arguments.Count
If argCount <> 1 Then
    Wscript.StdOut.WriteLine("VRDTVS_VRD6_GetFileInfo: ERROR: arg count should be 1, but is " & argCount)
    Wscript.Quit 5
End If
inputFile = Args(0)
Set VideoReDoSilent = WScript.CreateObject("VideoReDo6.VideoReDoSilent")
Set VideoReDo = VideoReDoSilent.VRDInterface
openflag = VideoReDo.FileOpen(inputFile, False)
If openflag = False Then
    Wscript.StdOut.WriteLine("VRDTVS_VRD6_GetFileInfo: ERROR: VideoReDo failed to open file: """ & inputFile & """")
    on error resume next
    closeflag = VideoReDo.FileClose()
    on error goto 0
    Wscript.StdOut.WriteLine("VRDTVS_VRD6_GetFileInfo: Exiting with errorlevel code 5")
    Wscript.Quit 5
End If
xml_string = VideoReDo.FileGetOpenedFileProgramInfo() '
closeflag = VideoReDo.FileClose()
Wscript.StdOut.WriteLine(" ")
Wscript.StdOut.WriteLine(" ")
Wscript.StdOut.WriteLine("VRDTVS_VRD6_GetFileInfo: Exiting")
on error resume next
on error goto 0
Wscript.Quit 0
However that only returns the header bitrate which is of no use to me:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><VRDProgramInfo><FileName d="Name">somefilename.qsf.vrd6.mp4</FileName>
<FileSize f="0.029 GB" d="Size">28519136</FileSize>
<ProgramDuration f="00:01:04.84" d="Duration" total_frames="1622">5835601</ProgramDuration>
<FileType d="Mux type">MP4</FileType>
<FrameRate f="25.00 fps" d="Frame rate">25.000000</FrameRate>
<constant_frame_rate_flag d="Frame rate flag">Constant</constant_frame_rate_flag>
<EncodingDimensions d="Encoding size" width="1920" height="1080">1920 x 1080</EncodingDimensions>
<AspectRatio d="Aspect ratio">16:9</AspectRatio>
<HeaderBitRate f="25.000 Mbps" d="Header bit rate">25000000</HeaderBitRate>
<VBVBufferSize f="572 KBytes" d="VBV buffer">572</VBVBufferSize>
<Progressive f="Interlaced">False</Progressive>
<Chroma chroma_value="1">4:2:0</Chroma>
<EntropyCodingMode d="Entropy mode">CABAC</EntropyCodingMode>
<EstimatedVideoBitrate f="2.992 Mbps" d="Bit rate">2992213</EstimatedVideoBitrate>
</Video><AudioStreams><AudioStream StreamNumber="1" Primary="true"><AudioCodec d="Codec">AC3</AudioCodec>
<Format>AC3 stream</Format>
<AudioChannels d="Channels">5.1</AudioChannels>
<PESStreamId d="PES Stream Id">xBD</PESStreamId>
<AudioBitRate f="448 Kbps" d="Bit rate">448000</AudioBitRate>
<AudioSampleRate d="Sampling rate">48000</AudioSampleRate>
<BitsPerSample d="Sample size" f="16 bits">16</BitsPerSample>
So, I wondered if, instead ... perhaps at the end of a custom QSF script, calling this:
string OutputGetCompletedInfo(); Gets the output complete info for the most recently completed output file.
would provide the ActualVideoBitrate ?
... but what if there are other separate concurrent processes running the same script - and timing fluctuations means they may finish circa the same time ?
Which QSF'd video will OutputGetCompletedInfo return the XML for ?

Since one of my objectives is to also have concurrent workflows on the same PC,
Any advice would be greatly appreciated.


Senior Developer
Staff member
Yes, the output complete info has that value.

Each script is running it's own version of VideoReDo so it will return for that script only. The only time it's reset is if you process another file using the same instance of VRD. Which I don’t recommend anyway, since it's always better to start with a clean copy.
Top Bottom