Regarding basic media player for gstreamer-backend

Hello,

I am trying to use gstreamer-backend for the media player and USB webcam streaming. I have two questions about those works.

First question is, I used below commands to combine gstreamer-backend and sbengine,

./gstreamer-backend -v -d3 -e -p "filesrc location=/home/hk/storyboard_workspace2/MediaPlayer/video/big-buck-bunny_trailer.webm ! matroskademux name=demuxer demuxer. ! queue ! vp8dec ! xvimagesink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! alsasink" & ./sbengine -vv -ogreio /home/hk/storyboard_workspace2/MediaPlayer/MediaPlayer.gapp

However, it shows two independent windows. So, could you tell me what I missed?

 

 

Second question is that as I mentioned, I am trying to stream USB-webcam with below command. And I was able to see video even though it has different window as shown in first question.

./gstreamer-backend -v -d3 -e -p "v4l2src device=/dev/video0 ! videoconvert ! ximagesink" & ./sbengine -vv -ogreio /home/hk/storyboard_workspace2/MediaPlayer/MediaPlayer.gapp

So, my question is that I want to put

'video/x-raw,width=640,height=480,framerate=30/1'

options to setup framerate and size. but when it try with below command,

./gstreamer-backend -v -d3 -e -p "v4l2src device=/dev/video0 ! 'video/x-raw,width=640,height=480,framerate=30/1' ! videoconvert ! ximagesink" & ./sbengine -vv -ogreio /home/hk/storyboard_workspace2/MediaPlayer/MediaPlayer.gapp

I failed to run the program. So I was wondering if you could tell me how to add above option for the webcam.

Thank you in advance.

0

Comments

2 comments
  • Official comment

    Hello,

    The issue lies with the video sink being used. In order to use gstreamer-backend with an external render extension, 'appsink' needs to be used rather than 'xvimagesink', or any other sink.
    The gstreamer-backend -e option works by looking for an 'appsink' element named 'video-sink', which it will find and setup properly with the appropriate callbacks, etc for data to render to the storyboard app. With the pipeline shown here, after these changes it would look like:

    ./gstreamer-backend -v -d3 -e -p "filesrc name=media-src ! matroskademux name=demuxer demuxer. ! queue ! vp8dec ! appsink name=video-sink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! alsasink"

    NOTE: if the 'filesrc' element is named 'media-src', gstreamer-backend will look for it and populate the location of the media file automatically, so you don't have to do that through the pipeline, those changes have been made in the example above.

    Unfortunately, while this does solve the dual screen issue and will render the content in the storyboard application, the formatting of the video needs to be manually specified since we're now using appsink. Left alone, it will likely show up like this:

    In order to format it, a piece needs to be added to the pipeline. 
    You can specify formatting like this:

    video/x-raw,height=480,width=800,format=BGRA

    Added to the above pipeline:

    ./gstreamer-backend -v -d3 -e -p "filesrc name=media-src ! matroskademux name=demuxer demuxer. ! queue ! vp8dec ! videoconvert ! videoscale ! video/x-raw,height=480,width=800,format=BGRA ! appsink name=video-sink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! alsasink"

    Part of the issue was that a few pipeline elements were absent, that is 'videoconvert' and 'videoscale'.

    This also answers the second question regarding setting up frame-rate and size. That pipeline is missing the 'videoscale' element. Additionally, the caps string (video/x-raw...) must come after the 'videoconvert' element. 
    After making the necessary changes the pipeline should look like:

    ./gstreamer-backend -v -d3 -e -p "v4l2src device=/dev/video0 ! videoconvert ! videoscale ! video/x-raw,width=640,height=480,framerate=30/1 ! appsink name=video-sink" &

    This solution will work for any and all targets, provided they have the required gstreamer elements installed.

    Happy streaming!

  • This issue is currently being tackled by the support team, and once a solution has been found, we will post an update.

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post