AnsweredAssumed Answered

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

Question asked by riguang peng on May 29, 2018
Latest reply on Jun 1, 2018 by igorpadykov

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!

Outcomes