Looking for a tutorial on using the media API to play video?

Questions and information about Crank Software's Storyboard Designer

Moderator: jamiev

Re: Looking for a tutorial on using the media API to play vi

Postby rdowdall » Tue May 17, 2016 2:54 pm

Hello Ray

Glad to hear that you are up and running.

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

Re: Looking for a tutorial on using the media API to play vi

Postby Ray » Fri May 20, 2016 11:05 am

Rodney.

If I want to play other videos instead of "big_buck_bunny.webm". First, I shall put the new video file under the "video" folder. Then, where or what file should I looking for? I have checked the lua script (mdeiaControl.lua) but not finding any relevant information. Thank you so much.
Ray
 
Posts: 42
Joined: Wed Apr 06, 2016 3:32 pm

Re: Looking for a tutorial on using the media API to play vi

Postby rdowdall » Fri May 20, 2016 12:03 pm

Ray wrote:Rodney.

If I want to play other videos instead of "big_buck_bunny.webm". First, I shall put the new video file under the "video" folder. Then, where or what file should I looking for? I have checked the lua script (mdeiaControl.lua) but not finding any relevant information. Thank you so much.


Hello Ray

In the GDE file, there is an gre.press event on the "play" button. That event is emitting a gra.new.video action. In that action definition there is a file name member. That is where you want to set the name of the video that you would like to play. Please make sure that the video size, and the external buffer size line up. Otherwise the resulting video image may be skewed.

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

Re: Looking for a tutorial on using the media API to play vi

Postby Ray » Mon May 23, 2016 9:24 am

Rodney,

Good morning! The gre.press event on the "play" button is only sending a data change action, which change the image from play_up to play_down when the mouse is pressed. I am not seeing the gra.new.video action. Can you provide more details? Thank you.

play.png
play.png (77.16 KiB) Viewed 14327 times
Ray
 
Posts: 42
Joined: Wed Apr 06, 2016 3:32 pm

Re: Looking for a tutorial on using the media API to play vi

Postby rdowdall » Mon May 23, 2016 9:51 am

Ray wrote:Rodney,

Good morning! The gre.press event on the "play" button is only sending a data change action, which change the image from play_up to play_down when the mouse is pressed. I am not seeing the gra.new.video action. Can you provide more details? Thank you.

play.png


Hello Ray

Sorry, my mistake. There is a Lua callback action attached to the gre.touch event in the Storyboard application on the play button. The Lua function that is being invoked is the media_play_pause_video function. In this function, if a video is not playing then it will emit a ev_start_video event to the Storyboard application. This event is the one that will emit the gra.media.new.video action. That ev_start_video event will be attached at the application level.

Please keep in mind that if you are changing the video, then you may need to change the pipeline that gstreamer is using as well in order to get the video playing properly.

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

Re: Looking for a tutorial on using the media API to play vi

Postby Ray » Mon May 23, 2016 11:39 am

Rodney,

I was going ask you about gstremer pipeline. It seems like the path of "Filesrc" should be updated if I want to play another video. But I have no idea how to update "Filesrc". Please advise. Thank you so much.

pipeline.png
pipeline.png (48.15 KiB) Viewed 14319 times
Ray
 
Posts: 42
Joined: Wed Apr 06, 2016 3:32 pm

Re: Looking for a tutorial on using the media API to play vi

Postby rdowdall » Mon May 23, 2016 9:57 pm

Ray wrote:Rodney,

I was going ask you about gstremer pipeline. It seems like the path of "Filesrc" should be updated if I want to play another video. But I have no idea how to update "Filesrc". Please advise. Thank you so much.

pipeline.png



Hello Ray

What does the command:

ls -la /home/roy/Dropbox/Linux_SB/VideoPlayer/video/big_buck_bunny.webm

say?

If the resource is there, then please check the permissions on the file and make sure that you can access it. You can also run something like:

/usr/bin32/gst-launch-0.10 playbin2 uri=file:///home/roy/Dropbox/Linux_SB/VideoPlayer/video/big_buck_bunny.webm

and see if it plays.

If you change the media_name element in the gra.media.new.video action, it will pass it as the filesrc argument to gstreamer-backend.

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

Re: Looking for a tutorial on using the media API to play vi

Postby Ray » Tue May 24, 2016 8:31 am

Rodney,

Okay, I can see how to change the video file from "media_name" in the "ev_start_video" event. And again, thank you answering all these silly questions for a newbie SWE.

Now, I would like to play videos with different format, for example, mp4, mov, avi...,etc.
Should I change the gstreamer pipeline as well? How to do it? Cause I have tried to play a mp4 file but its not working.
I am searching for "gstreamer-backend" online but not finding anything useful.

[code][/code]
Attachments
videoplay.png
videoplay.png (101.32 KiB) Viewed 14303 times
Ray
 
Posts: 42
Joined: Wed Apr 06, 2016 3:32 pm

Re: Looking for a tutorial on using the media API to play vi

Postby rdowdall » Tue May 24, 2016 9:15 am

Ray wrote:Rodney,

Okay, I can see how to change the video file from "media_name" in the "ev_start_video" event. And again, thank you answering all these silly questions for a newbie SWE.

Now, I would like to play videos with different format, for example, mp4, mov, avi...,etc.
Should I change the gstreamer pipeline as well? How to do it? Cause I have tried to play a mp4 file but its not working.
I am searching for "gstreamer-backend" online but not finding anything useful.

[code][/code]


Hello Ray

The gstreamer-backend in your example is using a decodebin2 element. The decodebin2 is a pipeline element that gstreamer uses to automatically determine which decoders to use to decode frames from a media element. The main thing you have to worry about in your case is the video size. So to be on the safe side, you may want to change the gstreamer-backend pipeline from

filesource location=blah name=media-src ! decodebin2 ! ffmpegcolorspace ! video/x-raw-rgb,bpp=16,depth=16 ! appsink name=video-sink

to:

filesource location=blah name=media-src ! decodebin2 ! ffmpegcolorspace ! videoscale ! video/x-raw-rgb,bpp=16,depth=16,width=640,hieght=360 ! appsink name=video-sink

To do this, find where gstreamer-backend is being launched from and change the argument that is being passed in after the -p option.

Now having said that, if you can't play the video with the 32 bit version of gst-launch on your system, then our gstreamer-backend won't be able to play it either. Gstreamer uses a series of plugins to decode and play media. If a particular plugin that is needed to play a specific piece of media is not there, then gstreamer itself won't be able to play the media for you. You can find out more about gstreamer here:

http://docs.gstreamer.com/display/GstSD ... amer+tools

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

Re: Looking for a tutorial on using the media API to play vi

Postby Ray » Thu May 26, 2016 10:16 am

Rodney,

Thanks for the information, it was very helpful. Finally I figured out that mp4/m4v files couldn't be played by gstreamer-0.10 cause H.264 decoder is not available on Ubuntu anymore. After install H.264 via PPA, it works pretty well now.
Ray
 
Posts: 42
Joined: Wed Apr 06, 2016 3:32 pm

PreviousNext

Return to Storyboard Designer

Who is online

Users browsing this forum: No registered users and 1 guest

cron