-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds .NET Core 3.1 Console App project #1197
base: master
Are you sure you want to change the base?
Adds .NET Core 3.1 Console App project #1197
Conversation
…and .Open_Buffer_Init, as well as a .Open_Buffer_Init example for Azure Storage Blobs
Removed MemoryStream. Increased localByteBufferSize to 1MB after doing performance testing against azure for both single and mult-block blobs, with moov boxes at the begining and end of an mp4 file.
Thank you for your PR!
I'll test the PR when I finish urgent tasks I have for the moment. |
return; | ||
} | ||
|
||
if (ToDisplay == "Unable to load MediaInfo library") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have like to use more explicit .LoadLibrary() / .IsLoaded() here, but wanted to limit my changes to only demonstrating the Azure byte-range pattern.
I like the idea of supporting a number of examples using 'dotnet new '. In fact, I'd much prefer refactoring for a class library, and including the lib in any number of .net project types. A lib would also solve the problem of many instances of MediaInfoDll.cs copied in all the project folders (which do not match each other). |
No problem. Use 'dotnet new gitignore' to get the latest. |
MI.Open_Buffer_Init(contentLength, 0); | ||
|
||
// The parsing loop using a fixed memory buffer for reading and marshaling | ||
const int localByteBufferSize = 1 * 1024 * 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JeromeMartinez , this buffer seems too large for calls into LibMediaInfo. The .Inform call will return less data if the buffer size is too large. First it drops the audio tracks, then in the extreme of a 16MB buffer, it also drops the video track information (all that is left is the container info).
Do you know of some sort of max_size for the buffer passed to Open_Buffer_Continue ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using and MP4 with an ftyp, free, mdat, moof top-level box layout:
A 4KB buffer will provide the same JSON results as the compiled / released app, whereas a 5KB buffer will have inaccurate video StreamSize and inaccurate audio StreamSize and BitRate (versus the app or 4KB buffer).
The 5KB and 4KB have similar but different seek request patterns, with many matching byte offset requests. They both read their initial buffers, seek to the moof, (which is 6715 bytes) read it in two sequential reads, then seek back into the mdat and perform lots of reads.
A 6KB (and above) buffer will read the initial buffer, seek to the moof, read it and then we hit EOF. None of these larger buffer sizes will report the audio stream at all.
I also tried a 6715b (the moof size) and 6714b buffer, to test edge cases around the moof boxe size. These had the same behavior as 6KB and above.
Hi, I'm trying to interface with MIL also using .NET Core 3.1 in Linux (Debian) and I stumbled on this PR. I've attached an example with which this issue is reproducible: |
@DvdKhl What is the output of your program? Here (Fedora 31) It's work after changing all DllImport("MediaInfo") to DllImport("mediainfo")
|
I'm getting (even after changing it to "mediainfo"): |
Not sure if it is important but I build MediaInfo from https://mediaarea.net/download/binary/libmediainfo0/19.09/MediaInfo_DLL_19.09_GNU_FromSource.tar.xz then took the File at "...\MediaInfo_DLL_GNU_FromSource\MediaInfoLib\Project\GNU\Library.libs\libmediainfo.so" and placed it next to the C# dll. |
I got it to work with some help. |
Hey, quick update on this. So the partial parsing is at least two problems. First and easiest, some (new storage SDK) behavior has changed and I needed to pump the stream with a stream-reader -- easy fix, I'll get that up soon. |
Adds .NET Core 3.1 Console App project with examples for local .Open and .Open_Buffer_Init, as well as a .Open_Buffer_Init example for Azure Storage Blobs.
Uses the MediaInfoDll.cs from #1192