BreeeZe / rpos

Raspberry Pi Onvif Server
http://breeeze.github.io/rpos
MIT License
647 stars 147 forks source link

[RFC] Third RTSP-Server added: A wrapper to the GStreamer implementation. #49

Closed Schwaneberg closed 5 years ago

Schwaneberg commented 5 years ago

This implementation provides direct access to the hardware acceleration through the GStreamer plugin rpicamsrc.

I added a python script that reads the video stream settings from the v4l2ctl.json file and launches a gst-rtsp-server accordingly. The script simply monitors the settings file for changes and applies them automatically.

The script should be enhanced to handle changes of resolution, frame rate and video codec. However, these information is not provided by v4l2ctl.json. I think it would be best to implement a dedicated javascript counterpart similar to v4l2ctl.js, generating a matched settings file in json format. Unfortunately, I don't do javascript. Therefor, this PR can only be the start for a development, if the implementation of a third RTSP server option is welcome.

RogerHardiman commented 5 years ago

This is great. I will have a look at the changes.

RogerHardiman commented 5 years ago

There is a hard coded path to /rwdata in the launch script that needs to change.

The rest look fine from a walkthrough.

RogerHardiman commented 5 years ago

There is a hard coded path to /rwdata in the launch script that needs to change.

The rest look fine from a walkthrough.

RogerHardiman commented 5 years ago

Would it be possible to put together a README on the dependencies for this work.

Took me a while to search the internet for how to install gstreamer dependencies and then how to install python dependences like sudo apt-get install python-gst-1.0 python-gst0.10-rtsp

But I'm still stuck with File "./gst-rtsp-launch.py", line 45, in gi.require_version('GstRtspServer','1.0')

RogerHardiman commented 5 years ago

Update - I was using Raspbian Jessie. It did not have gir1.2-gst-rtsp-server-1.0 as a package. (I see I have it on a Raspbian Stretch Pi, but that has no camera)

So I am upgrading my developer Pis to Stretch and will try again

Schwaneberg commented 5 years ago

Great! I will write a README in add it to this PR within the next week. I will also remove the hard coded, absolute path.

RogerHardiman commented 5 years ago

Many thanks. I've got my Pi with the Pi Camera over on Stretch now but not had time to install RPOS on it.

I did have one suggestion. If you have time, could you include an option to use a fake video source.

videotestsrc is-live=1 ! x264enc speed-preset=ultrafast tune=zerolatency ! rtph264pay name=pay0 pt=96

That would allow us to run RPOS on systems that don't have a camera attached for testing purposes.

(It could be another PR in the future)

Thanks

Schwaneberg commented 5 years ago

Ok, I will also implement the test source. Are you planning to put further information (resolution, frame rate and video codec) into v4l2ctl.json or another json file?

RogerHardiman commented 5 years ago

I had been thinking about storing the contents of CameraSettingsBase (width, height, frame rate) somewhere. There was a question on the Issues list from January last year asking about where these were stored, but right now RPOS just defaults to 1280 and does not store user changes.

Probably the best place is to add them into v4l2ctl so all video related settings are in one place.

RogerHardiman commented 5 years ago

But for the gstreamer test source all I was thinking about was using the Width and Height parameter are pass in the Spawn() and maybe added a -F parameter for frame rate (to match the -F parameter that I could pass to v4l2rtspserver)

Schwaneberg commented 5 years ago

Please keep me updated on this. And please include a setting to activate the test source. I will work on the Python code accordingly.

Am Sa., 5. Jan. 2019, 09:16 hat Roger Hardiman notifications@github.com geschrieben:

I had been thinking about storing the contents of CameraSettingsBase (width, height, frame rate) somewhere. There was a question on the Issues list from January last year asking about where these were stored, but right now RPOS just defaults to 1280 and does not store user changes.

Probably the best place is to add them into v4l2ctl so all video related settings are in one place.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BreeeZe/rpos/pull/49#issuecomment-451637173, or mute the thread https://github.com/notifications/unsubscribe-auth/AhnpteTqEQ-6R9e0h_1TRbZm57ceDQSxks5vAF9cgaJpZM4ZRoWN .