Making a 720p live video monitoring

[s]Maybe changing in sender

pt=96

to

payload=96

would help.
[/s]
[EDIT: Sorry, this is wrong. Got confused with your other topic.]

hi all;

I can get the rtsp stream with the following command :

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

my question is " how can I get the stream with usb device (/dev/video0) ?"

thanks ahead

b/R

Hi DaneLLL;

can you help me solve this issue ,

with usb camera ,I can not get RTSP stream at PC with VLC ?

B/R

Hi lgz3308,
Please put nvvidconv between v4l2src and omxh264enc

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,wodth=640,height=480,format=I420' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420,width=640,height=480' ! omxh264enc ! fakesink

Hi DaneLLL,

thank alot ,for you so quick response .

I used above command , the following err be printed , what is the wrong ?

ubuntu@tegra-ubuntu:~$ sudo gst-launch-1.0 v4l2src device=/dev/video1 ! ‘video/x-raw,wodth=640,height=480,format=I420’ ! nvvidconv ! ‘video/x-raw(memory:NVMM),format=I420,width=640,height=480’ ! omxh264enc ! fakesink
Setting pipeline to PAUSED …
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingPipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.599750366
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

BTW: My usb camera dev id is video 1

B/R

Hi lgz3308. please check the format of your usb camera. Look like it is not I420. It probably is UYVY.

yeah ,

I thind this camera output is YUV signal ,mauybe , but how to solve this issue ?

what should I do ,step by step ?

Hi lgz3308,
You can get more information about your camera via v4l2-ctl https://www.mankier.com/1/v4l2-ctl

hi DaneLLL,

with the v4l2-ctl ,I get the following result :

ubuntu@tegra-ubuntu:~/gsteamer_rtsp_server/gst-rtsp-server-1.8.3/examples$ v4l2-ctl -d /dev/video1 --list-formats
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘YUYV’
Name : YUV 4:2:2 (YUYV)

Index       : 1
Type        : Video Capture
Pixel Format: 'MJPG' (compressed)
Name        : MJPEG

ubuntu@tegra-ubuntu:~/gsteamer_rtsp_server/gst-rtsp-server-1.8.3/examples$ gst-launch-1.0 v4l2src device=/dev/video1 ! ‘video/YUV,wodth=640,height=480,format=YUYV’ ! nvvidconv ! ‘video/x-raw(memory:NVMM),format=MJPG,width=640,height=480’ ! omxh264enc ! fakesink
WARNING: erroneous pipeline: could not link v4l2src0 to nvvconv0
ubuntu@tegra-ubuntu:~/gsteamer_rtsp_server/gst-rtsp-server-1.8.3/examples$ ls /dev |grep video*
video0
video1
ubuntu@tegra-ubuntu:~/gsteamer_rtsp_server/gst-rtsp-server-1.8.3/examples$

what I should to do ,next step ??

Hi lgz3308, nvvidconv on r21,5 does not support YUYV. You may try MJPG

gst-launch-1.0 v4l2src device=/dev/video0 ! 'image/jpeg,width=640,height=480' ! nvjpegdec ! nvvidconv ! 'video/x-raw(memory:NVMM),width=640,height=480,format=I420' ! omxh264enc ! fakesink

ubuntu@tegra-ubuntu:/sys/class/video4linux/video1$ gst-launch-1.0 v4l2src device=/dev/video1 ! ‘image/jpeg,width=640,height=480’ ! nvjpegdec ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=640,height=480,format=I420’ ! omxh264enc ! fakesink
Setting pipeline to PAUSED …
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingPipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-supported (-6)
Execution ended after 0:00:01.629191417
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …
ubuntu@tegra-ubuntu:/sys/class/video4linux/video1$

The usb camra still be no work ??

Probably you should try other usb cameras. The commands we give are verified on Logitech c310/c930.

OH , But this camera is work fine with opencv ,I can open it with opencv normally on TX1 ,with the command : cap = cv2.VideoCapture( 1)

Hi lgz3308,
Please try the following command to see which one shows video preview:

export DISPLAY=:0
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=GRAY8 ! xvimagesink
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YV12 ! xvimagesink
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=I420 ! xvimagesink
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=UYVY ! xvimagesink
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2 ! xvimagesink
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YVYU ! xvimagesink

Hi daneLLL

thanks alot
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2 ! xvimagesink

with this cmd , the usb camera is work fine

You should be able to run

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=640,height=480 ! videoconvert ! video/x-raw,format=I420 ! omxh264enc ! fakesink

hi DaneLLL ,

when I do the above cmd :

buntu@tegra-ubuntu:~$ gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw,format=YUY2,width=640,height=480 ! videoconvert ! video/x-raw,format=I420 ! omxh264enc ! fakesink
Setting pipeline to PAUSED …
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingPipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
===== MSENC blits (mode: 1) into tiled surfaces =====

no shell prompt "#"return, what I should do next ?

Hi lgz3308,
You should be able to run

./test-launch "v4l2src device=/dev/video1 ! video/x-raw,format=YUY2,width=640,height=480 ! videoconvert ! video/x-raw,format=I420 ! omxh264enc ! rtph264pay name=pay0 pt=96"

Ok , thanks alot , Dear DaneLLL

During transcode , There are so many trap!!!

It is work fine ,I can get RTSP stream from my PC!

thanks for you Patience ,again ! :)

B/R

Hi DaneLLL:

Today , I buy one logitech C310 camera as you suggested with the following cmd ,I can get rtsp stream ,but 2 questions confueed me ,

 ./test-launch "v4l2src device=/dev/video1 ! video/x-raw,format=YUY2,width=640,height=480 ! videoconvert ! video/x-raw,format=I420 ! omxh264enc ! rtph264pay name=pay0 pt=96 

1> How I can get the 720P stream ,instead 640*480 ??

2> why I can get the stream only 1 PC in the meanwhile , I need muti_PC terminal. what I need to do more ??

B/R