Difference between revisions of "Video stream"

From Take-Air Wiki
Jump to navigation Jump to search
(Created page with "== Enable IMX219 camera over the microcoax cable ==")
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
The following instructions assume that the user is connected over SSH or use a terminal in a remote desktop.
 +
 
== Enable IMX219 camera over the microcoax cable ==
 
== Enable IMX219 camera over the microcoax cable ==
 +
'''In current release''', the IMX219 camera over microcoax is enabled by default and available as <code>/dev/video0</code>. It does not required to enable the overlay as described below.
 +
# List of available overlays for your board can be listed using:
 +
#: <code> sudo /opt/nvidia/jetson-io/config-by-hardware.py -l</code>
 +
#: It should return:
 +
#: <syntaxhighlight lang="bash">Header 1 [default]: Jetson Nano CSI Connector
 +
  Available hardware modules:
 +
  1. IMX219 Microcoax Connector
 +
</syntaxhighlight>
 +
# Enable the camera:
 +
#: <code>sudo /opt/nvidia/jetson-io/config-by-hardware.py -n "IMX219 Microcoax Connector"</code>
 +
# Reboot:
 +
#: <code>reboot</code>
 +
# After reboot and login again, look if IMX219 device was detected:
 +
#: <code>dmesg | grep imx219</code>
 +
 +
User who would like more of a guided way to enable the camera could use: <code> sudo /opt/nvidia/jetson-io/jetson-io.py</code>
 +
 +
== Gstreamer pipeline ==
 +
See https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/accelerated_gstreamer.html#wwpID0E0KR0HA for example GStreamer pipelines that can be used on the Jetson.
 +
 +
To send a RTP stream over the network from the Jetson:
 +
$ gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), format=NV12, width=1920, height=1080' ! nvv4l2h264enc insert-sps-pps=true ! h264parse ! rtph264pay pt=96 ! udpsink host=<<<DEST IP>>> port=8001 sync=false -e
 +
Here, replace <<<DEST IP>>> with the IP of the computer where you want to send the video stream to.
 +
 +
To choose a specific camera, use the <code>sensor-id</code> property of <code>nvarguscamerasrc</code>.
 +
To view all available properties:
 +
$ gst-inspect-1.0 nvarguscamerasrc
 +
This can of course be applied to any GStreamer element.
 +
 +
=== Host running Ubuntu 20.04 LTS ===
 +
To receive the stream (created using the pipeline given above on the Jetson):
 +
$ gst-launch-1.0 udpsrc port=8001 caps='application/x-rtp, encoding-name=(string)H264, payload=(int)96' ! rtph264depay ! queue ! h264parse ! avdec_h264 ! autovideosink -e
 +
 +
This will open a video window showing the stream.

Latest revision as of 15:05, 10 November 2021

The following instructions assume that the user is connected over SSH or use a terminal in a remote desktop.

Enable IMX219 camera over the microcoax cable

In current release, the IMX219 camera over microcoax is enabled by default and available as /dev/video0. It does not required to enable the overlay as described below.

  1. List of available overlays for your board can be listed using:
    sudo /opt/nvidia/jetson-io/config-by-hardware.py -l
    It should return:
    Header 1 [default]: Jetson Nano CSI Connector
      Available hardware modules:
      1. IMX219 Microcoax Connector
  2. Enable the camera:
    sudo /opt/nvidia/jetson-io/config-by-hardware.py -n "IMX219 Microcoax Connector"
  3. Reboot:
    reboot
  4. After reboot and login again, look if IMX219 device was detected:
    dmesg | grep imx219

User who would like more of a guided way to enable the camera could use: sudo /opt/nvidia/jetson-io/jetson-io.py

Gstreamer pipeline

See https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/accelerated_gstreamer.html#wwpID0E0KR0HA for example GStreamer pipelines that can be used on the Jetson.

To send a RTP stream over the network from the Jetson:

$ gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), format=NV12, width=1920, height=1080' ! nvv4l2h264enc insert-sps-pps=true ! h264parse ! rtph264pay pt=96 ! udpsink host=<<<DEST IP>>> port=8001 sync=false -e

Here, replace <<<DEST IP>>> with the IP of the computer where you want to send the video stream to.

To choose a specific camera, use the sensor-id property of nvarguscamerasrc. To view all available properties:

$ gst-inspect-1.0 nvarguscamerasrc

This can of course be applied to any GStreamer element.

Host running Ubuntu 20.04 LTS

To receive the stream (created using the pipeline given above on the Jetson):

$ gst-launch-1.0 udpsrc port=8001 caps='application/x-rtp, encoding-name=(string)H264, payload=(int)96' ! rtph264depay ! queue ! h264parse ! avdec_h264 ! autovideosink -e

This will open a video window showing the stream.