-
Notifications
You must be signed in to change notification settings - Fork 537
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
Custom GStreamer media source and renderer in libopenwebrtc-gst library #221
Comments
Sounds good to me. What special behaviour requirements do you have in mind for the sources/sinks? Shouldn't just any work that behaves like a normal GStreamer sink/source? |
I was thinking mostly of caps and what will be handled by owr / by the element/application. I haven't thought through the smaller details yet so it's more an idea. Maybe it will be quite generic and there won't really be requirements. :) |
Sounds good to me as well :) |
And i think that could also help to support compressed media source as well no ? |
Not much as that mostly requires changes inside the other parts of openwebrtc |
Yes, of course just that set/access to the caps of the src would help instead of trying to deduct them after. |
Your work is much appreciated, really fantastic!! |
It's not currently top priority. Perhaps @philn is interested in putting this together. It would be nice to do it so that the custom gst source/renderer classes basically just add a property to set the element on the appropriate context member. I think that context member already exists, but not totally sure. It should be a small amount of code changes at least. |
@hlevring feel free to test my branch and give some feedback :) |
This library contains three classes: - OwrGstAudioRenderer - OwrGstVideoRenderer - OwrGstMediaSource Applications can use these renderers and the source to enable the use of custom GStreamer source and sink elements in the OpenWebRTC pipeline. For instance, this is specially useful if your application needs to render video with a very specific (sometimes even internal to your project) sink. By default this sub-library is disabled. It can be enabled by using the --enable-owr-gst=yes configure option. See #221
All roads lead to #221. Am I correct in assuming that the precompiled libs don't have the support for the sub-library enabled? Hence I'm going to have to compile them myself for iOS etc? |
That is correct. |
Any particular reason this isn't enabled by default? |
Because we want to only require that people know the OpenWebRTC API by default rather than letting the GStreamer API seep through. Some standard use cases should be integrated into the core of OpenWebRTC such as being able to provide or retrieve compressed or uncompressed buffers in well-defined formats to do with whatever you like. Also, playing back from a file (I have made a branch for this but I think it still needs a bit of work on the API and internally) as well as recording to a file. Another interesting use case is the ability to replay pcap files. And then if you want to do something more advanced, you will need to build the extra library with the extra API for custom GStreamer sources and renderers. Perhaps we or someone will contribute everything needed to make binary releases of that additional library as a separate framework that depends on the OpenWebRTC framework and also adds the GStreamer API. |
That makes perfect sense. |
I think probably something like the OwrURISourceAgent ( #436 ) but an OwrRecordingAgent perhaps. It should use GStreamer's encodebin element internally, it could have a file path property for where to record to, some preset properties to configure what GstPresets for encodebin to use, some way to add / remove sources used for recording where one source maps to one output track. Something along those lines perhaps. |
I'll try the extension lib for now. My other alternative is Multipeer Connectivity and plain GST... |
How do I use --enable-owr-gst with cerbero? |
For now you can just hack it in for your platform(s) of interest. |
I figured as much, still looking for the right place in the config files... |
|
Hi, thanks I found this from a comment you made elsewhere already. Will give it a try. Thanks for your help! |
Just a further note: if you use --enable-owr-gst you also need to use --disable-owr-static. |
I think I know why we did that (static builds require listing all the symbols beforehand and we didn't want to have varying API depending on what was built.) But it will mean that it won't work on iOS. We will have to put together some guide or something for how to build OWR-gst for use on all platforms. |
Oh, that just put a spanner in the works for me... looks like I'll have to revert to multipeer connectivity and plain GST for now... |
It's not so much work to get it working. Just that the owr-gst symbols need to be added to the symbols list in libopenwebrtc.exp and that needs committing to say a local git branch. Then the openwebrtc.recipe needs modifying to point to that repository (change the origin remote to file:///Users/name/path/to/repo) and the commit to origin/branchname. And then rebuild for OS X and iOS I think. |
I'm not familiar with all of the details, let alone the api. I need to build a proof of concept and I am trying to future proof it by doing it with open standards... |
When you say symbols you are just referring to the functions defined in the headers being added to the list? Are there any other changes needed in cerbero apart from "--disable-owr-static --enable-owr-gst --disable-tests"? |
I think that should be sufficient. Do you still have issues? |
I've cloned the repo and am working on it. See the reference above. I'll let you know how I get on! Thanks! |
Finally managed to build everything. Not sure if it will work yet but I have a different issue now. How do I use cocoa pods to integrate my built framework? Or is it better to remove the cocoa pod dependency on openwebrtc and just link via Xcode directly? |
I modified everything like we discussed, built the frameworks and no owr_gst_*.h files to be seen anywhere in the output framework.... any ideas? Are there more settings I need to change apart from the build flags and also symbol catalog? Edit: |
I need to investigate this thoroughly. I think we should make a separate framework for the extra GStreamer-bits so that people who don't want that don't need to install it. |
@superdump that makes sense, but for now I think I'll just see how things work on iOS. It would be great to be able to use the owr_gst bits on the mac as well though... |
@superdump any ETA on this? |
Given the vast number of GStreamer audio/video source/sink elements, it is not feasible and does not seem sensible to require implementation of them all in OpenWebRTC, nor for people to maintain a fork of OpenWebRTC to do so for their element.
At the same time, it is not desirable to have to ship all GStreamer API in our releases for people who are not interested in it.
I propose that we implement custom OwrMediaSource and OwrMediaRenderer classes that have a property on them to set a GstElement. We should define how the element is expected to work (what caps are supported, what queries, events, meta etc are supposed to be handled) and build that into a libopenwebrtc-gst library. This library, when shipping, should then include GStreamer API alongside it in order to allow people to make use of it.
The text was updated successfully, but these errors were encountered: