Metropolis Microservices/RidgeRun Services/PTZ: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 36: Line 36:
Before running the service, you should make sure you have all the dependencies installed. The intructions 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]
Before running the service, you should make sure you have all the dependencies installed. The intructions 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]


Then you have to clone into your device the repository project, available [https://gitlab.ridgerun.com/ridgerun/rnd/jetson-microservices-and-genai/ptz here]
{{Review|Add link to other dependencies as rtsp-sink?|mortigoza}}
 
Then you have to clone into your device the repository project, available [/ptz here]
 
{{Review|Add link to the repository|mortigoza}}


The project is configured (via setup.py) to install the service with the name '''ptz'''. So to install it run:
The project is configured (via setup.py) to install the service with the name '''ptz'''. So to install it run:
Line 47: Line 51:


<pre>
<pre>
usage: ptz [-h] [--port PORT] [--host HOST]
usage: ptz [-h] [--port PORT] [--host HOST] [--ptz-window-size PTZ_WINDOW_SIZE]


options:
options:
-h, --help   show this help message and exit
  -h, --help           show this help message and exit
--port PORT Port for server
  --port PORT           Port for server
--host HOST Server ip address
  --host HOST           Server ip address
  --ptz-window-size PTZ_WINDOW_SIZE
                        Size of the PTZ output window in pixels. The final resolution will be (Size x Size)
</pre>
</pre>


Line 71: Line 77:




===Build the container===
=====Build the container=====


We can build the ptz microservice container using the Dockerfile in the docker directory. This includes a base NVIDA image and the dependencies to run the ptz microservice application.
We can build the ptz microservice container using the Dockerfile in the docker directory. This includes a base NVIDA image and the dependencies to run the ptz microservice application.
Line 101: Line 107:
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 112: Line 119:
You can modify the name you want to give to your container with the option '''--name'''.
You can modify the name you want to give to your container with the option '''--name'''.


Here we are creating a container called '''ptz-service''' that will start the ptz-service application in the default address and path. If a different address and port have to be used, you can do it by running:
Here we are creating a container called __ptz-service__ that will start the ptz-service application in the default address and port and using the default output resolution. If a different address, port, or output resolution has to be used, you can do it by running:


<pre>
<pre>
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 --ptz-window-size=PTZ_WINDOW_SIZE
</pre>
</pre>


89

edits