I have an MP4 file hosted on a server that I don't know the metadata of - I only know the container format (MP4). I need to know the audio/video bitrate information, the used codec (i.e. H.264), and the audio bitrate. The video can also lack an audio stream, and in that case, some of that information would be unavailable.
Is there a way to make a, say, HttpClient
read and parse the file from the server at the same time, and when it fully reads the header, disconnect? The file may be large (~300mb), and I don't want to read it in its entirety if the only information I need is a couple bytes from the beginning.
I've thought of reading the stream returned by GetStreamAsync
and building header information as we go, and then calling Dispose
when enough information is gathered, but is there a library for this? I've looked at MP4's header specification, and it seems relatively complex. I don't want to reinvent the wheel, if a library that is capable of doing this.