Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
8th November 2015, 02:33 | #1461 | Link |
Registered User
Join Date: Sep 2012
Posts: 366
|
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 Code:
if (Retrieve((stream_t)StreamKind, StreamPos, General_ID)==ID) https://github.com/MediaArea/MediaIn...e_Mk.cpp#L2181 with Code:
if (Retrieve((stream_t)StreamKind, StreamPos, General_UniqueID)==ID) Code:
if (Segment_Tag_SimpleTag_TagNames[0]==__T("BPS")) return; //Useless https://github.com/MediaArea/MediaIn...e_Mk.cpp#L2146 with this: Code:
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) Code:
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 Last edited by ndjamena; 8th November 2015 at 03:43. |
8th November 2015, 11:18 | #1462 | Link |
Registered User
Join Date: Sep 2012
Posts: 366
|
How's this:
https://github.com/MediaArea/MediaIn...le_Mk.cpp#L385 Code:
//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++; } } Code:
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");} Last edited by ndjamena; 9th November 2015 at 04:30. |
8th November 2015, 15:17 | #1463 | Link |
Registered User
Join Date: Sep 2012
Posts: 366
|
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.
Code:
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 ... ... Am I missing a library somewhere or is hmac.h not actually supposed to be included? I really want this tag business done with. Last edited by ndjamena; 9th November 2015 at 06:56. |
8th November 2015, 21:38 | #1464 | Link |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
|
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.
|
8th November 2015, 22:49 | #1465 | Link |
Registered User
Join Date: Aug 2002
Location: France, Paris
Posts: 672
|
I forgot to update it when I added HMAC support.
Fixed 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.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo |
8th November 2015, 23:03 | #1466 | Link |
Registered User
Join Date: Aug 2002
Location: France, Paris
Posts: 672
|
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.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo |
8th November 2015, 23:45 | #1467 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
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.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 8th November 2015 at 23:47. |
9th November 2015, 04:39 | #1469 | Link |
Registered User
Join Date: Sep 2012
Posts: 366
|
Looky, a Matroska file with streams of different length!
Code:
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 Last edited by ndjamena; 9th November 2015 at 05:40. |
9th November 2015, 11:16 | #1471 | Link |
Registered User
Join Date: Jun 2005
Posts: 36
|
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: PHP Code:
|
9th November 2015, 11:27 | #1472 | Link |
Registered User
Join Date: Aug 2002
Location: France, Paris
Posts: 672
|
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.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo |
9th November 2015, 12:17 | #1475 | Link | |
Registered User
Join Date: Aug 2002
Location: France, Paris
Posts: 672
|
Quote:
I don't have a file with DTS-HD and statistic tags, please provide one.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo |
|
10th November 2015, 06:48 | #1476 | Link | |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
|
Quote:
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? Last edited by foxyshadis; 10th November 2015 at 06:51. |
|
10th November 2015, 09:28 | #1477 | Link |
Registered User
Join Date: Jun 2005
Posts: 36
|
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 PHP Code:
|
10th November 2015, 16:41 | #1478 | Link | |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
Quote:
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
|
|
10th November 2015, 16:55 | #1479 | Link | |
Registered User
Join Date: Aug 2002
Location: France, Paris
Posts: 672
|
Quote:
Here, the frame rate is also filled in the HEVC bitstream, I would rely more on it.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo |
|
10th November 2015, 17:00 | #1480 | Link |
Registered User
Join Date: Jun 2005
Posts: 36
|
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. |
|
|