SuRGeoNix / Flyleaf

Media Player .NET Library for WinUI 3/ WPF/WinForms (based on FFmpeg/DirectX)
GNU Lesser General Public License v3.0
712 stars 100 forks source link

Feature: Datastream support #449

Closed coldays closed 5 months ago

coldays commented 6 months ago

Added support for demuxing data packets, copying the data from unmanaged to managed byte arrays and a new event for consuming the data packets which is invoked at the appropriate synced time

SuRGeoNix commented 6 months ago

@coldays This will take me some time to review as it is a large PR. You might want this also to include it in Audio Screamer (when having no video? maybe also in the remuxer?). I'm not familiar with data streams, it would help if you could give me few common usages of them.

(Btw, if you are interesting you can join me in the v4 which will be much cleaner/easier to extend features such as this one)

coldays commented 6 months ago

That is understandable. I'm not sure how common it is to have only Audio and Data, but I can add it to both! I can also add it to the remuxer. Some common usage of datastreams are sensors that contain information about the sensor itself like some drones. In these cases it is important that the metadata is synced up so the video and dataframe information match. Here is one example of how Parrot Anafi drones does metadata. Another example of data can be SMTPE KLV, which is used in broadcasting.

Sure, I'm interested in joining you in v4. Would you prefer adding this to that branch instead of master?

SuRGeoNix commented 6 months ago

Good to know, never actually used data streams, so just wondering. I mention audio/remuxer only if you think it will be useful. If that doesn't really make sense then let it for now and we can review it in v4. I'm going to merge this with master as v4 need more work and I didn't have much time lately. I've already wrote an FFmpeg.Autogen to be more related to Flyleaf and be able to change it easily (with macros support and much more features). Now I'm finishing the design for high level Packet/Frame One/Two way lists/queues/collections with monitor pulses (something like .NET's blocking collections). You will be able to chain every part of decoding(demux-decode)/process-filtering/encoding(encode-mux) process and customize it. I will create a branch when I will have a main design so you and others might help to implement it faster. It will be more general purpose media library rather than playback/decoding with more platforms/renderers/hardware decoders/filters support.

coldays commented 6 months ago

It might make sense to implement it for remuxer, but sounds like a good plan to wait until v4 for that. The v4 design sounds powerful, can't wait to see it!

coldays commented 6 months ago

Please tell me if there is anything I can do to help you with reviewing @SuRGeoNix

SuRGeoNix commented 6 months ago

@coldays I will review this in the weekend