<p>Im working on this project :</p>
<p><a href="https://www.hackster.io/jonmendenhall/jetson-nano-search-and-rescue-ai-uav-9ca547" rel="nofollow noreferrer">https://www.hackster.io/jonmendenhall/jetson-nano-search-and-rescue-ai-uav-9ca547</a></p>
<p>At  some point I will need to mount my camera (waveshare ; IMX219-77IR) on  top of the drone and I would like to use  Windows or Linux outside of nomachine (because the nano will be in  headless mode),to display what the camera sees  when the drone is flying. For this reason I'm trying to configure gstreamer with RTSP to start a streaming server on the Ubuntu 18.04 that  I have installed on the jetson nano. (Keep in consideration that I will attach to  the nano the “huawei e3372 4g” dongle to provide to the drone a mobile  connection,instead of a wi-fi connection and the encoder used may have an impact on the performance of the video streaming).</p>
<p>To achieve my goal this is the thread that I'm following :</p>
<p><a href="https://forums.developer.nvidia.com/t/vlc-playing-gstreamer-flow/51694/6" rel="nofollow noreferrer">https://forums.developer.nvidia.com/t/vlc-playing-gstreamer-flow/51694/6</a></p>
<blockquote>
<p>At some point DaneLLL says :</p>
<p>Please also try test-launch.c @
<a href="https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-launch.c" rel="nofollow noreferrer">https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-launch.c</a>
136</p>
<p>Target</p>
<p>sudo apt-get install libgstrtspserver-1.0 libgstreamer1.0-dev   gcc
test-launch.c -o test-launch $(pkg-config --cflags --libs
gstreamer-1.0 gstreamer-rtsp-server-1.0)   ./test-launch “videotestsrc
! omxh265enc ! rtph265pay name=pay0 pt=96”</p>
<p>Host   Open network stream rtsp://&lt;TARGET_IP_ADDRESS&gt;:8554/test via
VLC</p>
</blockquote>
<p>it didn't work,but I found the reason and I fixed it. All my steps were correct, except that I was using the latest version of the example, which uses the latest API. Since most  Jetson boards come with Gstreamer 1.16 pre-installed, I used that same version of the example:</p>
<p><a href="https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/blob/1.16/examples/test-launch.c" rel="nofollow noreferrer">https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/blob/1.16/examples/test-launch.c</a></p>
<p>now,doing :</p>
<pre><code>./test-launch &quot;videotestsrc ! omxh265enc ! rtph265pay name=pay0 pt=96&quot;
</code></pre>
<p>I got this output : <strong>stream ready at rtsp://127.0.0.1:8554/test</strong></p>
<p>at this point the problem is that I'm not able to connect to that address using VLC. I checked if the ports were open (I have opened them on the router side)</p>
<pre><code>     root@ziomario-desktop:~/Scrivania# lsof -i:8554
     
     COMMAND     PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
     test-laun 24401 root    4u  IPv4 521379      0t0  TCP *:8554 (LISTEN)
     
     root@ziomario-desktop:~/Scrivania# lsof -i:1935
     
     COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
     nginx   23301   root    6u  IPv4 505559      0t0  TCP *:1935 (LISTEN)
     nginx   23302 nobody    6u  IPv4 505559      0t0  TCP *:1935 (LISTEN)
</code></pre>
<p>In addition,I have installed ngnix with the following conf file :</p>
<pre><code>#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}

rtmp { 
    server { 
        listen 1935; 
        application live { 
            live on; 
            interleave on;
            hls on; 
            hls_nested on;
            hls_path /tmp/hls; 
            hls_fragment 15s;
            #hls_playlist_lenght 60;
            exec_pull /usr/bin/ffmpeg -i rtsp://192.168.1.3:8554/test -vcodec copy -acodec copy -f flv rtmp://192.168.1.3:1935/live/test; 
            #dash on;
            #dash_path /tmp/dash;   
            #dash_fragment 15s;  
       } 
    } 
} 

http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] &quot;$request&quot; '
    #                  '$status $body_bytes_sent &quot;$http_referer&quot; '
    #                  '&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }   
    types {
        application/vnd.apple.mpegurl m3u8;
        video/mp2t ts;
        text/html html;
    } 
        
    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}
</code></pre>
<p>But VLC still doesn't want to connect to :</p>
<blockquote>
<p>rtsp://127.0.0.1:8554/test</p>
<p>rtmp://127.0.0.1:1935/live/test</p>
<p>and :</p>
<p>rtsp://192.168.1.3:8554/test</p>
<p>rtmp://192.168.1.3:1935/live/test</p>
</blockquote>
<p>after a further investigation, I found that :</p>
<pre><code>root@ziomario-desktop:~/Scrivania#  /usr/bin/ffmpeg -i rtsp://192.168.1.3:8554/test -vcodec copy -acodec copy -f flv rtmp://192.168.1.3:1935/live/test

[flv @ 0x557dfbdd80] Video codec hevc not compatible with flv
Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented
</code></pre>
<p>so,could this be the reason ? how to fix that ? thanks.</p>

