View Full Version : MediaInfo(Lib) 0.7 - Reading information about media files
manolito
20th September 2015, 23:30
Note: if you think you can get average frame rate and duration of all streams for sure, without any error with all files I have (that means that e.g. video stream duration and audio stream duration may be different) without parsing the whole file, I am interested in a patch and/or hint about how to get it.
Sorry, all the VFR files I ever had to deal with were created by HandBrake, and for these files the older MediaInfo 0.7.58 reports the correct frame rate.
I mainly use MediaInfo from within AVStoDVD, and situations where video and audio stream durations are different do not really matter here. AVStoDVD needs a frame rate, and if MediaInfo does not report it, I can only enter a frame rate manually - I have no way to know which one.
With the old MediaInfo version I do get a frame rate. And even if this rate is not totally correct, it will still work as long as VFR is detected. If the source is VFR, AVStoDVD will open it with with the DirectShowSource parameter "convertfps=true", and this will convert the source to CFR by inserting or dropping frames (similar if FFMpegSource is used).
Since AVStoDVD creates DVDs (which do not support VFR), a conversion from VFR to CFR is mandatory at some point in the chain, so doing this right at the source filter stage makes sense.
Maybe you can provide a link to some problematic VFR files where this old algorithm does not work...
Cheers
manolito
foxyshadis
21st September 2015, 06:23
If no frame rate is available, or even if one is but it's nonstandard, I'd just open with DSS's convertfps=true with exactly double whatever the final framerate of the DVD is, weave the fields, and encode interlaced. That handles all VFR as optimally as possible without either blending or mo-comp.
More advanced analysis could reveal where progressive with soft pulldown is possible, but you have to parse the timecodes for that and pass the ranges on. Encoding interlaced just works.
Zenitram
21st September 2015, 08:35
Sorry, all the VFR files I ever had to deal with were created by HandBrake, and for these files the older MediaInfo 0.7.58 reports the correct frame rate.
Did you test on a file more than 1 minute? Your sample file is small, so MediaInfo actually parses the whole file here (it parses ~500 frames for different reasons). So the previous algorithm was OK in this specific case.
Note: actually, it was not OK, the duration of the last frame was not used, real average frame rate is 15.111, not 15.167.
Not a big difference here, but it may be a bigger one for other files.
I mainly use MediaInfo from within AVStoDVD, and situations where video and audio stream durations are different do not really matter here.
Good for you. It does matter for me. And actually, you get the duration you are looking for (in the "general" part).
I'll be direct (and arogant): and I don't develop only for you. If you pay me, I could develop a specific version for you and/or add an option for having what you are looking for, and if you don't I just release a version whose I think is best for all people and which does not take too much time for me to develop.
"I" is not a good argument here.
Maybe you can provide a link to some problematic VFR files where this old algorithm does not work...
I would provide the same link than you: your file is a good example.
Let's play with this file, some fun:
- It has no metadata for hte duration of the stream. So we know that the program duration is 12.678 seconds, we know that the last frame timestamp is 12.612, but that's all. OK, let's try and say that the last frame has a duration of 66 ms (we cheat: we consider the program duration as the video duration). there are 191 frames in it (full scan, could not be done by default for all files, too slow), so average frame rate is 15.111. old algorithm does not work here (it says 15.167).
- Let's check the audio duration: last time stamp is 12.608. Audio block duration is provided by the AAC frame, 1024 samples/32000 Hz = 32 ms so total duration is 12.640. old algorithm (and the current one too, something is wrong because duration should not be displayed, I'll fix that) reuses the program duration (12.678), obviously wrong.
Let's rewrap to MP4 with FFmpeg:
- video duration: 12.611. Ho, funny, not same as Matroska program duration, ha ha... Actually, FFmpeg forces the last frame duration to 0. I guess it is wanted, but it is wrong (but actually it is not easy to know the real duration, we can cheat and read the program duration, this is a choice, FFmpeg did not choose that). You can see that old MediaInfo does not report the same frame rate (15.146 fps), so this is obvious that there is a problem somewhere.
- audio duration: 12.640. easier to get the right duration (thanks to AAC block duration information), not same as the algo in MediaInfo for the audio track (because MediaInfo is wrong for the audio track, actually).
***
I took some time for explaining issues, I won't take more time. old algo was wrong, not usable for a general purpose, that's all.
Current behavior is the expected one (actually, I should also remove the audio duration, this is a bug).
Improvement of the old algorithm in order to provide correct information for small files without showing incoherant values for some other files and an option for parsing the whole file in order to provide such value are on the ToDo-list, but is not the priority for the moment (no sponsor for it, sponsors have higher priority).
and please, don't say that I am wrong without being able to demonstrate in the specifications of the formats (Matroska, AVC, AAC...) how to readout such pieces of information. Example with FFmpeg transcode (which may introduce issues e.g. last frame duration of 0 which is not so real) or how you specificaly use a bunch of tools are not relevant (especially when you don't read the resut of your work, you say that MediaInfo can read frame rate from a MP4 transwrap, you "forgot" to say that the numbers are not same).
TLDR; I did not remove such information because I like to remove data, I removed it because I got too many complains about wrong results and it was the quickest way for me to provide less buggy information.
manolito
21st September 2015, 16:42
@ foxyshadis
Thanks for the tip to encode VFR as interlaced. Very useful, I will forward it to MrC...
@Zenitram
Looks like I stepped on your feet when I used the word "Bug Report" in my initial post. What I saw was that with these files the current version did not work, but the older version did. So I called it a regression, i.e. a bug.
I had no intention to offend you, you made your point very clear that the old algo was wrong and so you removed it, so the current version has the correct behavior and the old version was buggy.
If I did offend you, I do apologize, I also edited the header of my original post.
But I will stick with my point, this whole thing looks like the typical dispute between the academic world and the real world.
You say: If I am unable to report the exact and precise data, then I will rather not report anything at all.
I say: If I can get an approximation of the data with an acceptable margin of error (acceptable depends on the context where the application is used in) then I'd much rather use this approximation than getting no data at all.
In the context of AVStoDVD the margin of error for the old algo is small enough, errors of this magnitude have no influence on the quality of the conversion results.
In the medical community there is an old saying: "Whoever heals is right". I would change this saying for the computer programming world: "Whatever works is right". So I will continue using the old MediaInfo version 0.7.58 in AVStDVD until I stumble over a VFR conversion which looks terrible because the old algo screwed things up.
Cheers
manolito
Zenitram
21st September 2015, 17:39
In the medical community there is an old saying: "Whoever heals is right". I would change this saying for the computer programming world: "Whatever works is right".
Exactly my point: it was not working, I fixed it with the quickest way I found, because I did not have the time to fix it better. Whatever works is right, and it works better now than in 0.7.58 for my needs (genenral purpose, and I try to receive less complains by email about buggy values), at least.
Again, you have small differences with your files but other people may have more differences.
Again, I am not against reintroducing the old algo or finding a way to detect when algo is too much wrong on request, but this is development time (option to add, code maintenance...), time is money, and I don't want to spend my money on it for the moment, and nobody else is ready to spend his money (not his time for coding) on it, that's all.
SeeMoreDigital
21st September 2015, 21:13
Beside the case of concatanation of 2 stream with different frame rate, we have variable bitrate, so why not variable frame rate if global quality is improved with it?
Personally speaking I don't recommend the use of VFR because it's not supported by hardware playback devices ;)
XinHong
31st October 2015, 11:09
@Zenitram: Is it possible to detect if a TrueHD track contains the Atmos extension ?
Zenitram
31st October 2015, 11:14
@Zenitram: Is it possible to detect if a TrueHD track contains the Atmos extension ?
I have some Atmos files, but I did not have yet the time to implement the detection of Atmos. On the ToDo-list with low priority.
XinHong
31st October 2015, 11:15
Thanks for this ultra fast reply :)
LoRd_MuldeR
1st November 2015, 11:45
FWIW, I recently added "fresh" static builds of MediaInfo (CLI + GUI):
https://github.com/lordmulder/mediainfo-gui/releases/tag/v2.18
ndjamena
8th November 2015, 02:33
I can't get the source to compile in VS2012.
At first if complains that hmac.h is missing, so I found that file and added the directory to the include list, then it complains that "unresolved external symbol _hmac_sha | C:\Projects\MediaInfo\MediaInfoLib\Project\MSVC2012\Dll\MediaInfo.lib(Reader_libcurl.obj) | MediaInfoDll"
Anyway, I'm pretty sure all you'd have to do to fix part of the Matroska Tags issue is to, in file_mk.cpp, replace this line
if (Retrieve((stream_t)StreamKind, StreamPos, General_ID)==ID)
http://sourceforge.net/p/mediainfo/code/HEAD/tree/MediaInfoLib/trunk/Source/MediaInfo/Multiple/File_Mk.cpp#l2182
https://github.com/MediaArea/MediaInfoLib/blob/master/Source/MediaInfo/Multiple/File_Mk.cpp#L2181
with
if (Retrieve((stream_t)StreamKind, StreamPos, General_UniqueID)==ID)
Then, as and addition, replace this
if (Segment_Tag_SimpleTag_TagNames[0]==__T("BPS")) return; //Useless
http://sourceforge.net/p/mediainfo/code/HEAD/tree/MediaInfoLib/trunk/Source/MediaInfo/Multiple/File_Mk.cpp#l2147
https://github.com/MediaArea/MediaInfoLib/blob/master/Source/MediaInfo/Multiple/File_Mk.cpp#L2146
with this:
if (Segment_Tag_SimpleTag_TagNames[0]==__T("_STATISTICS_WRITING_APP")) return; //Useless
if (Segment_Tag_SimpleTag_TagNames[0]==__T("_STATISTICS_WRITING_DATE_UTC")) return; //Useless
if (Segment_Tag_SimpleTag_TagNames[0]==__T("_STATISTICS_TAGS")) return; //Useless
(It doesn't check to see if they're in the correct file, but it's better than what's happening now. I can't tell if all the tags have been read by that point or how to iterate through them and compare them to the headers.)
I can't compile it to check.
-edit-
This would be even better (I think)
if (Segment_Tag_SimpleTag_TagNames[0]==__T("BPS")) {Segment_Tag_SimpleTag_TagNames[0]=__T("*Bit rate"); TagString.append(__T(" bps"));}
if (Segment_Tag_SimpleTag_TagNames[0]==__T("DURATION")) {Segment_Tag_SimpleTag_TagNames[0]=__T("*Track duration/(HH:MM:SS.NNNNNNNNN");}
if (Segment_Tag_SimpleTag_TagNames[0]==__T("NUMBER_OF_FRAMES")) {Segment_Tag_SimpleTag_TagNames[0]=__T("*Track size/(Frames)");}
if (Segment_Tag_SimpleTag_TagNames[0]==__T("NUMBER_OF_BYTES")) {Segment_Tag_SimpleTag_TagNames[0]=__T("*Track size/(Bytes)");}
if (Segment_Tag_SimpleTag_TagNames[0]==__T("_STATISTICS_WRITING_APP")) return; //Useless
if (Segment_Tag_SimpleTag_TagNames[0]==__T("_STATISTICS_WRITING_DATE_UTC")) return; //Useless
if (Segment_Tag_SimpleTag_TagNames[0]==__T("_STATISTICS_TAGS")) return; //Useless
ndjamena
8th November 2015, 11:18
How's this:
https://github.com/MediaArea/MediaInfoLib/blob/master/Source/MediaInfo/Multiple/File_Mk.cpp#L385
//Tags
bool Tags_Verified=false;
Ztring TagsList=Retrieve(Temp->second.StreamKind, Temp->second.StreamPos, "Security Tags List", Info_Text);
if (!TagsList.empty())
{
Clear(Temp->second.StreamKind, Temp->second.StreamPos, "Security Tags List");
Ztring WritingApp=Retrieve(Temp->second.StreamKind, Temp->second.StreamPos, "Security Writing Application", Info_Text);
Ztring WritingDate=Retrieve(Temp->second.StreamKind, Temp->second.StreamPos, "Security Writing Date", Info_Text);
if ((!WritingApp.compare(Retrieve(Stream_General, 0, "Encoded_Application", Info_Text))) && (!WritingDate.compare(Retrieve(Stream_General, 0, "Encoded_Date", Info_Text))))
{ Fill(Temp->second.StreamKind, Temp->second.StreamPos, "*Statistics Tags Varified", "True"); Tags_Verified=true; }
else
Fill(Temp->second.StreamKind, Temp->second.StreamPos, "*Statistics Tags Varified", "False");
Clear(Temp->second.StreamKind, Temp->second.StreamPos, "Security Writing Application");
Clear(Temp->second.StreamKind, Temp->second.StreamPos, "Security Writing Date");
Ztring::iterator Back = TagsList.begin();
Ztring TempTag;
while (true)
{
if ((Back == TagsList.end()) || (*Back == ' ') || (*Back == '\0'))
{
if (TempTag == __T("BPS")) { TempTag = __T("Bit rate"); }
else if (TempTag == __T("DURATION")) { TempTag = __T("Track Duration/(HH:MM:SS.NNNNNNNNN)"); }
else if (TempTag == __T("NUMBER_OF_FRAMES")) { TempTag = __T("Track Size/(Frames)"); }
else if (TempTag == __T("NUMBER_OF_BYTES")) { TempTag = __T("Track Size/(Bytes)"); }
Ztring TagValue = Retrieve(Temp->second.StreamKind, Temp->second.StreamPos, TempTag.To_Local().c_str(), Info_Text);
if (!TagValue.empty())
{
Clear(Temp->second.StreamKind, Temp->second.StreamPos, TempTag.To_Local().c_str());
Fill(Temp->second.StreamKind, Temp->second.StreamPos, __T('*') + TempTag.To_Local().c_str(), TagValue.To_Local().c_str());
}
if (Back == TagsList.end()) break;
TempTag.clear();
}
else
TempTag+=*Back;
Back++;
}
}
https://github.com/MediaArea/MediaInfoLib/blob/master/Source/MediaInfo/Multiple/File_Mk.cpp#L2146
if (Segment_Tag_SimpleTag_TagNames[0]==__T("BPS")) {Segment_Tag_SimpleTag_TagNames[0]=__T("Bit rate"); TagString.append(__T(" bps"));}
if (Segment_Tag_SimpleTag_TagNames[0]==__T("DURATION")) {Segment_Tag_SimpleTag_TagNames[0]=__T("Track Duration/(HH:MM:SS.NNNNNNNNN)");}
if (Segment_Tag_SimpleTag_TagNames[0]==__T("NUMBER_OF_FRAMES")) {Segment_Tag_SimpleTag_TagNames[0]=__T("Track Size/(Frames)");}
if (Segment_Tag_SimpleTag_TagNames[0]==__T("NUMBER_OF_BYTES")) {Segment_Tag_SimpleTag_TagNames[0]=__T("Track Size/(Bytes)");}
if (Segment_Tag_SimpleTag_TagNames[0]==__T("_STATISTICS_WRITING_APP")) {Segment_Tag_SimpleTag_TagNames[0]=__T("Security Writing Application");}
if (Segment_Tag_SimpleTag_TagNames[0]==__T("_STATISTICS_WRITING_DATE_UTC")) {Segment_Tag_SimpleTag_TagNames[0]=__T("Security Writing Date"); TagString.insert(0, __T("UTC ")); }
if (Segment_Tag_SimpleTag_TagNames[0]==__T("_STATISTICS_TAGS")) {Segment_Tag_SimpleTag_TagNames[0]=__T("Security Tags List");}
ndjamena
8th November 2015, 15:17
I moved the tag processing up to the top of File_MK.cpp | File_Mk::Streams_Finish() so I could try to set the tag duration as a proper duration. I have no idea if the code will work though.
Ztring Duration_Temp, Codec_Temp;
if (Tags_Verified)
{
Duration_Temp = Retrieve(Temp->second.StreamKind, Temp->second.StreamPos, "*Track Duration/(HH:MM:SS.NNNNNNNNN)", Info_Text);
if (!Duration_Temp.empty())
{
Ztring::iterator Front = Duration_Temp.begin();
Ztring Parts [4];
int CountParts = 0;
while (true)
{
if (Front == Duration_Temp.end() || *Front == __T(':') || *Front == __T('.'))
{
CountParts++;
if (Front==Duration_Temp.end() || CountParts == 4) break;
}
else if (isdigit(*Front))
Parts[CountParts]+=*Front;
Front++;
}
if (CountParts == 4)
{
int64u Hours = Parts[0].To_int64u(10);
int64u Minutes = Parts[1].To_int64u(10);
int64u Seconds = Parts[2].To_int64u(10);
Parts[3] = Parts[3].substr(0, 3);
int64u Milliseconds = Parts[3].To_int64u(10);
Duration_Temp.From_Number((((Hours * 3600) + (Minutes * 60) + Seconds) * 1000) + Milliseconds, 10);
//Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_Duration), Duration_Temp, true);
//Clear(Temp->second.StreamKind, Temp->second.StreamPos, "*Track Duration/(HH:MM:SS.NNNNNNNNN)");
}
else Duration_Temp.clear();
}
}
if (Duration_Temp.empty())
Duration_Temp=Retrieve(StreamKind_Last, Temp->second.StreamPos, Fill_Parameter(StreamKind_Last, Generic_Duration)); //Duration from stream is sometimes false
I had to move the declaration of the tag verification Boolean outside of my if statement...
...
...
Am I missing a library somewhere or is hmac.h not actually supposed to be included?
I really want this tag business done with.
foxyshadis
8th November 2015, 21:38
How are you building it? Only the MSVC 2013 project is kept up to date, which has it in the MediaInfoLib project under ThirdParty/hmac, so it should always be built with the rest of the lib. Don't use the older projects unless you regenerate them from cmake first. The GNU project is also kept up to date if you use mingw/gcc.
Zenitram
8th November 2015, 22:49
I can't get the source to compile in VS2012.
I forgot to update it when I added HMAC support.
Fixed (https://github.com/MediaArea/MediaInfoLib/commit/954e2c6b08d8b2a10faccb64c78880675bdd9a6e)
I really want this tag business done with.
I take it, but copy/paste of code is not ideal (actually it is super difficult to understand the goal of the patch). Is it possible to fork, commit the code on your repo then do a pull request on GitHub? so we can discuss with the code directly and you can get comments directly on modified lines.
Zenitram
8th November 2015, 23:03
Only the MSVC 2013 project is kept up to date
This was not intentional.
But I definitely can not support indefinitely all MSVC versions, so I just trashed MSVC 2005 / 2008 / 2010 projects.
I plan to keep MSVC 2012 and 2013 projects, and also propose soon MSVC 2015 project.
LoRd_MuldeR
8th November 2015, 23:45
Actually all MSVC versions since VS2010 use the same Project file format. So you can just keep the VS2013 project up-to-date and still open it in VS2010/VS2012.
In my experience, VS2010 or VS2012 will complain that it doesn't support toolset "v120" when you open the VS2013 project, but you can easily fix that by changing the toolset to "v100" or "vs110" as needed. The rest usually works fine.
ndjamena
9th November 2015, 00:33
https://mediaarea.net/en/MediaInfo/Support/Build_From_Sources/ThirdParty/BCB/TntUnicodeControls
This link doesn't go anywhere...
ndjamena
9th November 2015, 04:39
Looky, a Matroska file with streams of different length!
General
Unique ID : 186503756937573924653882743356120778548 (0x8C4F512865F76243A09179B2D1FE4734)
Complete name : D:\Make\Test.mkv
Format : Matroska
Format version : Version 4 / Version 2
File size : 259 MiB
Duration : 22mn 49s
Overall bit rate : 1 584 Kbps
Encoded date : UTC 2015-11-09 03:36:45
Writing application : mkvmerge v8.5.1 ('Where you lead I will follow') 64bit
Writing library : libebml v1.3.3 + libmatroska v1.4.4
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L3
Format settings, CABAC : No
Format settings, ReFrames : 1 frame
Codec ID : V_MPEG4/ISO/AVC
Duration : 22mn 49s
Bit rate : 1 548 Kbps
Width : 628 pixels
Height : 474 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.217
Stream size : 253 MiB (98%)
Language : English
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.601 NTSC
Transfer characteristics : BT.709
Matrix coefficients : BT.601
*Statistics Tags Varified : True
*Track Duration/(HH:MM:SS.NNNNNNNNN) : 00:22:49.828000000
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : A_AAC
Duration : 5mn 2s
Bit rate : 152 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 5.49 MiB (2%)
Language : English
Default : Yes
Forced : No
*Statistics Tags Varified : True
*Track Duration/(HH:MM:SS.NNNNNNNNN) : 00:05:02.976000000
ndjamena
9th November 2015, 10:44
Bah! It's still showing 'unknown' for the DTS-MA bitrate. That must be hardcoded somewhere else!!!!!
Teebeeke
9th November 2015, 11:16
Hi,
am trying to use mediainfo to import file information, but i can't seem to get the right code for height and width of a moviefile.
these work fine:
Dim temp_FileName As String = MI.Get_(StreamKind.General, 0, "FileName")
Dim temp_FileSize As String = MI.Get_(StreamKind.General, 0, "FileSize")
Dim temp_FileOverallBitRate As Decimal = MI.Get_(StreamKind.General, 0, "OverallBitRate")
Dim temp_FileDuration As Integer = MI.Get_(StreamKind.General, 0, "Duration")
but here i kinda am lost when i want height / width
Dim temp_Filewidth1 As String = MI.Get_(StreamKind.General, 0, "Width_Original")
Dim temp_FileWidth2 As String = MI.Get_(StreamKind.Video, 0, "Width")
Dim temp_FileWidth3 As String = MI.Get_(StreamKind.Video, 1, "Width_Original")
Dim temp_FileWidth4 As String = MI.Get_(StreamKind.Video, 0, "Width/string")
Dim temp_FileWidth5 As String = MI.Get_(StreamKind.Video, 1, "Width/string")
i'm a bit confused, where am i going wrong? (hope someone can/will help)
file info:
General
UniqueID/String : 262114971647940602408317479032599003676 (0xC53181DCE616FD46A51C09EE1152C21C)
CompleteName : D:\testfile.hevc.x265.mkv
Format : Matroska
Format_Version : Version 4 / Version 2
FileSize/String : 262 MiB
Duration/String : 55mn 1s
OverallBitRate/String : 666 Kbps
Movie : Test File made for testing mediainfo import
Encoded_Application/String : Lavf56.40.101
Encoded_Library/String : Lavf56.40.101
DESCRIPTION : testfile
Video
ID/String : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format_Profile : Main@L3.1@Main
CodecID : V_MPEGH/ISO/HEVC
Width/String : 1 280 pixels
Height/String : 720 pixels
DisplayAspectRatio/String : 16:9
FrameRate_Mode/String : Variable
FrameRate_Original/String : 23.976 fps
ColorSpace : YUV
ChromaSubsampling : 4:2:0
BitDepth/String : 8 bits
Encoded_Library/String : x265 1.7+399-cbdefdfca877:[Linux][GCC 4.9.3][64 bit] 8bit
Encoded_Library_Settings : deleted (too big)
Default/String : Yes
Forced/String : No
DURATION : 00:55:01.736000000
Audio
ID/String : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format_Profile : LC
CodecID : A_AAC
Duration/String : 55mn 1s
Channel(s)/String : 2 channels
ChannelPositions : Front: L R
SamplingRate/String : 48.0 KHz
Compression_Mode/String : Lossy
Encoded_Library/String : Lavc56.57.100 aac
Default/String : Yes
Forced/String : No
DURATION : 00:55:01.749000000
Zenitram
9th November 2015, 11:27
but here i kinda am lost when i want height / width
You don't say why you are lost: no result or no knowledge of which field is good for you.
for 99% of people, MI.Get_(StreamKind.Video, 0, "Width") is the only one needed.
ndjamena
9th November 2015, 11:36
InString = MI.Get(Stream_Video, a, L"Width_Original", Info_Text);
if (InString.empty())
{
InString = MI.Get(Stream_Video, a, L"Width", Info_Text);
}
Teebeeke
9th November 2015, 11:45
using .net (VS2012)
When i use MI.Get_(StreamKind.Video, 0, "Width") it doesnt give me a result, it stays empty.
Zenitram
9th November 2015, 12:17
Bah! It's still showing 'unknown' for the DTS-MA bitrate. That must be hardcoded somewhere else!!!!!
It is also filled by the DTS parser, and I guess there is a conflict between parsers.
I don't have a file with DTS-HD and statistic tags, please provide one.
foxyshadis
10th November 2015, 06:48
using .net (VS2012)
When i use MI.Get_(StreamKind.Video, 0, "Width") it doesnt give me a result, it stays empty.
MediaInfo can parse the width out of mkv, but not raw HEVC. Your file name shows you running it against the raw, not the muxed file.
Edit: Actually, I take that back, it looks like MediaInfo should be able to run against raw HEVC too now. What file format is your test file being detected as?
Teebeeke
10th November 2015, 09:28
This is all the information i get:
Format : HEVC
Format/Info : High Efficiency Video Coding
Format/Url : http://www.itu.int
Commercial name : HEVC
Format profile : Main@L3.1
Internet media type : video/H265
Codec ID : V_MPEGH/ISO/HEVC
Codec : V_MPEGH/ISO/HEVC
Codec : V_MPEGH/ISO/HEVC
Codec profile : Main@L3.1
Open
Inform with Complete=true
General
Count : 285
Count of stream of this kind : 1
Kind of stream : General
Kind of stream : General
Stream identifier : 0
Unique ID : 262114971647940602408317479032599003676
Unique ID : 262114971647940602408317479032599003676 (0xC53181DCE616FD46A51C09EE1152C21C)
Count of video streams : 1
Count of audio streams : 1
Video_Format_List : HEVC
Video_Format_WithHint_List : HEVC
Codecs Video : V_MPEGH/ISO/HEVC
Video_Language_List : English
Audio_Format_List : AAC
Audio_Format_WithHint_List : AAC
Audio codecs : AAC LC
Complete name : D:\testfile.hevc.x265.mkv
Folder name : D:
File name : testfile.hevc.x265
File extension : mkv
Format : Matroska
Format : Matroska
Format/Url : http://packs.matroska.org/
Format/Extensions usually used : mkv mk3d mka mks
Commercial name : Matroska
Format version : Version 4 / Version 2
Codec : Matroska
Codec : Matroska
Codec/Url : http://packs.matroska.org/
Codec/Extensions usually used : mkv mk3d mka mks
File size : 274728718
File size : 262 MiB
File size : 262 MiB
File size : 262 MiB
File size : 262 MiB
File size : 262.0 MiB
Duration : 3301749
Duration : 55mn 1s
Duration : 55mn 1s 749ms
Duration : 55mn 1s
Duration : 00:55:01.749
Overall bit rate : 665656
Overall bit rate : 666 Kbps
Title : testfile.hevc.x265
Movie name : testfile.hevc.x265.mkv
File creation date : UTC 2015-11-09 08:53:25.743
File creation date (local) : 2015-11-09 09:53:25.743
File last modification date : UTC 2015-11-09 08:55:38.124
File last modification date (local) : 2015-11-09 09:55:38.124
Writing application : Lavf56.40.101
Writing library : Lavf56.40.101
Writing library : Lavf56.40.101
DESCRIPTION : Testfile
Video
Count : 278
Count of stream of this kind : 1
Kind of stream : Video
Kind of stream : Video
Stream identifier : 0
StreamOrder : 0
ID : 1
ID : 1
Unique ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format/Url : http://www.itu.int
Commercial name : HEVC
Format profile : Main@L3.1
Internet media type : video/H265
Codec ID : V_MPEGH/ISO/HEVC
Codec : V_MPEGH/ISO/HEVC
Codec : V_MPEGH/ISO/HEVC
Codec profile : Main@L3.1
Width : 1280
Width : 1 280 pixels
Height : 720
Height : 720 pixels
Pixel aspect ratio : 1.000
Display aspect ratio : 1.778
Display aspect ratio : 16:9
Frame rate mode : VFR
Frame rate mode : Variable
Original frame rate : 23.976
Original frame rate : 23.976 fps
Resolution : 8
Resolution : 8 bits
Colorimetry : 4:2:0
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8
Bit depth : 8 bits
Delay : 0
Delay : 00:00:00.000
Delay, origin : Container
Delay, origin : Container
Writing library : Lavc56.57.100 libx265
Writing library : Lavc56.57.100 libx265
Language : en
Language : English
Language : English
Language : en
Language : eng
Language : en
Default : Yes
Default : Yes
Forced : No
Forced : No
DURATION : 00:55:01.736000000
Audio
Count : 223
Count of stream of this kind : 1
Kind of stream : Audio
Kind of stream : Audio
Stream identifier : 0
StreamOrder : 1
ID : 2
ID : 2
Unique ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Commercial name : AAC
Format profile : LC
Format settings, SBR : No (Explicit)
Format settings, SBR : No (Explicit)
Codec ID : A_AAC
Codec : AAC LC
Codec : AAC LC
Codec/Family : AAC
Duration : 3301749
Duration : 55mn 1s
Duration : 55mn 1s 749ms
Duration : 55mn 1s
Duration : 00:55:01.749
Channel(s) : 2
Channel(s) : 2 channels
Channel positions : Front: L R
Channel positions : 2/0/0
ChannelLayout : L R
Sampling rate : 48000
Sampling rate : 48.0 KHz
Samples count : 158483952
Resolution : 32
Resolution : 32 bits
Compression mode : Lossy
Compression mode : Lossy
Delay : 0
Delay : 00:00:00.000
Delay, origin : Container
Delay, origin : Container
Delay relative to video : 0
Video0 delay : 0
Writing library : Lavc56.57.100 aac
Writing library : Lavc56.57.100 aac
Default : Yes
Default : Yes
Forced : No
Forced : No
DURATION : 00:55:01.749000000
SeeMoreDigital
10th November 2015, 16:41
This is all the information i get:
Video
Count of stream of this kind : 1
Kind of stream : Video
ID : 1
Unique ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format/Url : http://www.itu.int
Format profile : Main@L3.1
Internet media type : video/H265
Codec ID : V_MPEGH/ISO/HEVC
Codec profile : Main@L3.1
Width : 1 280 pixels
Height : 720 pixels
Pixel aspect ratio : 1.000
Display aspect ratio : 1.778
Display aspect ratio : 16:9
Frame rate mode : VFR
Frame rate mode : Variable
Original frame rate : 23.976 fps
Resolution : 8 bits
Colorimetry : 4:2:0
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
I wonder why the HEVC video stream has been encoded with a 'variable' frame rate
Zenitram
10th November 2015, 16:55
I wonder why the HEVC video stream has been encoded with a 'variable' frame rate
VFR/CFR detection in Matroska is sometimes buggy, I would not rely too much on it. having less false positives is on the ToDo-list.
Here, the frame rate is also filled in the HEVC bitstream, I would rely more on it.
Teebeeke
10th November 2015, 17:00
But does that explain why MI.Get_(StreamKind.Video, 0, "Width") gives me 0 results?
If i use:
MI.Option_("Complete")
To_Display += MI.Inform()
which gives above info, it shows the width, but if i use MI.Get it shows no value.
Zenitram
10th November 2015, 17:08
But does that explain why MI.Get_(StreamKind.Video, 0, "Width") gives me 0 results?
If i use:
MI.Option_("Complete")
To_Display += MI.Inform()
which gives above info, it shows the width, but if i use MI.Get it shows no value.
No, issue is somewhere else, and I can not explain it for the moment (without testing it myself, but I don't have time for the moment).
Kurtnoise
10th November 2015, 17:11
I would try :
Dim temp_FileWidth As String = MI.Get_(StreamKind.Video, 1, "Width/String")
Zenitram
10th November 2015, 17:22
I would try :
Dim temp_FileWidth As String = MI.Get_(StreamKind.Video, 1, "Width/String")
0 for the 1st stream. (0-based number).
and that does not change the issue with "Width" :(.
ndjamena
10th November 2015, 17:37
Is Width_Original empty?
foxyshadis
11th November 2015, 06:14
But does that explain why MI.Get_(StreamKind.Video, 0, "Width") gives me 0 results?
If i use:
MI.Option_("Complete")
To_Display += MI.Inform()
which gives above info, it shows the width, but if i use MI.Get it shows no value.
You have Option Explicit Off and On Error Resume Next in your project, don't you? In the default VB project, it's StreamKind.Visual, not StreamKind.Video (perhaps a typo, perhaps intentional); if you change it to StreamKind.Visual -- or change Visual to Video in MediaInfoDLL.vb -- it should just start working. You would have noticed it wasn't just width if you'd looked for any other video properties.
With Option Explicit Off, VB will just ignore any typos you make, which makes IntelliSense much less useful. Use the tools you have!
Teebeeke
11th November 2015, 09:29
Yes, i noticed it too last night when i was looking into mediainfo_dll.vb, and i added video in there myself, but that didnt work. When i tried visual it showed the correct value.
Option Explicit was On btw.
Kurtnoise
11th November 2015, 09:43
0 for the 1st stream. (0-based number).
and that does not change the issue with "Width" :(.
mmh, yes...I thought it was the ID but it's the Stream identifier actually that should be taken into account.
@Teebeeke : you should put a sample file somewhere just to check out on our side...
@ndjamena : I would suggest to put "*Statistics Tags Verified : Yes/No" into the General Part, not for each streams...it's confusing for me.
Zenitram
11th November 2015, 09:51
When i tried visual it showed the correct value.
Argh... Very bad thing, there is an incoherency in the API.
I changed "Visual" to "Video"
Fixed (https://github.com/MediaArea/MediaInfoLib/commit/277564258e2ff1a005f88deb44d97dd9e1c225f6), with support of legacy StreamKind.Visual (considered as deprecated).
Something I don't understand is that your code was not detected as buggy (no "StreamKind.Video") when you ran your program (compiler indicates an error on my side).
Zenitram
11th November 2015, 09:56
@ndjamena : I would suggest to put "*Statistics Tags Verified : Yes/No" into the General Part, not for each streams...it's confusing for me.
the statistics writing app is provided by track, so he needs to test per track and provides this piece of information per track.
foxyshadis
11th November 2015, 10:55
Argh... Very bad thing, there is an incoherency in the API.
I changed "Visual" to "Video"
Fixed (https://github.com/MediaArea/MediaInfoLib/commit/277564258e2ff1a005f88deb44d97dd9e1c225f6), with support of legacy StreamKind.Visual (considered as deprecated).
Something I don't understand is that your code was not detected as buggy (no "StreamKind.Video") when you ran your program (compiler indicates an error on my side).
Sounds like he added Video without realizing that adding a value instead of replacing an old one won't work. Messing with enums has to be done carefully....
Teebeeke
11th November 2015, 11:42
yes, that was initially my fault. Once i replaced visual with video it worked. I was going to post this morning, but you beat me to it.
ndjamena
11th November 2015, 11:43
@ndjamena : I would suggest to put "*Statistics Tags Verified : Yes/No" into the General Part, not for each streams...it's confusing for me.
I'd be quite happy to remove all trace of the tags from sight, but it's not my place to make executive decisions like that.
The purpose of the "*Statistics Tags Verified" field being visible is to allow any unknown tags that have been encountered to be listed and shown and shown to be, in fact, verified.
It's preliminary, apparently Jerome doesn't like the idea of adding asterisks to the beginnings of unknown statistics tags to identify them.
I've left everything on the table, things need to be worked out from here.
(Did you download my dll or did yo compile your own?)
Zenitram
11th November 2015, 11:47
I'd be quite happy to remove all trace of the tags from sight, but it's not my place to make executive decisions like that.
I updated code with info visible only if there is a difference between muxer app name/date and stats app name/date because it is a source of problem as ndjamena pointed out.
The purpose of the "*Statistics Tags Verified" field being visible is to allow any unknown tags that have been encountered to be listed and shown and shown to be, in fact, verified.
The current policy in MediaInfo is to extract data wherever it comes from, without showing the source. In the future I could add information about the source but this is a long term feature and it will not be visible by default.
I modified the patch accordigly.
73ChargerFan
11th November 2015, 21:18
I'm glad to see MediaInfo will recognize HDCD; now I can script a test for it and mark such albums in my collection. Thanks.
https://upload.wikimedia.org/wikipedia/en/thumb/4/4f/HDCD_logo.svg/148px-HDCD_logo.svg.png
salam2009
26th January 2016, 13:48
Hey guys,
Is it possible to open MediaInfo of any file using a keyboard shortcut instead of going through its context menu ??
Thanks for any tip!
Cheers,
Salaam
nekrovski
26th January 2016, 15:19
Hey guys,
Is it possible to open MediaInfo of any file using a keyboard shortcut instead of going through its context menu ??
Yes.
Just press Shift + F10 + M + Enter
salam2009
27th January 2016, 03:58
Yes.
Just press Shift + F10 + M + Enter
lol, the mouse would be much easier than that :D
I meant something like opening the properties by Alt+Enter, if it has its own.
Anyway, thanks for stopping by!
LoRd_MuldeR
28th January 2016, 00:05
Hi Zenitram,
I'm trying to build v0.7.82 from the "AllInclusive" source package, but I noticed that the solutions (VS2013 and VS2015) contain a missing project called "zlibstat" :confused:
There is only the project "zlib" included, but it is missing from the solution. Furthermore, "zlib" only has a project file for VS2013, not for VS2015.
Zenitram
28th January 2016, 07:43
I'm trying to build v0.7.82 from the "AllInclusive" source package, but I noticed that the solutions (VS2013 and VS2015) contain a missing project called "zlibstat" :confused:
There is only the project "zlib" included, but it is missing from the solution. Furthermore, "zlib" only has a project file for VS2013, not for VS2015.
Argh, the script uses an old version of zlib package.
I'll update it soon.
New zlib package with VS2015 project (in /contrib/vstudio/vc14) is at https://github.com/MediaArea/zlib
New "All Inclusive" Git repo is at https://github.com/MediaArea/MediaInfo-AllInOne
LoRd_MuldeR
28th January 2016, 21:25
Thanks, I have now cloned the "All Inclusive" Git repo. VS2013 solution now contains "zlibstat" project, but VS2012 still contains the missing "zlib". VS2015 solution doesn't seem to exist in Git at all.
However I now stumbled upon a new strange issue, with the "ZenLib" project:
If I change any properties of the "ZenLib" project, then those changes do not apply to the .cpp files contained in the "ZenLib" project! For example, if I change "Enable Enhanced Instruction Set" from "Streaming SIMD Extension" to "No Enhanced Instructions" in the project properties, then the "Enable Enhanced Instruction Set" for the individual .cpp files still remains at "Streaming SIMD Extension". Very dangerous, because that is easy to miss! The strange thing is, that the "Enable Enhanced Instruction Set" property for the .cpp files are not showing in bold, so Visual Studio seems to believe it is inheriting these settings from the project properties. But it is very wrong! How is that even possible? Any clue what's up? :confused:
There appears to be no such problem with the "MediaInfoCLI" and "MeidaInfoLib" projects, as far as I can tell. But I'll have to do some more checks...
_________________
Side note: The pre-processor definitions for MediaInfoLib's "Release/Win32" and "Release/x64" configurations differ as follows, is that intentional?
Win32: WIN32;NDEBUG;MEDIAINFO_DVDIF_ANALYZE_NO;MEDIAINFO_MPEGTS_DUPLICATE_NO;MEDIAINFO_TRACE_NOx;MEDIAINFO_LIBMMS_NO;MEDIAINFO_LIBCURL_DLL_RUNTIME;%(PreprocessorDefinitions)
x64: WIN32;NDEBUG;MEDIAINFO_ADVANCED2;%(PreprocessorDefinitions)
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.