how to show, save and rtsp multi-video streaming with gstreamer-imx on IMX6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to show, save and rtsp multi-video streaming with gstreamer-imx on IMX6

4,429 Views
riguangpeng
Contributor I

Hello everybody:
 I am doing video processing with gstreamer-imx(Yocto/gstreamer – Gateworks ) plugins on IMX6DL board, I have two video capture channels on the board, one is OV5460 camera with MIPI interface, the other is usb camera.

The scenario can be described as follows:
1. display two capture video individually at the same time on lvds screen , one window display the mipi camera, the other window dispaly the usb camera, when I click any one of the two windows, it can be  shown in full-screen; 
2. save capture data of the two cameras individually for every five minutes, that is say, every five minutes, the Imx6 board will generate two new files, one is for mipi camera, the other is for usb camera;
3. by using individualized sinks of gstreamer to transform video streams, display the two camera individually with VLC tool on my PC, the protocol is rtsp, when I click any one of the two windows, it can be  shown in full-screen.

I look up the website: http://trac.gateworks.com/wiki/Yocto/gstreamer, and do something as follows:
1. show local video of two channels by command 
    gst-launch-1.0 \
      imxv4l2videosrc device=/dev/video0 ! imxg2dvideosink window-width=640 window-height=480 window-x-coord=0 window-y-coord=0 \
      imxv4l2src device=/dev/video2 ! imxg2dvideosink window-width=640 window-height=480 window-x-coord=640 window-y-coord=0
2. show and save video data of two channels locally by command
    gst-launch-1.0 \ 
      imxv4l2videosrc device=/dev/video0 ! tee name= tee0 tee0. ! queue ! imxvpuenc_h264 bitrate=10000 ! filesink location=/tmp/file1.h264 \
      tee0. !  queue  ! imxg2dvideosink window-width=640 window-height=480 window-x-coord=0 window-y-coord=0 \ 
      imxv4l2src device=/dev/video2 ! tee name= tee1 tee1. ! queue ! imxvpuenc_h264 bitrate=10000 ! filesink location=/tmp/file2.h264 \ 
     tee1. !  queue ! imxg2dvideosink window-width=640 window-height=480 window-x-coord=640 window-y-coord=0
3. don't know how to generate two files every minutes, I know that I need a timer, the timer can do something each five minutes, but I don't know how to operate the gstreamer, do I need close the pipeline of gstreamer, then open it again?
4. to show the rstp video streaming on my PC, I look up the website: http://trac.gateworks.com/wiki/Yocto/gstreamer/streaming , it use the gst-variable-rtsp-server tool to act as rtsp server, like this
      gst-variable-rtsp-server -p 9001 -u \

          "imxv4l2videosrc device=/dev/video0 ! imxipuvideotransform ! imxvpuenc_h264 bitrate=1000 ! rtph264pay name=pay0 pt=96"
it can show one channel video streaming normally on my PC with VLC, but I want to show two channel, so I run this command two times, like this
      gst-variable-rtsp-server -p 9001 -u \

          "imxv4l2videosrc device=/dev/video0 ! imxipuvideotransform ! imxvpuenc_h264 bitrate=1000 ! rtph264pay name=pay0 pt=96" &
      gst-variable-rtsp-server -p 9002 -u \

          "imxv4l2src device=/dev/video2 ! imxipuvideotransform ! imxvpuenc_h264 bitrate=1000 ! rtph264pay name=pay0 pt=96" &
now, it can't show two channels video streaming on two VLC windows of my PC.
5. I don't know how to integrate with showing video locally, saving the video streaming locally and acting as the rstp server, although I look up http://trac.gateworks.com/wiki/Yocto/gstreamer/compositing

 

who can give some advice about these problems, thank you very much!

0 Kudos
5 Replies

2,684 Views
igorpadykov
NXP Employee
NXP Employee

Hi riguang

this also may be posted on meta-fsl-arm mailing list, so that someone familiar

with it could try to assist you.
https://lists.yoctoproject.org/listinfo/meta-freescale

as nxp does not support gstreamer-imx, it supports own plugins (imx-gst1),

[meta-freescale] [meta-fsl-arm][PATCH 3/5] gst1.0-fsl-plugin: Add Freescale Gstreamer1.0 Plugin for ... 

usage can be found in Linux Guide included in documentation provided on

i.MX Software|NXP 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

2,684 Views
riguangpeng
Contributor I

Hi, igor:

My rootfs is build from yocto, in bblayers.conf of yocto, it has the  meta-gstreamer configuration from website,

Releases · dv1/meta-gstreamer1.0 · GitHub , the version is 1.8.3, I think that this is offical gstreamer of Nxp.

 I look up the documentation, it only has some simple example, my scenario is more complicated.

0 Kudos

2,684 Views
igorpadykov
NXP Employee
NXP Employee

below link for nxp plugins:

gst1.0-plugins-fsl    
gst1.0-plugins-fsl - i.MX Gstreamer 1.0 Plugin 

Best regards
igor

0 Kudos

2,684 Views
riguangpeng
Contributor I

Hi, igor:

I look up the rootfs which is building from yocto, it package the gst1.0-plugins-fsl, the version is 4.1.6.

now my problem is that when I integrate with show, save to rtsp launch as the following picture, then play the pipeline,

it doesn't save the file in my disk flash or show the video on screen. If I connect the rtsp server from rtsp client of VLC in my PC, it will trigger the launch of rtsp server to run.

Can you give me some advice  how to save, show the streaming before I connect rstp server from the client?

 

pastedImage_4.png

the following picture is for gst-plugin-fsl:

pastedImage_1.png

pastedImage_2.png

pastedImage_3.png

0 Kudos

2,684 Views
igorpadykov
NXP Employee
NXP Employee

please use nxp linux on

linux-imx - i.MX Linux kernel 

building procedure described in Yocto Guide included in package

https://www.nxp.com/webapp/Download?colCode=L4.9.11_1.0.0_LINUX_DOCS&Parent_nodeId=13376994810717061... 

Best regards
igor

0 Kudos