CC BY-SA 4.0
2021-01-11T04:48:43.150Z
Output h264 from gstreamer
Gyan
CC BY-SA 4.0
2021-01-12T17:01:59.443Z
thanks. I'm trying to make it work here : https://forums.developer.nvidia.com/t/about-to-start-a-streaming-server-with-rtsp-and-gstreamer-on-ubuntu-18-04-on-the-jetson-nano/165564/6 ; at the moment it does not.
Marietto
<video><ffmpeg><streaming><codec><compression>
Streamable Container for gstreamer with ngnix / RTSP on jetson nano
Marietto
# Streamable Container for gstreamer with ngnix / RTSP on jetson nano

(Asked by: username_0 on 2021-01-10)

Im working on this project :
https://www.hackster.io/jonmendenhall/jetson-nano-search-and-rescue-ai-uav-9ca547
At  some point I will need to mount my camera (waveshare ; IMX219-77IR) on  top of the drone and I would like to use  Windows or Linux outside of nomachine (because the nano will be in  headless mode),to display what the camera sees  when the drone is flying. For this reason I'm trying to configure gstreamer with RTSP to start a streaming server on the Ubuntu 18.04 that  I have installed on the jetson nano. (Keep in consideration that I will attach to  the nano the “huawei e3372 4g” dongle to provide to the drone a mobile  connection,instead of a wi-fi connection and the encoder used may have an impact on the performance of the video streaming).
To achieve my goal this is the thread that I'm following :
https://forums.developer.nvidia.com/t/vlc-playing-gstreamer-flow/51694/6

At some point DaneLLL says :
Please also try test-launch.c @
https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-launch.c
136
Target
sudo apt-get install libgstrtspserver-1.0 libgstreamer1.0-dev   gcc
test-launch.c -o test-launch $(pkg-config --cflags --libs
gstreamer-1.0 gstreamer-rtsp-server-1.0)   ./test-launch “videotestsrc
! omxh265enc ! rtph265pay name=pay0 pt=96”
Host   Open network stream rtsp://:8554/test via
VLC

it didn't work,but I found the reason and I fixed it. All my steps were correct, except that I was using the latest version of the example, which uses the latest API. Since most  Jetson boards come with Gstreamer 1.16 pre-installed, I used that same version of the example:
https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/blob/1.16/examples/test-launch.c
now,doing :
./test-launch "videotestsrc ! omxh265enc ! rtph265pay name=pay0 pt=96"

I got this output : stream ready at rtsp://127.0.0.1:8554/test
at this point the problem is that I'm not able to connect to that address using VLC. I checked if the ports were open (I have opened them on the router side)
     root@ziomario-desktop:~/Scrivania# lsof -i:8554
     
     COMMAND     PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
     test-laun 24401 root    4u  IPv4 521379      0t0  TCP *:8554 (LISTEN)
     
     root@ziomario-desktop:~/Scrivania# lsof -i:1935
     
     COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
     nginx   23301   root    6u  IPv4 505559      0t0  TCP *:1935 (LISTEN)
     nginx   23302 nobody    6u  IPv4 505559      0t0  TCP *:1935 (LISTEN)

In addition,I have installed ngnix with the following conf file :
#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}

rtmp { 
    server { 
        listen 1935; 
        application live { 
            live on; 
            interleave on;
            hls on; 
            hls_nested on;
            hls_path /tmp/hls; 
            hls_fragment 15s;
            #hls_playlist_lenght 60;
            exec_pull /usr/bin/ffmpeg -i rtsp://192.168.1.3:8554/test -vcodec copy -acodec copy -f flv rtmp://192.168.1.3:1935/live/test; 
            #dash on;
            #dash_path /tmp/dash;   
            #dash_fragment 15s;  
       } 
    } 
} 

http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }   
    types {
        application/vnd.apple.mpegurl m3u8;
        video/mp2t ts;
        text/html html;
    } 
        
    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

But VLC still doesn't want to connect to :

rtsp://127.0.0.1:8554/test
rtmp://127.0.0.1:1935/live/test
and :
rtsp://192.168.1.3:8554/test
rtmp://192.168.1.3:1935/live/test

after a further investigation, I found that :
root@ziomario-desktop:~/Scrivania#  /usr/bin/ffmpeg -i rtsp://192.168.1.3:8554/test -vcodec copy -acodec copy -f flv rtmp://192.168.1.3:1935/live/test

[flv @ 0x557dfbdd80] Video codec hevc not compatible with flv
Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented

so,could this be the reason ? how to fix that ? thanks.

**Tags:** video, ffmpeg, streaming, codec, compression

> **Comments:**
> **username_1**: Output h264 from gstreamer  
> **username_0**: thanks. I'm trying to make it work here : https://forums.developer.nvidia.com/t/about-to-start-a-streaming-server-with-rtsp-and-gstreamer-on-ubuntu-18-04-on-the-jetson-nano/165564/6 ; at the moment it does not.  

---

## 0 answers

