89
edits
Efernandez (talk | contribs) |
No edit summary |
||
Line 4: | Line 4: | ||
PTZ Microservice is a microservice developed by RidgeRun. It allows you to navigate a '''360- | PTZ Microservice is a microservice developed by RidgeRun. It allows you to navigate a '''360-degree''' video through pan, tilt, and zoom (PTZ). | ||
This microservice leverages the RidgeRun [[ Spherical Video PTZ | Spherical Video PTZ ]] to make possible the selection of your region of interest within the sphere. | This microservice leverages the RidgeRun [[ Spherical Video PTZ | Spherical Video PTZ ]] to make possible the selection of your region of interest within the sphere. | ||
Line 39: | Line 39: | ||
==Running the service== | ==Running the service== | ||
PTZ Microservice can run as a standalone application or as docker image. The docker approach has some benefits, for example: since the application is encapsulated along with its dependencies, | PTZ Microservice can run as a standalone application or as a docker image. The docker approach has some benefits, for example: since the application is encapsulated along with its dependencies, fewer conflicts arise in the deployment. | ||
===As a docker image=== | ===As a docker image=== | ||
Before starting with docker support make sure you have | 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 running in your Jetson Board. | ||
====Use prebuild image ==== | ====Use prebuild image ==== | ||
Line 56: | Line 56: | ||
====Build your | ====Build your image (Dockerfile)==== | ||
If you instead want to build your | If you instead want to build your image, a convenient Dockerfile is included as part of the service. | ||
{{Review|Add link to the repository|mortigoza}} | {{Review|Add link to the repository|mortigoza}} | ||
First, we need to prepare the context directory for this build, please create a directory and include all the | First, we need to prepare the context directory for this build, please create a directory and include all the necessary repositories (listed below). The Dockerfile will look for all the source code in the context directory and copy them to the container. | ||
<pre> | <pre> | ||
Line 89: | Line 89: | ||
====Launch the container==== | ====Launch the container==== | ||
Either | Either you pulled the prebuilt image or you built your own, a docker container can be launched by running the following command: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
Line 105: | Line 105: | ||
===As a standalone application=== | ===As a standalone application=== | ||
The service can also be run directly into | The service can also be run directly into your jetson device. | ||
Before running the service, you should make sure you have all the dependencies installed. The instructions to do it can be found here: [https://developer.ridgerun.com/wiki/index.php/Spherical_Video_PTZ/User_Guide/Building_and_Installation Spherical Video PTZ Building and Installation] and: [https://developer.ridgerun.com/wiki/index.php/GstRtspSink_-_Building_the_plug-in GstRtspSink plugin] | Before running the service, you should make sure you have all the dependencies installed. The instructions to do it can be found here: [https://developer.ridgerun.com/wiki/index.php/Spherical_Video_PTZ/User_Guide/Building_and_Installation Spherical Video PTZ Building and Installation] and: [https://developer.ridgerun.com/wiki/index.php/GstRtspSink_-_Building_the_plug-in GstRtspSink plugin] | ||
Line 140: | Line 140: | ||
#Get an RTSP stream as the input. | #Get an RTSP stream as the input. | ||
#Performs the PTZ in the stream, depending on the user instructions. | #Performs the PTZ in the stream, depending on the user's instructions. | ||
#Returns the stream transformed using the same protocol, RTSP, as the output. | #Returns the stream transformed using the same protocol, RTSP, as the output. | ||
Line 151: | Line 151: | ||
In the example above we assume the following: | In the example above we assume the following: | ||
* | * A 360-degree RTSP Stream is being played in the URI: rtsp://192.168.100.20:4000/sream_in, | ||
* The PTZ microservice is | * The PTZ microservice is running in: (IP) host=192.168.100.15, port=7000 | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
Line 162: | Line 162: | ||
# Create client (by default will talk to address 127.0.0.1 and port 5020) | # Create client (by default will talk to address 127.0.0.1 and port 5020) | ||
# Change host and port for the IP address and port of the service. | # Change the host and port for the IP address and port of the service. | ||
client = PTZ(host=192.168.100.15, port=7000 | client = PTZ(host=192.168.100.15, port=7000 | ||
Line 206: | Line 206: | ||
First we have to import the required models and modules: | First, we have to import the required models and modules: | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
Line 231: | Line 231: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* in_uri is the URI where the PTZ Microservice | * in_uri is the URI where the PTZ Microservice will be "listening" to get the incoming RTSP stream. | ||
* out_port is the port where the PTZ Microservice is going to locate its output (RTSP stream transformed with the PTZ specified), in this case, port 8000 | * out_port is the port where the PTZ Microservice is going to locate its output (RTSP stream transformed with the PTZ specified), in this case, port 8000 | ||
* out_mapping is the mapping where the PTZ Microservice is going to locate its output (RTSP stream transformed with the PTZ specified), in this case, /stream_out | * out_mapping is the mapping where the PTZ Microservice is going to locate its output (RTSP stream transformed with the PTZ specified), in this case, /stream_out | ||
Line 245: | Line 245: | ||
Using the same logic as in the stream. We can send requests to update pan, tilt and zoom, using these commands: | Using the same logic as in the stream. We can send requests to update pan, tilt, and zoom, using these commands: | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
# Perform PTZ | # Perform PTZ |
edits