我正在尝试从谷歌代码编译简单的GST 播放器。我已经修复并安装了丢失的库,现在我收到链接器错误
\n\nvickey@tb:~/work/gst-player-0.0.0$ make\ngcc -ggdb -Wall -W -Wformat-nonliteral -Wcast-align -Wpointer-arith -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Winline -Wundef -Wnested-externs -Wcast-qual -Wshadow -Wwrite-strings -Wno-unused-parameter -Wfloat-equal -pedantic -ansi -std=c99 `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0` `pkg-config --cflags gstreamer-0.10` `pkg-config --libs gstreamer-0.10` -lgstinterfaces-0.10 ui.c gst-backend.c -o gst-player\nIn file included from /usr/include/gtk-2.0/gtk/gtk.h:236:0,\n from ui.c:19:\n/usr/include/gtk-2.0/gtk/gtkitemfactory.h:47:1: warning: function declaration isn\xe2\x80\x99t a prototype [-Wstrict-prototypes]\nui.c: In function \xe2\x80\x98toggle_fullscreen\xe2\x80\x99:\nui.c:60:9: warning: passing argument 1 of \xe2\x80\x98gtk_window_unfullscreen\xe2\x80\x99 from incompatible pointer type [enabled by default]\n/usr/include/gtk-2.0/gtk/gtkwindow.h:340:10: note: expected \xe2\x80\x98struct GtkWindow *\xe2\x80\x99 but …Run Code Online (Sandbox Code Playgroud) 我是 Gstreamer 新手,我有一个关于为什么我的元素无法链接在一起的问题。这是我的代码:
CustomData data;
data.videosource = gst_element_factory_make("uridecodebin", "source");
cout << "Created source element " << data.videosource << endl;
data.demuxer = gst_element_factory_make("qtdemux", "demuxer");
cout << "Created demux element " << data.demuxer << endl;
data.decoder = gst_element_factory_make("ffdec_h264", "video-decoder");
cout << "Went to the video path " << data.decoder << endl;
data.videoconvert = gst_element_factory_make("ffmpegcolorspace", "convert");
cout << "Created convert element " << data.videoconvert << endl;
data.videosink = gst_element_factory_make("autovideosink", "sink");
cout << "Created sink element " << data.videosink << endl;
if (!data.videosource ||!data.demuxer …Run Code Online (Sandbox Code Playgroud) 有谁知道如何通过管道应用程序(c 文件)为我的管道中的 appsrc 插件设置 gst-debug 吗?
(就像我们如何在终端上的 gst-launch-1.0 命令行中插入 --gst-debug=appsrc:9 一样?)
谢谢 !
如果gst-discover-1.0验证.mkv有字幕,那么如何提取字幕gst-launch-1.0?谢谢。
我尝试播放以 h264 编码并使用 matroskamux 混合的视频,但无法实现。我使用的是嵌入式平台,iMX6。
我的管道适用于 gst-lauch:
gst-launch-1.0 filesrc location=video.mkv ! matroskademux ! h264parse ! imxvpudec ! imxipuvideosink
Run Code Online (Sandbox Code Playgroud)
我用C创建了它,但它不起作用。我删除了错误处理,我使用包含所有元素的结构rep:
rep->pipeline = gst_pipeline_new("pipeline");
rep->src = gst_element_factory_make("filesrc","source0");
rep->demux = gst_element_factory_make("matroskademux","demux0");
rep->queue = gst_element_factory_make("queue2","queue0");
rep->parser = gst_element_factory_make("h264parse","parser0");
rep->decoder = gst_element_factory_make("imxvpudec","dec0");
rep->sink = gst_element_factory_make("imxipuvideosink","sink0");
gst_bin_add_many (GST_BIN(rep->pipeline), rep->src, rep->demux, rep->queue, rep->parser, rep->decoder,rep->sink, NULL);
g_object_set(rep->src, "location", "video.mkv", NULL);
g_object_set(rep->sink, "use-vsync", TRUE, NULL);
gst_element_link_many(rep->src, rep->demux, rep->queue, rep->parser, rep->decoder, rep->sink, NULL);
g_print("start pipeline\n");
gst_element_set_state (rep->pipeline, GST_STATE_PLAYING);
g_main_loop_run (loop);
Run Code Online (Sandbox Code Playgroud)
视频不显示并且应用程序卡住。使用 GST_DEBUG=4 我得到了很多调试,但在最后几行:
0:00:00.168590667 577 0xe24c0 WARN matroskademux …Run Code Online (Sandbox Code Playgroud) 我有一个写入 C 程序的管道,该程序将视频流从 stdin 重定向到多个 UDP 客户端。我希望动态添加或删除这些客户端,因此无法在编译时定义它们中的哪些以及将有多少。这是我的管道(如果我添加一个固定clients参数它工作正常):
fdsrc name=origin \
! video/x-h264,width=320,height=240,framerate=30/1,profile=baseline,stream-format=avc,alignment=au \
! h264parse \
! rtph264pay \
config-interval=1 \
pt=96 \
! multiudpsink name=dest \
sync=false
Run Code Online (Sandbox Code Playgroud)
根据 GStreamer 文档,我可以通过发送信号来动态添加或删除客户端来实现它。在这种情况下,它应该是add信号。
但是我找不到有关向元素(在本例中,是multiudpsink元素)发送信号的任何信息。很容易获得对我的元素的引用:
GstElement *sink = gst_bin_get_by_name(GST_BIN(pipeline), "dest");
/* TODO: send a signal to add a client */
g_object_unref(sink);
Run Code Online (Sandbox Code Playgroud)
但是现在我怎样才能向那个元素发出信号呢?
我使用的是 Windows 10。我无法配置 Visual Studio 2017 来运行基本的 Gstreamer 教程。我收到诸如“无法打开 gst/gst.h”之类的错误。我正在使用 gstreamer 1.0。
请帮忙。
如何使用 FFMPEG 为从(v4l2)网络摄像头发送到媒体服务器的流添加延迟?
这里的用例类似于安全摄像头,当在视频中检测到某些内容时,我希望能够将视频流式传输到服务器。确保在视频中捕获感兴趣的事件的最简单方法是使用 FFMPEG 将视频从摄像机流式传输到具有附加延迟的虚拟环回设备。然后,当发生感兴趣的事件时,该环回设备可用于启动实时流媒体。
在 GStreamer 中,我将使用queue元素的min-threshold-time参数完成此类延迟。例如,以下(大大简化的)示例管道在显示之前为来自 v4l2 网络摄像头的输出添加了 2 秒延迟:
gst-launch-1.0 v4l2src device=/dev/video1 ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 min-threshold-time=2000000000 ! xvimagesink
我如何用 FFMPEG 完成同样的事情?有一些技术挑战阻止我们为此使用 GStreamer。
我已经调查了这个itsoffset选项,但据我所知,它仅可用于已录制的文件,目前尚不清楚什么是好的替代方案。
我正在尝试使用 gstreamer 循环播放视频,它是 python 绑定。第一次尝试是挂钩 EOS消息并为管道生成搜索消息:
import gi
gi.require_version("Gst", "1.0")
from gi.repository import Gst
import time
if not Gst.init_check()[0]:
print("gstreamer initialization failed")
source0 = Gst.ElementFactory.make("filesrc", "source0")
assert source0 is not None
source0.set_property("location", "video0.mp4")
qtdemux0 = Gst.ElementFactory.make("qtdemux", "demux0")
assert qtdemux0 is not None
decoder0 = Gst.ElementFactory.make("nxvideodec", "video_decoder0")
assert decoder0 is not None
def demux0_pad_added(demux, pad):
if pad.name == 'video_0': # We expect exactly first one video stream
pad.link(decoder0.get_static_pad("sink"))
qtdemux0.connect("pad-added", demux0_pad_added)
video_sink = Gst.ElementFactory.make("nxvideosink", "video_sink")
assert video_sink is not None …Run Code Online (Sandbox Code Playgroud) 目前我可以在视频流上显示当地时间文本(时钟叠加)。
gst-launch-1.0 v4l2src ! videoconvert ! 'video/x-raw,width=640,height=480' ! clockoverlay ! ximagesink
我正在努力寻找一种显示当前日期的方法(假设本地时区)。
我确信我可以通过编写自己的插件来做到这一点。但是,是否有库存或变通方法可以避免重新发明轮子?有任何想法吗?