Is there an working example playing audio or videos?

Crank Storyboard Designer samples and code snippets.

Moderator: jamiev

Is there an working example playing audio or videos?

Postby Miluba » Thu Nov 05, 2015 12:54 pm

Hello everyone,

I am pretty new to Storyboard and wondered if there is any working example or tutorial how to use the gra engine or an external render extension to play video or audio files? We simply do not know how to get a video stream rendered in our solution. Do anyone have experience doing so? Are there any code snippets available which may help?

Best Regards,
Michael
Miluba
 
Posts: 7
Joined: Mon Oct 19, 2015 8:31 pm

Re: Is there an working example playing audio or videos?

Postby rdowdall » Thu Nov 05, 2015 1:06 pm

Hello Michael

Which target are you running your application on? We have a couple of solutions and examples that we can provide, but the instructions that are sent will be based are your target.

Thanks,
Rodney
rdowdall
 
Posts: 114
Joined: Mon Nov 02, 2009 9:46 pm

Re: Is there an working example playing audio or videos?

Postby Miluba » Thu Nov 05, 2015 1:18 pm

Hello Rodney,

we are currently running an ubuntu 14.04 vm, that will later on also be our target platform.

Thank you for your help,
Michael
Miluba
 
Posts: 7
Joined: Mon Oct 19, 2015 8:31 pm

Re: Is there an working example playing audio or videos?

Postby rdowdall » Thu Nov 05, 2015 4:09 pm

Hello Michael

I'll also need the version of Storyboard that you are using. You'll need to have the gstreamer 32 bit libraries installed on your target. Make sure that you can play your media on your target with gst-launch.

Thanks,
Rodney
rdowdall
 
Posts: 114
Joined: Mon Nov 02, 2009 9:46 pm

Re: Is there an working example playing audio or videos?

Postby Miluba » Fri Nov 06, 2015 4:07 am

Hello Rodney,

the version of Storyboard is 4.1.0.201506290930 . ;)

Thanks,
Michael
Miluba
 
Posts: 7
Joined: Mon Oct 19, 2015 8:31 pm

Re: Is there an working example playing audio or videos?

Postby rdowdall » Fri Nov 06, 2015 9:35 pm

Hello Michael

I'll put together a package for you that will run on your target. I'll post it here when it is ready.

Thanks,
Rodney
rdowdall
 
Posts: 114
Joined: Mon Nov 02, 2009 9:46 pm

Re: Is there an working example playing audio or videos?

Postby Miluba » Mon Nov 09, 2015 10:42 am

Hello Rodney,

thanks alot for your effort. We appreciate it.

Best Regards,
Michael
Miluba
 
Posts: 7
Joined: Mon Oct 19, 2015 8:31 pm

Re: Is there an working example playing audio or videos?

Postby rdowdall » Tue Nov 10, 2015 8:33 pm

Hello Michael

My co-workers and I put together a sample for you. It can be downloaded from here:

https://www.dropbox.com/s/41gh295aywt6l ... ar.gz?dl=0

The gstreamer-backend application should be placed in the same directory as the sbengine binary. The libgre-plugin-media.so library should be placed in the plugins directory of the runtime that you are using.

The gstreamer-backend application should be launched with the parameters that are specified in the file pipeline.txt. The VideoPlayer directory contains a Storyboard project that plays a video file. When you launch it, please specify the full path to the gapp file. This will help sbengine find the media file that is specified to play.

If you have any further questions, please let me know.

Thanks,
Rodney
rdowdall
 
Posts: 114
Joined: Mon Nov 02, 2009 9:46 pm

Re: Is there an working example playing audio or videos?

Postby Miluba » Mon Nov 16, 2015 11:53 am

Hi
thank you very much, it is working :-)

But we have new Problems:
We try to stream from another Device via UDP.
We have set up the gstreamer for the sender like this:
gst-launch-0.10 ximagesrc xid=0x0400000d ! ffmpegcolorspace ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! queue ! rtph264pay name=pay0 pt=96 ! udpsink host=192.168.2.128 port=5000 auto-multicast=true

and the receiver like that:
gst-launch-1.0 udpsrc port=5000 ! application/x-rtp, encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink

This works very fine...

But if we use your gstreamer backend this is not working...

./gstreamer-backend -v -d3 -e -p "filesrc location=/home/unitylab/workspace_crank/VideoPlayer/video/big_buck_bunny.webm name=media-src ! decodebin2 ! ffmpegcolorspace ! video/x-raw-rgb,bpp=16,depth=16 ! appsink name=video-sink" & ./sbengine -vv -ogreio /home/unitylab/workspace_crank/VideoPlayer/VideoPlayer.gapp

If we start it we get the following error:
streamer-backend: Event=gre.media.connect gstreamer-backend: Event=gre.media.new.video gstreamer-backend: extra_data=NA gstreamer-backend: pipeline=udpsrc port=5000 ! application/x-rtp, encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! video/x-raw-rgb,bpp=16,depth=16 ! appsink name=video-sink gstreamer-backend: size=800x400x2 gstreamer_backend: external=video: ERROR [2.123]:External Server: unable to open memory block: ERROR [2.123]:External failed to bind client: Error playing /home/unitylab/VideoPlayer/: Internal data flow error.


Hope you have a hint for us....

Best regards
Miluba
 
Posts: 7
Joined: Mon Oct 19, 2015 8:31 pm

Re: Is there an working example playing audio or videos?

Postby rdowdall » Mon Nov 16, 2015 12:08 pm

Hello Micheal

Remove the pipeline that you are specifying in your GDE project as part of the play.new.video action. That's only needed if you plan on playing different types of media that may require different pipeline setups.

After you do that, try launching the gstreamer backend like so:

./gstreamer-backend -v -d3 -e -p "udpsrc port=5000 ! application/x-rtp, encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! video/x-raw-rgb,bpp=16,depth=16 ! appsink name=video-sink"

Also make sure that you are not running any other instances of Storyboard engine that are trying to connect to the media player. In order to display the video buffer in the Storyboard application, we use shared memory regions to copy the data over. These errors:

ERROR [2.123]:External Server: unable to open memory block:
ERROR [2.123]:External failed to bind client

make it seem like the external render manager tried to open a shared memory block that was already in use by another application.

Thanks,
Rodney
rdowdall
 
Posts: 114
Joined: Mon Nov 02, 2009 9:46 pm

Next

Return to Samples

Who is online

Users browsing this forum: No registered users and 1 guest