Making a 720p live video monitoring

I want to make a 720p live video monitoring,but I don’t know how to do it ,can anyone help me ? or give some information for it ?

Hi ayang05,
To be specific for 720p live monitoring, do you mean streaming 720p video from tk1 to other devices(such as PC)?

Hi DaneLLL,
Yes,i want to take it to PC.

Hi ayang05,
Please refer to the case of running gstreamer rtspserver at
https://devtalk.nvidia.com/default/topic/930547

By running rtspserver on tk1, you can get the video stream via vlc on PC.

Hi ayang05,
Please refer to the following steps to run gstrtspserver-1.8.1

  1. Get gstreamer-1.8.0.tar.xz, gst-plugins-base-1.8.0.tar.xz, gst-rtsp-server-1.8.1.tar.xz from
    https://gstreamer.freedesktop.org/src/
  2. install the three packages on tk1

sudo tar xpf gstreamer-1.8.0.tar.xz

cd gstreamer-1.8.0

./configure --libdir=/usr/lib/arm-linux-gnueabihf/

make

sudo make install

(same steps to gst-plugins-base-1.8.0.tar.xz, gst-rtsp-server-1.8.1.tar.xz)
3. run the test app

cd gst-rtsp-server-1.8.1/examples

./test-launch “videotestsrc ! omxh264enc ! rtph264pay name=pay0 pt=96”

  1. On PC, open vlc and run ‘rtsp://<IP_ADDRRESS>:8554/test’

By replacing videotestsrc to your 720p source, you should get your case working fine.

Hi DaneLLL!
Thank you for your guidance.

Hi DaneLL,

I’ve tried following the instructions you’ve posted on this topic however am not able to get the system running.

My first step was, as per your instruction, replace ‘videotestsrc’ with a test file (an .mp4 file) and, upon making a VLC connection receive the following message:

ubuntu@tegra-ubuntu:~/gst-rtsp-server-1.8.1/examples$ ./test-launch “testvid2.mp4 ! omxh264enc ! rtph264pay name=pay0 pt=96”
stream ready at rtsp://127.0.0.1:8554/test

** (lt-test-launch:3378): CRITICAL **: could not parse launch syntax (testvid2.mp4 ! omxh264enc ! rtph264pay name=pay0 pt=96): no element “omxh264enc”

** (lt-test-launch:3378): CRITICAL **: could not create element

I also thought to try using ‘videotestsrc’ as an input, as some of the examples seemed to list it as an input and I thought it may be an actual test source. After running the command, I received the below response (after attempting a VLC connection):

ubuntu@tegra-ubuntu:~/gst-rtsp-server-1.8.1/examples$ ./test-launch “videotestsrc ! omxh264enc ! rtph264pay name=pay0 pt=96”
stream ready at rtsp://127.0.0.1:8554/test

(lt-test-launch:3835): GLib-GObject-WARNING **: invalid cast from ‘GstVideoTestSrc’ to ‘GstBin’

(lt-test-launch:3835): GStreamer-CRITICAL **: gst_bin_get_by_name: assertion ‘GST_IS_BIN (bin)’ failed

(lt-test-launch:3835): GLib-GObject-WARNING **: invalid cast from ‘GstVideoTestSrc’ to ‘GstBin’

(lt-test-launch:3835): GStreamer-CRITICAL **: gst_bin_get_by_name: assertion ‘GST_IS_BIN (bin)’ failed

(lt-test-launch:3835): GLib-GObject-WARNING **: invalid cast from ‘GstVideoTestSrc’ to ‘GstBin’

(lt-test-launch:3835): GStreamer-CRITICAL **: gst_bin_get_by_name: assertion ‘GST_IS_BIN (bin)’ failed

** (lt-test-launch:3835): WARNING **: failed to create element ‘rtpbin’, check your installation

In both cases, VLC quit immediately with a ‘Failed to connect’ error.

Would you happen to know what the cause of this is? Am I using the wrong input type? My ultimate aim is to pipe an output window from openCV through the RTSP feed. I thought I’d start small with your demo code and build from there.

Thanks in advance!

Hi Guys,

So I think I may have made some progress…based on the error code generated when using ‘videotestsrc’, I was able to determine that I was missing some plugins (hence the rtpbin error below):

** (lt-test-launch:3835): WARNING **: failed to create element ‘rtpbin’, check your installation

Since adding the ‘gst-plugins-good-1.8.0’ tar, I no longer have any error reports generated on my server end, however I no longer appear to get any connection from the client at all!

On the client side, I get the error:
live555 demux error: Failed to connect with rtsp://127.0.0.1:8554/test
core input error: open of ‘rtsp://127.0.0.1:8554/test’ failed

I have performed some network tests and it appears the IP address is working, and that is where I am stuck.

I don’t know if it makes any difference, but I am trying to connect to the rtsp server on the server itself.

Any ideas?

