【发布时间】:2013-06-21 06:24:25
【问题描述】:
我在 Windows XP 上的 ruby+gstreamer 中无法输出视频。
在我在 ruby1.86(不是 mingw32)中使用“dshowvideosink”和 gstreamer 0.1 之前,它是单独安装的。一切都很好。
现在我需要 ruby1.9(或更高版本)和任何 gstreamer。
我尝试安装 ruby1.9.3-mingw32 和 ruby2.0.0-mingw32。
此外,在这两种情况下,我都通过命令“gem.bat install gstreamer”安装了 gstreamer。
但是新版ruby+gstreamer中没有“dshowvideosink”!!!
我通过例子来调查一个问题:
require 'gtk2'
require 'gst'
def os_family
case RUBY_PLATFORM
when /ix/i, /ux/i, /gnu/i, /sysv/i, /solaris/i, /sunos/i, /bsd/i
'unix'
when /win/i, /ming/i
'windows'
else
'other'
end
end
Gst.init
pipeline = Gst::Pipeline.new('pipeline1')
videosrc = Gst::ElementFactory.make('videotestsrc', 'videosrc1')
videoconvert = Gst::ElementFactory.make('autovideoconvert', 'videoconvert1')
videosink = Gst::ElementFactory.make('autovideosink', 'videosink1');
pipeline.add(videosrc, videoconvert, videosink)
videosrc >> videoconvert >> videosink
window = Gtk::Window.new('Video test')
window.signal_connect("destroy") { pipeline.stop; Gtk.main_quit }
window.set_default_size(320, 240)
window.show_all
pipeline.bus.add_watch do |bus, message|
if (message and message.structure and message.structure.name \
and (message.structure.name == 'prepare-xwindow-id'))
Gdk::Threads.synchronize do
Gdk::Display.default.sync
if not window.destroyed? and window.window
win_id = nil
if os_family=='windows'
win_id = window.window.handle
else
win_id = window.window.xid
end
imagesink = message.src
imagesink.set_property("force-aspect-ratio", true)
imagesink.set_xwindow_id(win_id)
end
end
end
true
end
pipeline.play
Gtk.main
它在 Linux (Lubuntu) 上运行良好,但在 Windows (XP) 上不运行!
请给我建议:
1) 如何在 ruby 1.9 或 2.0 中重新激活“dshowvideosink”?
2) 我可以在 Windows 上使用什么组件来代替“dshowvideosink”?
3) 我怎样才能[重新]安装 gstreamer 或其插件与 ruby-mingw32(没有 gem)分开?
【问题讨论】:
标签: ruby mingw mingw32 gstreamer