librelist archives

« back to archive

Video support on Green Shoes

Video support on Green Shoes

From:
ashbb
Date:
2011-09-27 @ 13:54
Hi all,

As mentioned at another thread:

http://librelist.com/browser//shoes/2011/9/20/trying-to-build-shoes-on-os-x-10-6-8-with-video/#64d2c9549e63c5e6625975ce8e4f8a9f

I have a trial build:

- http://pub.cozmixng.org/~kou/archives/glib2-1.0.3-x86-mingw32.gem
- http://pub.cozmixng.org/~kou/archives/gstreamer-1.0.3-x86-mingw32.gem

I tried a first shot to play a video file.
If you have a time, try out the folowing.

require 'green_shoes'
class Shoes::App
  def video uri
    require 'gst'
    Gst::ElementFactory.make('playbin').tap{|s| s.uri = uri}
  end
end
Shoes.app do
  v = video "
http://www.rin-shun.com/shoes/AdventureTimewithFinnandJakeFinnTime.mp4"
  button('play'){v.play}
  button('pause'){v.pause}
end

I've found no solution to embed the video in Shoes window yet.
But J or someone will tell me something. :-P

ashbb

Re: [shoes] Video support on Green Shoes

From:
J. Kaiden
Date:
2011-09-28 @ 13:27
hi ash,

  tried out the code both on ubuntu and on winxp - here's what i've found:

  on ubuntu - for some reason the app freezes, and when i try to close the
app i get a warning that green_shoes has become unresponsive...  not sure
why that's happening.  any ideas?  it could well have something to do with
my network connection, and not the code....

  if i change the code to point to a local file it runs just fine...  nice
work!  i'll see if i can come up with a way to embed the video in the main
shoes window...

  on winxp - i get errors from the glib2 and gstreamer gems that you
mentioned and linked, although they both seemed to install just fine.  when
i require 'glib2' in irb, it returns 'true.'  when i try to require 'gst',
however, i first get a pop-up window with the error:

"The procedure entry point rbgobj_gobject_initialize could not be located in
the dynamic link library glib2.so"

...clicking 'ok' closes the pop-up, and irb returns the error:

"LoadError: no such file to load -- gstreamer.so"  and then the 'from' paths

....strange thing is that my gem environment shows the correct paths, and
the file gstreamer.so exists, so i'm not sure what the problem is...  any
ideas?

  anyway, great work!  good to see that shoes media support is making
progress!

  - j

Re: [shoes] Video support on Green Shoes

From:
J. Kaiden
Date:
2011-09-28 @ 13:58
hello again -

  so - i figured out what was going wrong on winxp...  i hadn't installed
the glib2 gem that you linked, i was relying on the one that comes when
installing the gtk2 gem.  i installed the one you linked, and now irb
returns 'true' when requiring 'gst'...

  the code now runs to the point that when i push the 'play' button, i get a
'gstreamer directshow sink default window' which opens but is empty - and i
get an error:

>ruby ashvideo.rb
0:00:04.149896000   244   01C55A58 ERROR         dshowvideosink
dshowvideosink.cpp:952:VMR9Support::Configure:<videosink-actual-sink-dshowvideo>
Can't create an instance of renderer (error=80040154)

  i get the same error with local .mpg and .avi files, although a local .mp3
file plays without any problems....

  making some progress anyway!

  rock on ;)

  - j

Re: [shoes] Video support on Green Shoes

From:
ashbb
Date:
2011-09-28 @ 14:11
Hi J,

Thank you for taking the time to try out the code.

Umm,...
I've also found that many methods don't work well.
I guess the trial gstreamer gem for Windows is not built correctly. :(

I posted a request on a gstreamer ossbuild forum:

http://ossbuild.hoytsoft.org/forums/yaf_postst41_Could-you-provide-pkgconfig-files-ie-pc-files.aspx

Waiting for a response from ossbuild developers. ;-)

ashbb

Re: [shoes] Video support on Green Shoes

From:
J. Kaiden
Date:
2011-09-28 @ 14:14
hi ash -


> Thank you for taking the time to try out the code.


  thanks for writing it!


> I guess the trial gstreamer gem for Windows is not built correctly. :(
>

  it's a good start anyway ;)   - hopefully it will be up and running well
soon!


  - j

Re: [shoes] Video support on Green Shoes

From:
J. Kaiden
Date:
2011-09-27 @ 14:49
hi ash -

  COOL!  haven't had a chance to try it yet, but i'll get back to you when i
do...   i somehow screwed my working gtk 1.0, and haven't been able to
fiddle with green_shoes in a while - should have it back up and running
soon.  either way, exciting progress!!

  - j