【问题标题】:Video output in ruby-mingw32 + gstreamer on WindowsWindows 上 ruby​​-mingw32 + gstreamer 中的视频输出
【发布时间】:2013-06-21 06:24:25
【问题描述】:

我在 Windows XP 上的 ruby​​+gstreamer 中无法输出视频。

在我在 ruby​​1.86(不是 mingw32)中使用“dshowvideosink”和 gstreamer 0.1 之前,它是单独安装的。一切都很好。

现在我需要 ruby​​1.9(或更高版本)和任何 gstreamer。
我尝试安装 ruby1.9.3-mingw32ruby2.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


    【解决方案1】:

    回复2: 对于 Windows,您应该使用 d3dvideosink。

    【讨论】:

    • ruby 的默认 gstreamer 中没有这样的元素。
    • 我很抱歉我在过去一个月左右一直在使用 C# 构建,完全忘记了它不在 Ruby 中
    • 值得注意的是,它在 Ruby1.86 中运行良好,但在 Ruby1.93 中无法运行(“从盒子里”)。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-11-17
    • 1970-01-01
    • 1970-01-01
    • 2015-06-29
    • 1970-01-01
    • 2019-01-26
    • 2019-08-31
    相关资源
    最近更新 更多