Hi hansk1990,
Have you connected to ‘rtsp://<IP_ADDRRESS>:8554/test’? The IP should not be 127.0.0.1. Please check the IP via ‘ifconfig’.

Hi DaneLLL,

I have tried with the devices IP address as well and still am getting the same result. I’ve posted my input string, as well as the VLC error report.

Gstreamer Input 1:
./test-launch “videotestsrc ! omxh264enc ! rtph264pay name=pay0 pt=96”

Gstreamer Input 2:
./test-launch “filesrc location testVid2.mp4 ! omxh264enc ! rtph264pay name=pay0 pt=96”

In both cases, the terminal shows:
stream ready at 127.0.0.1:8554/test

The following error report generated from VLC was from the input 2 (so trying to stream an MP4 file) and using the devices IP address, 192.168.1.100:

core debug: processing request item: rtsp://192.168.1.100:8554/test, node: Playlist, skip: 0
core debug: resyncing on rtsp://192.168.1.100:8554/test
core debug: rtsp://192.168.1.100:8554/test is at 0
core debug: starting playback of the new playlist item
core debug: resyncing on rtsp://192.168.1.100:8554/test
core debug: rtsp://192.168.1.100:8554/test is at 0
core debug: creating new input thread
core debug: Creating an input for ‘rtsp://192.168.1.100:8554/test’
core debug: requesting art for rtsp://192.168.1.100:8554/test
core debug: looking for meta fetcher module matching “any”: 1 candidates
core debug: using timeshift granularity of 50 MiB, in path ‘/tmp’
core debug: rtsp://192.168.1.100:8554/test' gives access rtsp’ demux ' path 192.168.1.100:8554/test’
core debug: specified demux any' core debug: creating demux: access='rtsp' demux='any' location='192.168.1.100:8554/test' file='(null)' core debug: looking for access_demux module matching "rtsp": 20 candidates live555 debug: version 2016.02.09 qt4 debug: IM: Setting an input lua debug: Trying Lua scripts in /home/ubuntu/.local/share/vlc/lua/meta/fetcher lua debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/fetcher lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/fetcher/tvrage.luac live555 debug: we will now try HTTP tunneling mode live555 debug: connection error -115 live555 error: Failed to connect with rtsp://192.168.1.100:8554/test core debug: no access_demux modules matched core debug: creating access 'rtsp' location='192.168.1.100:8554/test', path='(null)' core debug: looking for access module matching "rtsp": 25 candidates core debug: net: connecting to 192.168.1.100 port 8554 core debug: connection succeeded (socket = 30) access_realrtsp debug: rtsp connected access_realrtsp warning: only real/helix rtsp servers supported for now core debug: no access modules matched core error: open of rtsp://192.168.1.100:8554/test’ failed
core debug: dead input
core debug: changing item without a request (current 0/1)
core debug: nothing to play
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/fetcher/tvrage.luac
lua debug: Trying Lua scripts in /usr/share/vlc/lua/meta/fetcher
core debug: no meta fetcher modules matched
core debug: searching art for rtsp://192.168.1.100:8554/test
core debug: looking for art finder module matching “any”: 2 candidates
lua debug: Trying Lua scripts in /home/ubuntu/.local/share/vlc/lua/meta/art
lua debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/art
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/00_musicbrainz.luac
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/00_musicbrainz.luac
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/01_googleimage.luac
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/01_googleimage.luac
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/02_frenchtv.luac
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/02_frenchtv.luac
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/03_lastfm.luac
qt4 debug: IM: Deleting the input
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/03_lastfm.luac
lua debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
core debug: no art finder modules matched
core debug: looking for meta fetcher module matching “any”: 1 candidates
lua debug: Trying Lua scripts in /home/ubuntu/.local/share/vlc/lua/meta/fetcher
lua debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/fetcher
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/fetcher/tvrage.luac
core debug: using meta fetcher module “lua”
core debug: removing module “lua”
core debug: searching art for rtsp://192.168.1.100:8554/test
core debug: looking for art finder module matching “any”: 2 candidates
lua debug: Trying Lua scripts in /home/ubuntu/.local/share/vlc/lua/meta/art
lua debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/art
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/00_musicbrainz.luac
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/01_googleimage.luac
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/02_frenchtv.luac
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/03_lastfm.luac
lua debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
core debug: no art finder modules matched
core debug: art not found for rtsp://192.168.1.100:8554/test

Reading through the report, it appears that VLC achieves a connection with the RTSP feed, but then tries tunneling over HTTP and the connection fails?

Hi hansk1990,
For the two cases:
Gstreamer Input 1: this should work fine as we have verified it on tk1. What is your vlc version? are you on tk1 r21.5?
Gstreamer Input 2: the launch command is wrong. Probably you can try another app at gst-rtsp-server-1.8.1/examples/test-mp4.c

Hi DaneLLL,

I am currently running VLC 2.2.2, however am trying to update to 2.2.4 as I read that it may cause issues with RTSP feeds.

