有没有办法禁止在GStreamer中为视频打开一个新窗口?

问题描述 投票:0回答:1

我正在用gtk制作应用程序。我需要一种方法只播放一个mp4文件的音频。

var player = Gst.ElementFactory.make("playbin", "play");
player.uri = "http://ks4.imslp.info/files/imglnks/usimg/e/ea/IMSLP478767-PMLP776231-Plas_yn_Rhiw.mp4";
player.set_state(Gst.State.PLAYING);

我只想播放音频;我不希望GStreamer打开一个窗口来显示视频。

gstreamer glib vala
1个回答
0
投票

检查flagsplaybin属性:

  flags               : Flags to control behaviour
                        flags: readable, writable
                        Flags "GstPlayFlags" Default: 0x00000617, "soft-colorbalance+deinterlace+soft-volume+text+audio+video"
                           (0x00000001): video            - Render the video stream
                           (0x00000002): audio            - Render the audio stream
                           (0x00000004): text             - Render subtitles
                           (0x00000008): vis              - Render visualisation when no video is present
                           (0x00000010): soft-volume      - Use software volume
                           (0x00000020): native-audio     - Only use native audio formats
                           (0x00000040): native-video     - Only use native video formats
                           (0x00000080): download         - Attempt progressive download buffering
                           (0x00000100): buffering        - Buffer demuxed/parsed data
                           (0x00000200): deinterlace      - Deinterlace video if necessary
                           (0x00000400): soft-colorbalance - Use software color balance
                           (0x00000800): force-filters    - Force audio/video filter(s) to be applied

因此,当您选择排除video的标志组合时,它不应呈现视频路径。

© www.soinside.com 2019 - 2024. All rights reserved.