Jump to content

Metropolis Microservices/RidgeRun Services/PTZ: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 39: Line 39:


==PTZ Microservice Docker==
==PTZ Microservice Docker==
*****dockerhub?


Before starting with docker support make sure you have nvidia runtime in your system. Follow [https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#configuration | these instructions] to have docker up and runing in your Jetson Board.
Before starting with docker support make sure you have nvidia runtime in your system. Follow [https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#configuration | these instructions] to have docker up and runing in your Jetson Board.
Line 70: Line 72:
Change '''ptz-context''' to your context's path and the tag (-t) to the name you want to give to your image.
Change '''ptz-context''' to your context's path and the tag (-t) to the name you want to give to your image.


====Launch the container====
===Launch the container===


The container can be launched by running the following command:
The container can be launched by running the following command:
Line 86: Line 88:
sudo docker run --runtime nvidia -it --privileged --net=host --ipc=host --name ptz-service  ridgerun/ptz-service:latest --host=HOST --port=PORT
sudo docker run --runtime nvidia -it --privileged --net=host --ipc=host --name ptz-service  ridgerun/ptz-service:latest --host=HOST --port=PORT
</pre>
</pre>
<noinclude>
{{Metropolis Microservices/Foot||}}
</noinclude>
==Examples==
Once you have a ptz-microservices-docker running you can run and test its functionality:
====Run the ptz microservice====
<pre>
ptz --host=192.168.100.15 –port=5010
</pre>
====Create an stream RTSP source using this pipeline:====
<pre>
gst-launch-1.0 videotestsrc pattern=0 ! video/x-raw,width=640,height=480 ! queue ! videoconvert ! queue ! videoscale ! video/x-raw,width=1920,height=1080,format=I420 ! queue ! x264enc key-int-max=30 option-string="keyint=30:min-keyint=30:repeat-headers=1" bitrate=10000 ! video/x-h264, mapping=/stream_in ! perf ! rtspsink service=7000  -v
</pre>
(you can modify th IPs, ports, and mapping depending on your needs. Just make sure you configure the other pipelines to match them)
====Set and update the desired ptz values via the API following the format specified in [https://gitlab.ridgerun.com/ridgerun/rnd/jetson-microservices-and-genai/apis/-/blob/develop/ptz/openapi.yaml?ref_type=heads | here]:====
Set the input URI, the output port, and the output mapping (in this example we assume that the RTSP source is being played from the same IP as the ptz microservice):
<pre>
curl -X PUT -H "Content-Type: application/json" -d '{"in_uri": "rtsp://192.168.100.15:7000/stream_in","out_port": "8000","out_mapping": "/stream_out"}' http://192.168.100.15:5010/stream
</pre>
(you can modify th IPs, ports, and mapping depending on your needs. Just make sure you configure the other pipelines to match them)
Using the client ****
====Receive the output result via RTSP using this pipeline:====
<pre>
gst-launch-1.0 rtspsrc location=rtsp://192.168.100.15:8000/stream_out ! queue ! decodebin ! queue ! videoconvert ! autovideosink -v
</pre>
(you can modify th IPs, ports, and mapping depending on your needs. Just make sure you configure the other pipelines to match them)


<noinclude>
<noinclude>
{{Metropolis Microservices/Foot||}}
{{Metropolis Microservices/Foot||}}
</noinclude>
</noinclude>
89

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.