shortstheory / APStreamline

Live Video Streaming Made Easy!
GNU General Public License v3.0
116 stars 35 forks source link

Pipeline config file #8

Closed kellyschrock closed 3 years ago

kellyschrock commented 4 years ago

Read gstreamer pipeline specifications from external config files (with a fallback to defaults) to make it easier to configure settings.

shortstheory commented 4 years ago

I love this idea. It's been a long-standing gripe of mine that it's hard to configure APStreamline with new camera pipelines without rebuilding the code. Ideally, I would like a solution that would make it possible to make APStreamline compatible with any type of GStreamer src without needing to recompile the code but that is not trivial to fix, as the auto-detection for the camera type needs to be hard-coded in. Maybe we could add a "Custom" mode which allows the user to specify the camera name and its corresponding pipeline in a config file? This can either be used a fallback if the auto-detect fails or it can override the pipeline we have curated for a particular camera type.

It's been a while since I've worked on this project so I'll need some time to brush myself up on the source again to see how this can be dropped in. Thank you for your interest in this project and I hope to make improvements soon!

kellyschrock commented 4 years ago

Awesome, well let me know if you want to merge this. I also have a need to specify a different default resolution for the camera, and have been thinking about a way to do that from a config file. Shouldn't be difficult, but I'll put that in a different PR to keep things organized. This project is a great fit for what I need. That is, a convenient thing I can put on a companion computer to provide access to camera hardware on the vehicle. I'm still fairly new to GStreamer.

shortstheory commented 4 years ago

Hmm. I am thinking one way of doing this could be to have a custom_pipeline JSON file where the camera path, the GStreamer pipeline, and supported resolutions/frame rates can be added. I could write a function to parse the JSON and turn it into a valid GStreamer pipeline for different camera types. What do you think?

I'm glad to hear that APStreamline fits what you're doing :-) We should make a new apsync image for it now that I think about it

kellyschrock commented 4 years ago

I like the sound of that idea. It's surely going to be the case that a custom pipeline needs to be specified somewhere, so this would probably a great thing to add.

shortstheory commented 4 years ago

So I have been giving it some thought. For a custom pipeline, what would be of greater priority for you - ease of setting up a new pipeline to work with APStreamline or having the adaptive video logic which APStreamline uses for a new pipeline? Implementing the latter to generically work for all cameras will not work without testing each and every one (because of various driver issues).

That said, your template idea looks good to me!

mtbsteve commented 4 years ago

If I may chime in here- I like the idea to add a "Custom" mode which allows the user to specify the camera name and its corresponding pipeline in a config file as you outlined above. If the camera detection logic needs to be hardcoded, then at least some documentation would help me to add the code for a new camera type.

Personally I am not a fan of image files. Is a PITA to reverse engineer the code if you want to adopt the functionality to a new OS version, combine it with features baked into other image files, or to simply run it on another platform. Keep the install as you have it now.

kellyschrock commented 4 years ago

I agree with Steve here, FWIW. I think the ability to set up a custom pipeline would be nice.

On Mon, Jan 20, 2020 at 3:47 PM mtbsteve notifications@github.com wrote:

If I may chime in here- I like the idea to add a "Custom" mode which allows the user to specify the camera name and its corresponding pipeline in a config file as you outlined above. If the camera detection logic needs to be hardcoded, then at least some documentation would help me to add the code for a new camera type.

Personally I am not a fan of image files. Is a PITA to reverse engineer the code if you want to adopt the functionality to a new OS version, combine it with features baked into other image files, or to simply run it on another platform. Keep the install as you have it now.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shortstheory/adaptive-streaming/pull/8?email_source=notifications&email_token=AA42DTPIXUEGOJCSELLBSJ3Q6YLYVA5CNFSM4KIOZW7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJN4LXY#issuecomment-576439775, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA42DTOJQRXDZSBCLDA7MEDQ6YLYVANCNFSM4KIOZW7A .

shortstheory commented 3 years ago

Hi @kellyschrock, I have been developing a new branch of APStreamline to do exactly this. The way it works now is that the camera details are specified in config files and then you need to subclass the Camera class to add specific support for your choice of camera. It doesn't currently work with the web server, but I am thinking of ironing it out over the next few weeks. This branch can be found here: https://github.com/shortstheory/adaptive-streaming/tree/refactor202005

shortstheory commented 3 years ago

Adding new cameras via config files (and minor changes in the codebase) is now added in APStreamline v2.0!

kellyschrock commented 3 years ago

Adding new cameras via config files (and minor changes in the codebase) is now added in APStreamline v2.0!

Awesome, thanks!