2

Following is my bat file:

@echo off
mediainfo --Inform=file://template.txt "in.mp4" >info.txt

Following is my template.txt

General;File is: %FileName%\r\n 
Video;\r\nFormat: %Format%\r\nCodecID: %CodecID%\r\nResolution: %Width%x%Height%\r\nDAR: %DisplayAspectRatio/String% or %DisplayAspectRatio%\r\nPAR: %PixelAspectRatio%\r\nFrameMode: %FrameRate_Mode%\r\nVideoBitrateMode: %BitRate_Mode%\r\nScanType: %ScanType%

Audio;\r\nAudioCodec: %Format%\r\nAudioBitrateMode: %BitRate_Mode%

Following is the output (in info.txt)

File is: in

Format: AVC
CodecID: avc1
Resolution: 1280x720
DAR: 16:9 or 1.778
PAR: 1.000
FrameMode: VFR
VideoBitrateMode: 
ScanType: Progressive
AudioCodec: AAC
AudioBitrateMode: VBR

No matter what I do I can't get MediaInfo to give BitRate_Mode for any given file? Following is the CLI help document for mediainfo: Help doc

nightcrawler
  • 275
  • 5
  • 16

1 Answers1

3

I did exhaustive tests and I have found that most of the time mediainfo doesn't return the %BitRate_Mode% on video tracks, but it does return the %BitRate_Maximum% and if you compare it to the %BitRate% and it is different, it is a VBR video, here is my template:

General;Name.........: %FileName%.%FileExtension%\r\nSize.........: %FileSize/String%\r\nDuration.....: %Duration/String3%\r\n
Video;Resolution...: %Width%x%Height%\r\nCodec........: %Codec/String% %Format_Profile%\r\nBitrate......: %BitRate/String%\r\nMax Bitrate..: %BitRate_Maximum/String%\r\nFramerate....: %FrameRate% fps\r\nAspect Ratio.: %DisplayAspectRatio/String%\r\n
Audio;Audio........: %Language/String% %BitRate/String% %BitRate_Mode% %Channel(s)% chnls %Codec/String%\r\n
Text;%Language/String%
Text_Begin;Subs.........: 
Text_Middle;, 
Text_End;.\r\n

It will retirn something like this:

Name.........: My Video.m4v
Size.........: 8.23 GiB
Duration.....: 02:20:02.880
Resolution...: 1920x800
Codec........: AVC High@L3.0
Bitrate......: 7 504 Kbps
Max Bitrate..: 27.1 Mbps
Framerate....: 23.976 fps
Aspect Ratio.: 2.40:1
Audio........: English 448 Kbps CBR 6 chnls AC3
Audio........: Spanish 448 Kbps CBR 6 chnls AC3
Subs.........: English, Spanish.
Rodrigo Polo
  • 4,314
  • 2
  • 26
  • 32
  • I am not sure that works too well. I am using DLL not CLI, but I cant get `BitRate_Mode/String` either. Your idea sounded neat but MOST of the BitRate variants (Min, Max, Nominal) can (will) return an empty string. So comparing a number to "" will lead you to conclude VBR perhaps wrongly. I might not expect to see a MIN and MAX in a CBR stream, so it might be safer to conclude CBR only when they are present and the same. I think that is the default logic in MediaTab. – Ňɏssa Pøngjǣrdenlarp Sep 28 '13 at 19:47