gstreamer - 有没有办法禁止在 GStreamer 中为视频打开新窗口?
问题描述
我正在用 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 打开一个窗口来显示视频。
解决方案
检查 的flags
属性playbin
:
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
它的标志组合时,它不应该呈现视频路径。
推荐阅读
- android - 在 Xamarin Forms 项目中升级 nuget 后的 Android 网络问题
- java - Netty ByteToMessageDecoder 没有接收到不同 tcp 数据包中发送的消息
- vba - VB.net自动完成字符串选择后如何使DataGridView移动到下一个单元格而不是下一行?
- linux-kernel - 在 Linux 中通过交换机配置 I2C 总线
- graphql - GraphType 使用 ListGraphType 或使用 Connection 的第一个架构端点
- android - 在 EditText 中获取结果
- php - 将数据导出到excel文件
- navigation - 在squarespace 7.1中浏览不同页面时锚链接不起作用
- jquery - 在下面的 jQuery 代码中,我如何从 multiSelect 中进行选择
- javascript - react-router BrowserRouter与打字稿反应的问题?