View Full Version : Info2 - a faster, prettier alternative to info()
wonkey_monkey
30th June 2019, 13:34
Info2 v0.1 (http://horman.net/avisynth/)
Direct link (http://horman.net/avisynth/download/Info2.zip)
The built-in info() function is, let's be honest, rubbish. The information it presents is badly formatted (it's not really formatted at all), and it's incredibly slow - barely managing 30fps on HD colourbars.
So with that in mind, Info2 is a replacement:
https://i.imgur.com/c4rDblj.png
Pros:
Faster - around 20x-100x depending on the colour space
Much easier to read - the information is presented in a table, not as a wall of text
Cons:
It doesn't show per-frame information, like field parity or frame number (but then again, that's frame information, not clip information)
Info2
=====
Display clip information.
Usage
=====
Info2(clip, int "size", string "font", int "background", bool "verbose", bool "glyph")
Parameters
==========
size:
Size, in pixels, of text
font:
Font name. Info2 defaults to Calibri or, failing that, Arial
background:
Background opacity:
0 : no background
1 : light background
2 : dark background (default)
verbose:
Print additional information (frame rate numerator/denominator, parity information)
glyph:
Enable/disable subsampling glyph
Groucho2004
30th June 2019, 14:36
Nice one, thanks.
Emulgator
30th June 2019, 14:41
Many thanks !
Sparktank
30th June 2019, 21:37
Thanks a lot for this!
videoFred
1st July 2019, 11:09
Nice one indeed! Is it possible to see fourcc also?
Fred.
StainlessS
1st July 2019, 11:15
fourcc
Only source filter could do that, I think. (or do you mean for raw unencoded[uncompressed] output ?)
EDIT: Not sure, think FFMS may produce fourcc in same way it tells frame types, eg I frames. (dont think any other source filter likely exposes fourcc).
EDIT: "Y41B" (YV411, think must be a FourCC)
https://i.postimg.cc/TLN7FKFP/Y41B.jpg (https://postimg.cc/TLN7FKFP)
EDIT: GStreamer describes "Y41B" as a "video format". https://gstreamer.freedesktop.org/documentation/opengl/glfilterbin.html?gi-language=c
wonkey_monkey
1st July 2019, 11:15
Should be. Does anyone know if the fourcc is exposed by AviSynth anywhere or (as I have to do with the colour space) would I have to assume it based on the pixeltype?
Edit: that's assuming Fred means the fourcc (is it a fourcc?) that is exposed to, for example, VirtualDub when it loads an AviSynth script (which complains that it doesn't understand "BGR0" (RGB48), for example).
Further edit: according to http://avisynth.nl/index.php/Avisynthplus_color_formats some colour spaces don't even have a FourCC. I don't know how that works.
StainlessS
1st July 2019, 11:50
Wonkey,
I tried this
return blankClip(pixel_type="YUVA444P12")
Which on your Wiki post has no FourCC name,
Does not play in WMP(Win7) or PotPlayer, Loaded into VDub2 as Y416 which is same as YUVA444P16, so if no FourCC looks like is converted to 16 bit (on output), using name for such.
RGB (8 bit), seems to have never had name.
Atak_Snajpera
1st July 2019, 11:51
Awesome!
videoFred
1st July 2019, 12:18
Should be. Does anyone know if the fourcc is exposed by AviSynth anywhere
I have searched for it, but I have only found this:
https://forum.doom9.org/showthread.php?t=91754
Mediainfo shows it under "codec ID".
For example:
Lagarith : "LAGS"
XVid: "XVID"
Canopus HQX: "CHQX"
many greetings,
Fred.
pinterf
1st July 2019, 12:40
Wonkey,
I tried this
return blankClip(pixel_type="YUVA444P12")
Which on your Wiki post has no FourCC name,
Does not play in WMP or PotPlayer, Loaded into VDub2 as Y416 which is same as YUVA444P16, so if no FourCC looks like is converted to 16 bit (on output), using name for such.
RGB (8 bit), seems to have never had name.
Avisynth negotiates FourCCs with consumer softwares which are using Video for Windows interface. Such as VirtualDub2.
Default FourCCs which are reported by Avisynth during the negotiation phase can be fine tuned (changed) by using the OPT_xxxx global variables. http://avisynth.nl/index.php/Internal_functions#Global_Options
But only a few formats have multiple choices, so this is useful only for formats that have more than one supported FourCC codes.
For example "OPT_Enable_V210" controls whether a YUV422P10 format is exported in V210 or P210 FourCC format.
Avisynth formats which have no appropriate FourCCs e.g. YUV444P14, the clip is silently upconverted to 16 bits internally (e.g. YUV444P16). Avisynth+ will report the clip as a 16 bit one. Consumer application - on the other side of the VfW interface - will see a 16 bit clip.
RGB48 has no automatic conversion, maybe I could make Avisynth+ to automatically expand it to RGB64 by using another OPT_xxx variable. Because RGB64 is supported in two flavours: BRA[64] or b64a if OPT_Enable_b64a=true is used.
(Or ask shekh whether RGB48 is supported by any FourCCs on VirtualDub2 side? EDIT:asked)
AviSource works similarly on the source side.
http://avisynth.nl/index.php/AviSource
RGB48 here is negotiated as BGR[48] (which is the same "BGR0" as 48 is the ASCII code for '0') or b48r.
wonkey_monkey
1st July 2019, 13:10
VirtualDub2 thinks that the colour spaces without FourCCs are [0][0][0][0], but rather than see this as "No FourCC", it interprets it sometimes as "Microsoft RLE" or sometimes as "Internal DIB decoder" (not sure how it decides which).
StainlessS
1st July 2019, 13:12
decides which
Possibly on file size, also same to distinguish RGB24 or RGB32.
EDIT: 'file size': actually the ILBM (or whatever it is) chunk size. (ILBM=Interleaved BitMap, that was the original chunk name for Electronic Arts IFF [Interchange File format] chunk).
EDIT: Or, maybe RLE has different chunk name. [VDub2 has Hex Editor (tools menu), can view chunks in AVI].
EDIT: Thanx Pinterf, very informative.
StainlessS
1st July 2019, 13:26
Fred, would you be able to use RT_Stats and CallCmd() in your quest to find FourCC from source file ? [also req MediaInfo Cli v0.7.83]
Can extract FourCC using MediaInfo Client library MIFO_Lib v1.01
[Currently needs comment out of GScript(""" ... """) stuff for AVS+]
https://forum.doom9.org/showthread.php?t=173268
Extracts stuff like so [ below was output to DebugView window via RT_DebugF("%s",String(S),name="TEST_RESULT: "), where S was multi-line string(or Int error code). ]
00000015 13:09:19.870 TEST_RESULT: General
00000016 13:09:19.870 TEST_RESULT: Count : 322
00000017 13:09:19.870 TEST_RESULT: StreamCount : 1
00000018 13:09:19.870 TEST_RESULT: StreamKind : General
00000019 13:09:19.870 TEST_RESULT: StreamKind/String : General
00000020 13:09:19.870 TEST_RESULT: StreamKindID : 0
00000021 13:09:19.870 TEST_RESULT: VideoCount : 1
00000022 13:09:19.870 TEST_RESULT: AudioCount : 1
00000023 13:09:19.870 TEST_RESULT: Video_Format_List : YUV
00000024 13:09:19.870 TEST_RESULT: Video_Format_WithHint_List : YUV (Ut Video)
00000025 13:09:19.870 TEST_RESULT: Video_Codec_List : ULY0
00000026 13:09:19.870 TEST_RESULT: Audio_Format_List : PCM
00000027 13:09:19.870 TEST_RESULT: Audio_Format_WithHint_List : PCM
00000028 13:09:19.870 TEST_RESULT: Audio_Codec_List : PCM
00000029 13:09:19.870 TEST_RESULT: CompleteName : D:\Parade.AVI
00000030 13:09:19.870 TEST_RESULT: FolderName : D:
00000031 13:09:19.870 TEST_RESULT: FileName : Parade
00000032 13:09:19.870 TEST_RESULT: FileExtension : AVI
00000033 13:09:19.870 TEST_RESULT: Format : AVI
00000034 13:09:19.870 TEST_RESULT: Format/String : AVI
00000035 13:09:19.870 TEST_RESULT: Format/Info : Audio Video Interleave
00000036 13:09:19.870 TEST_RESULT: Format/Extensions : avi
00000037 13:09:19.870 TEST_RESULT: Format_Commercial : AVI
00000038 13:09:19.870 TEST_RESULT: InternetMediaType : video/vnd.avi
00000039 13:09:19.870 TEST_RESULT: Interleaved : Yes
00000040 13:09:19.870 TEST_RESULT: Codec : AVI
00000041 13:09:19.870 TEST_RESULT: Codec/String : AVI
00000042 13:09:19.870 TEST_RESULT: Codec/Info : Audio Video Interleave
00000043 13:09:19.870 TEST_RESULT: Codec/Extensions : avi
00000044 13:09:19.870 TEST_RESULT: FileSize : 982010670
00000045 13:09:19.870 TEST_RESULT: FileSize/String : 937 MiB
00000046 13:09:19.870 TEST_RESULT: FileSize/String1 : 937 MiB
00000047 13:09:19.870 TEST_RESULT: FileSize/String2 : 937 MiB
00000048 13:09:19.870 TEST_RESULT: FileSize/String3 : 937 MiB
00000049 13:09:19.870 TEST_RESULT: FileSize/String4 : 936.5 MiB
00000050 13:09:19.870 TEST_RESULT: Duration : 246015
00000051 13:09:19.870 TEST_RESULT: Duration/String : 4mn 6s
00000052 13:09:19.870 TEST_RESULT: Duration/String1 : 4mn 6s 15ms
00000053 13:09:19.870 TEST_RESULT: Duration/String2 : 4mn 6s
00000054 13:09:19.870 TEST_RESULT: Duration/String3 : 00:04:06.015
00000055 13:09:19.870 TEST_RESULT: Duration/String4 : 00:04:06;01
00000056 13:09:19.870 TEST_RESULT: Duration/String5 : 00:04:06.015 (00:04:06;01)
00000057 13:09:19.870 TEST_RESULT: OverallBitRate : 31933360
00000058 13:09:19.870 TEST_RESULT: OverallBitRate/String : 31.9 Mbps
00000059 13:09:19.870 TEST_RESULT: FrameRate : 29.970
00000060 13:09:19.870 TEST_RESULT: FrameRate/String : 29.970 fps3
00000061 13:09:19.870 TEST_RESULT: FrameCount : 7373
00000062 13:09:19.870 TEST_RESULT: StreamSize : 441238
00000063 13:09:19.870 TEST_RESULT: StreamSize/String : 431 KiB (0%)
00000064 13:09:19.870 TEST_RESULT: StreamSize/String1 : 431 KiB
00000065 13:09:19.870 TEST_RESULT: StreamSize/String2 : 431 KiB
00000066 13:09:19.870 TEST_RESULT: StreamSize/String3 : 431 KiB
00000067 13:09:19.870 TEST_RESULT: StreamSize/String4 : 430.9 KiB
00000068 13:09:19.870 TEST_RESULT: StreamSize/String5 : 431 KiB (0%)
00000069 13:09:19.870 TEST_RESULT: StreamSize_Proportion : 0.00045
00000070 13:09:19.870 TEST_RESULT: File_Created_Date : UTC 2018-08-05 09:00:59.656
00000071 13:09:19.870 TEST_RESULT: File_Created_Date_Local : 2018-08-05 10:00:59.656
00000072 13:09:19.870 TEST_RESULT: File_Modified_Date : UTC 2018-01-19 00:58:26.343
00000073 13:09:19.870 TEST_RESULT: File_Modified_Date_Local : 2018-01-19 01:58:26.343
00000074 13:09:19.870 TEST_RESULT: Encoded_Application : Lavf57.25.100
00000075 13:09:19.870 TEST_RESULT: Encoded_Application/String : Lavf57.25.100
00000076 13:09:19.870 TEST_RESULT:
00000077 13:09:19.870 TEST_RESULT: Video
00000078 13:09:19.870 TEST_RESULT: Count : 334
00000079 13:09:19.870 TEST_RESULT: StreamCount : 1
00000080 13:09:19.870 TEST_RESULT: StreamKind : Video
00000081 13:09:19.870 TEST_RESULT: StreamKind/String : Video
00000082 13:09:19.870 TEST_RESULT: StreamKindID : 0
00000083 13:09:19.870 TEST_RESULT: ID : 0
00000084 13:09:19.870 TEST_RESULT: ID/String : 0
00000085 13:09:19.870 TEST_RESULT: Format : YUV
00000086 13:09:19.870 TEST_RESULT: Format_Commercial : YUV
00000087 13:09:19.870 TEST_RESULT: CodecID : ULY0
00000088 13:09:19.870 TEST_RESULT: CodecID/Info : Ut Video Lossless Codec
00000089 13:09:19.870 TEST_RESULT: CodecID/Hint : Ut Video
00000090 13:09:19.870 TEST_RESULT: CodecID/Url : http://umezawa.dyndns.info/archive/utvideo
00000091 13:09:19.870 TEST_RESULT: Codec : ULY0
00000092 13:09:19.870 TEST_RESULT: Codec/String : ULY0
00000093 13:09:19.870 TEST_RESULT: Codec/CC : ULY0
00000094 13:09:19.870 TEST_RESULT: Duration : 246012
00000095 13:09:19.870 TEST_RESULT: Duration/String : 4mn 6s
00000096 13:09:19.870 TEST_RESULT: Duration/String1 : 4mn 6s 12ms
00000097 13:09:19.870 TEST_RESULT: Duration/String2 : 4mn 6s
00000098 13:09:19.870 TEST_RESULT: Duration/String3 : 00:04:06.012
00000099 13:09:19.870 TEST_RESULT: Duration/String4 : 00:04:06;01
00000100 13:09:19.870 TEST_RESULT: Duration/String5 : 00:04:06.012 (00:04:06;01)
00000101 13:09:19.870 TEST_RESULT: BitRate : 30508096
00000102 13:09:19.870 TEST_RESULT: BitRate/String : 30.5 Mbps
00000103 13:09:19.870 TEST_RESULT: Width : 490
00000104 13:09:19.870 TEST_RESULT: Width/String : 490 pixel3
00000105 13:09:19.870 TEST_RESULT: Height : 360
00000106 13:09:19.870 TEST_RESULT: Height/String : 360 pixel3
00000107 13:09:19.870 TEST_RESULT: PixelAspectRatio : 1.000
00000108 13:09:19.870 TEST_RESULT: DisplayAspectRatio : 1.361
00000109 13:09:19.870 TEST_RESULT: DisplayAspectRatio/String : 4:3
00000110 13:09:19.870 TEST_RESULT: FrameRate : 29.970
00000111 13:09:19.870 TEST_RESULT: FrameRate/String : 29.970 fps3
00000112 13:09:19.870 TEST_RESULT: FrameCount : 7373
00000113 13:09:19.870 TEST_RESULT: ColorSpace : YUV
00000114 13:09:19.870 TEST_RESULT: ChromaSubsampling : 4:2:0
00000115 13:09:19.870 TEST_RESULT: ChromaSubsampling/String : 4:2:0
00000116 13:09:19.870 TEST_RESULT: ScanType : Progressive
00000117 13:09:19.870 TEST_RESULT: ScanType/String : Progressive
00000118 13:09:19.870 TEST_RESULT: Compression_Mode : Lossless
00000119 13:09:19.870 TEST_RESULT: Compression_Mode/String : Lossless
00000120 13:09:19.870 TEST_RESULT: Bits-(Pixel*Frame) : 5.771
00000121 13:09:19.870 TEST_RESULT: Delay : 0
00000122 13:09:19.870 TEST_RESULT: Delay/String3 : 00:00:00.000
00000123 13:09:19.870 TEST_RESULT: StreamSize : 938172312
00000124 13:09:19.870 TEST_RESULT: StreamSize/String : 895 MiB (96%)
00000125 13:09:19.870 TEST_RESULT: StreamSize/String1 : 895 MiB
00000126 13:09:19.870 TEST_RESULT: StreamSize/String2 : 895 MiB
00000127 13:09:19.870 TEST_RESULT: StreamSize/String3 : 895 MiB
00000128 13:09:19.870 TEST_RESULT: StreamSize/String4 : 894.7 MiB
00000129 13:09:19.870 TEST_RESULT: StreamSize/String5 : 895 MiB (96%)
00000130 13:09:19.870 TEST_RESULT: StreamSize_Proportion : 0.95536
EDIT: Above chopped off audio output, as below exceeded post max length.
EDIT: Above, CodecID returned from Video section by below snippet marked in RED.
EDIT: Probably an easier solution, think Grouchy2004 posted short easy script/script line, without use of Mifo_Lib, but he deleted his post from the Mifo_Lib thread.
EDIT: Demo function (add to Mifo_Lib or your script.
Function MI_Video_CodecID(String Fn,Int "Stream",Bool "Raw",Bool "Debug") # eg "ULY0"
{Return MIFO_VideoItem(Fn,Stream,"CodecID",Raw,Debug)}
client call returning eg "ULY0" in S string.
S = MI_Video_CodecID(FN)
EDIT: Additional Demo functions from above link.
####################################
########## DEMO FUNCTIONS ##########
####################################
###### # Demo individual purpose functions (in this case for stream in Section 'General') Below all returning Type Int.
Function MI_VideoCount(String Fn,Bool "Debug") {Return RT_NumberValue(MIFO_GeneralItem(Fn,0,"VideoCount",Debug=Debug))}
Function MI_AudioCount(String Fn,Bool "Debug") {Return RT_NumberValue(MIFO_GeneralItem(Fn,0,"AudioCount",Debug=Debug))}
Function MI_TextCount(String Fn,Bool "Debug") {Return RT_NumberValue(MIFO_GeneralItem(Fn,0,"TextCount",Debug=Debug))}
Function MI_ImageCount(String Fn,Bool "Debug") {Return RT_NumberValue(MIFO_GeneralItem(Fn,0,"ImageCount",Debug=Debug))}
Function MI_MenuCount(String Fn,Bool "Debug") {Return RT_NumberValue(MIFO_GeneralItem(Fn,0,"MenuCount",Debug=Debug))}
###### Demo individual purpose funcs (in this case for stream in Section 'Video')
###### Below return type string to differentiate between "" & 0.
###### Below default to Raw mode, (for some things Raw and Cooked may be same)
Function MI_Video_DAR(String Fn,Int "Stream",Bool "Raw",Bool "Debug") # eg '1.778'
{Return MIFO_VideoItem(Fn,Stream,"DisplayAspectRatio",Raw,Debug)}
Function MI_Video_CompressionMode(String Fn,Int "Stream",Bool "Raw",Bool "Debug") # eg "Lossless"/"Lossy"
{Return MIFO_VideoItem(Fn,Stream,"Compression_Mode",Raw,Debug)}
Function MI_Video_ColorSpace(String Fn,Int "Stream",Bool "Raw",Bool "Debug") # eg "YUV"
{Return MIFO_VideoItem(Fn,Stream,"ColorSpace",Raw,Debug)}
Function MI_Video_Width(String Fn,Int "Stream",Bool "Raw",Bool "Debug") # eg "720"
{Return MIFO_VideoItem(Fn,Stream,"Width",Raw,Debug)}
Function MI_Video_Height(String Fn,Int "Stream",Bool "Raw",Bool "Debug") # eg "576"
{Return MIFO_VideoItem(Fn,Stream,"Height",Raw,Debug)}
Function MI_Video_FrameRate(String Fn,Int "Stream",Bool "Raw",Bool "Debug") # eg "25.000"
{Return MIFO_VideoItem(Fn,Stream,"FrameRate",Raw,Debug)}
Function MI_Video_BitDepth(String Fn,Int "Stream",Bool "Raw",Bool "Debug") # eg "8"
{Return MIFO_VideoItem(Fn,Stream,"BitDepth",Raw,Debug)}
Function MI_Video_ScanType(String Fn,Int "Stream",Bool "Raw",Bool "Debug") # eg "Progressive"
{Return MIFO_VideoItem(Fn,Stream,"ScanType",Raw,Debug)}
Function MI_Video_ScanOrder(String Fn,Int "Stream",Bool "Raw",Bool "Debug") # eg "TFF"
{Return MIFO_VideoItem(Fn,Stream,"ScanOrder",Raw,Debug)}
EDIT: Maybe 'Codec/CC' better data item than 'CodecID', only testing with many clips could tell.
eg
Function MI_Video_CodecCC(String Fn,Int "Stream",Bool "Raw",Bool "Debug") # eg "ULY0"
{Return MIFO_VideoItem(Fn,Stream,"Codec/CC",Raw,Debug)}
Fred, would a recompile of AviInfo.dll for x64 fit your needs ?
EDIT: AviInfo() v0.4 here:- https://forum.doom9.org/showthread.php?p=1878330#post1878330
It would be cool to have the ability to customize the font style.
wonkey_monkey
2nd July 2019, 09:46
You can change the font, but font style doesn't seem like a particularly useful option (and it was confusing enough just trying to work out if a font family was valid, let alone a style).
videoFred
2nd July 2019, 10:18
Fred, would a recompile of AviInfo.dll for x64 fit your needs ?
Hi StainlessS :)
Again, thank you for all your help. No need to recompile AviInfo.dll for x64 because I do not use any x64 stuff.
I am going to play around a bit with AviInfo() :)
Fred.
StainlessS
2nd July 2019, 12:11
No need to recompile AviInfo.dll for x64
Hmmm, well already done anyways [@ above link], I'm sure somebody will find of use (eg me), no sweat :)
Groucho2004
2nd July 2019, 13:31
Probably an easier solution, think Grouchy2004 posted short easy script/script line, without use of Mifo_LibHuh? What? I don't think so (unless Alzheimer is kicking in).
I do recall telling you that it's easy to interface with mediainfo.dll in your programs and pull just the info you want instead of having to dig through the huge pile of stuff mediainfo.exe spits out.
StainlessS
2nd July 2019, 14:34
unless Alzheimer is kicking in
Maybe is for me then :(
FranceBB
3rd July 2019, 20:09
For what is worth, it works perfectly on Windows XP x86.
All calls are fine: Link (https://i.imgur.com/vLnl67e.png)
It works with real life scenario UHD Masterfile:
https://i.imgur.com/bF6Z0Ub.png
What would actually be great as a future Avisynth development would be to make Avisynth aware of the color curves of a file, so that the indexer can return this data if it's available in the original file metadata.
Why am I saying this?
Well, let's suppose that we have a color curve like HLG, PQ, Slog, Clog, Dlog, Flog etc.
If an indexer is color curve aware, it can tell the metadata to Avisynth and Avisynth can interpret the curve and the color matrix correctly and therefore display them correctly in a correctly flagged uncompressed A/V stream as well.
This way, it would be easier for people like me to create conditionals and apply different LUTs/tone-mapping according to which color curve and matrix is used and how many nits there are.
I feel like at the current stage of things, we have all the tools needed for HDR and so on, but it's somewhat not well integrated with Avisynth.
Anyway, as to Info2(), it does what is supposed to do and it works perfectly as a replacement for the standard Avisynth built-in info plugin, so thank you. :)
Taurus
4th July 2019, 08:14
@davidh*****
A big Thank You for this nifty tool!:thanks:
wonkey_monkey
3rd September 2019, 22:50
Minor bugfix - no-one else had noticed the problem (crash on greyscale clips), so I haven't bothered to update the version number, but I've updated the source code and DLLs:
http://horman.net/avisynth/download/info2.zip
hello_hello
4th September 2019, 00:33
Thank you
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.