I’m actually running a TX1 board, running the latest software (I set the board up using Jetpack only a week ago).

Thanks for the comment on input 2, I thought that may be part of the problem which was why I moved back to the videotestsrc input. Once I can get that input working, I will experiment with my own video.

Just to be clear, it shouldn’t cause any issues having my VLC client running on the board which is acting as a server should it? I’m running it on the board as it eliminates any networking issues I may come across.

Thanks for all of your help, I really appreciate it!

Success!!! Well, partly.

I eventually managed to upgrade my VLC to version 2.2.4, but also stumbled along another example input command very similar to the one you provided earlier:

./test-launch “videotestsrc ! omxh264enc ! rtph264pay name=pay0 pt=96”

Only difference being the bold section was replaced with: x264enc. I’m not quite sure what the difference is, I will have to investigate further, but for whatever reason, the issue was resolved and I managed to gain a connection!

Now to try and link my openCV output window to this pipe…thanks for all of your help! I will do some further research myself, but would I be able to use the above example for an openCV output window, or would I need to build something of my own?

So I’ve had some success! I found to get the command working I had to do two things:

  1. install VLC 2.2.4 (I was previously running 2.2.2)
  2. change the encoding command from omxh264enc to x264enc

Now I’ve got the stream working, I’ve been able to play with the different encoding types which has been great, so Thank You DaneLL for your help!

My last question, if you don’t mind, is will I be able to use the test-launch program to pipe the output video window from a python openCV script (I am happy to move to C if need be, just Python was far easier for the initial setup) to the RTP feed? My initial tests suggest this won’t work, but I wasn’t sure if again, I was doing something slightly wrong. My current test command looks like this:

./test-launch “python path_to_program.py ! jpegenc ! rtpjpegpay name=pay0 pt=96”

Hi hansk1990,
x264enc is the SW encoder and omxh264enc is the HW encoder. If your are fine with SW encoder, it is good. But if you require HW encoder, you need to figure out why you cannot get omxh264enc.

If you are able to run ‘gst-launch-1.0 python path_to_program.py ! jpegenc ! rtpjpegpay name=pay0 pt=96 ! fakesink’, it should be also good in test-launch program. Actually we don’t have the experience to put python script in gstreamer command. Probably some other users can share experience.

Hi DaneLL,
I follow the steps you said.Step 3 i execute on terminal

./test-launch "filesrc /home/nvidia/Videos/iptest.mp4 ! omxh264enc ! rtph264pay name=pay0 pt=96"

Step 4,on pc(ubuntu14.04) open terminal and run

chen@chen-All-Series:~$ gst-launch-1.0 rtspsrc location=rtsp://192.168.0.106:8554/test
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.0.106:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not read from resource.
Additional debug info:
gstrtspsrc.c(5151): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Got error response: 503 (Service Unavailable).
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

How to solve it? Thank you in advance!

Hi Holy,
“filesrc /home/nvidia/Videos/iptest.mp4 ! omxh264enc ! rtph264pay name=pay0 pt=96” is wrong.

Does “videotestsrc ! omxh264enc ! rtph264pay name=pay0 pt=96” work?

Hi,DaneLL,
I excute the code

./test-launch "videotestsrc ! omxh264enc ! rtph264pay name=pay0 pt=96"
On pc, run the code
chen@chen-All-Series:~$ gst-launch-1.0 rtspsrc location=rtsp://192.168.0.106:8554/test
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.0.106:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Progress: (request) Sending PLAY request
Progress: (request) Sent PLAY request
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc1: Internal data flow error.
Additional debug info:
gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc1:
streaming task paused, reason not-linked (-1)
Execution ended after 0:00:00.034767011
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Is the result nomal?

Hi Holy,
We verify it with vlc player of Windows. Not sure how rtspsrc works. Probably you can refer to
http://gstreamer-devel.966125.n4.nabble.com/RTSP-Server-test-launch-question-td4667275.html

Or some users can share experience.

Hi DaneLLL,
Thank you very much.I test two examples.
1,sender on jetson-tx2 terminal.

./test-launch "videotestsrc ! omxh264enc ! rtph264pay name=pay0 pt=96"

receiver on pc (Ubuntu14.04).

chen@chen-All-Series:~$ gst-launch-1.0 rtspsrc location=rtsp://192.168.0.106:8554/test ! decodebin ! videoconvert ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.0.106:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Progress: (request) Sending PLAY request
Progress: (request) Sent PLAY request

2,sender on jetson-tx2 terminal.

./test-launch "filesrc location=/home/nvidia/Videos/iptest.mp4 ! qtdemux ! h264parse ! rtph264pay name=pay0 pt=96"

receiver on pc (Ubuntu14.04).

chen@chen-All-Series:~$ gst-launch-1.0 rtspsrc location=rtsp://192.168.0.106:8554/test ! decodebin ! videoconvert ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.0.106:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Progress: (request) Sending PLAY request
Progress: (request) Sent PLAY request

Hope this to help someone else!