标签: gstreamer

插件的多个文件上的 Gstreamer 调试输出

我正在尝试弄清楚如何在我正在编写的插件中设置 Gstreamer 0.10 日志记录。该插件跨越多个源文件,我不知道如何获取 GST_WARNING、GST_DEBUG 等。宏在主源文件外部工作。

假设我有两个文件:

plugin1.cpp
plugin1_helper.cpp
Run Code Online (Sandbox Code Playgroud)

plugin1.cpp是从模板生成的,调试类别定义如下。

GST_DEBUG_CATEGORY_STATIC (gst_plugin1_debug);
#define GST_CAT_DEFAULT gst_plugin1_debug
Run Code Online (Sandbox Code Playgroud)

它在plugin1_init()函数内初始化。

GST_DEBUG_CATEGORY_INIT (gst_plugin1_debug, "plugin1",
    0, "Template plugin1");
Run Code Online (Sandbox Code Playgroud)

我查看了教程http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+11%3A+Debugging+tools,但无法弄清楚如何处理多个文件。

当我从plugin_helper中调用GST_WARNING时,我得到一个带有default调试类别而不是plugin1.

如果我尝试为帮助程序文件创建一个新类别,我会得到以下输出。

(gst-launch-0.10:4422): GStreamer-CRITICAL **: gst_debug_log_valist: assertion 'category != NULL' failed
Run Code Online (Sandbox Code Playgroud)

那么 GST_DEBUG 如何处理插件的多个源文件呢?

c++ gstreamer

2
推荐指数
1
解决办法
1193
查看次数

在 Ubuntu 中使用 Gstreamer 通过 RTP 协议流式传输 Mp4 视频

我正在尝试从本地目录获取视频文件,启用来自服务器的流并从客户端捕获这些帧。我使用了以下管道:

服务器端:

gst-launch -v  filesrc location=/home/gokul/Videos/Econ_TestVideo/radioactive.mp4 ! qtdemux ! rtpmp4vpay ! udpsink host=192.168.7.61 port=5000 sync=true


Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001b001000001b58913000001000000012000c48d8800f528045a1443000001b24c61766335332e33352e30, payload=(int)96, ssrc=(uint)3003638799, clock-base=(uint)1542273545, seqnum-base=(uint)49176
/GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0.GstPad:sink: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, profile=(string)simple, level=(string)1, codec_data=(buffer)000001b001000001b58913000001000000012000c48d8800f528045a1443000001b24c61766335332e33352e30, width=(int)1280, height=(int)720, framerate=(fraction)91/3, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0: timestamp = 1542273545
/GstPipeline:pipeline0/GstRtpMP4VPay:rtpmp4vpay0: seqnum = 49176
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001b001000001b58913000001000000012000c48d8800f528045a1443000001b24c61766335332e33352e30, payload=(int)96, ssrc=(uint)3003638799, clock-base=(uint)1542273545, seqnum-base=(uint)49176
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ... …
Run Code Online (Sandbox Code Playgroud)

ubuntu rtp video-streaming gstreamer gst-launch

2
推荐指数
1
解决办法
9494
查看次数

GStreamer 管道挂在 gst_element_get_state 上

我有以下使用 GStreamer 库的非常基本的代码(Xubuntu 16.04 上的 GStreamer v1.8.1,如果重要的话)

#include <gst/gst.h>

int main(int argc, char *argv[])
{
    gst_init(&argc, &argv);

    const gchar* pd =
        "filesrc location=some.mp4 ! qtdemux name=d "
        "d.video_0 ! fakesink "
        "d.audio_0 ! fakesink ";

    GError* error = nullptr;
    GstElement *pipeline = gst_parse_launch(pd, &error);

    GstState state; GstState pending;
    switch(gst_element_set_state(pipeline, GST_STATE_PAUSED)) {
        case GST_STATE_CHANGE_FAILURE:
        case GST_STATE_CHANGE_NO_PREROLL:
            return -1;
        case GST_STATE_CHANGE_ASYNC: {
            gst_element_get_state(pipeline, &state, &pending, GST_CLOCK_TIME_NONE);
        }
        case GST_STATE_CHANGE_SUCCESS:
            break;
    }

    GMainLoop* loop = g_main_loop_new(nullptr, false);
    g_main_loop_run(loop);

    gst_object_unref(pipeline);

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

问题是当我尝试运行这段代码时它会挂起 …

c c++ gstreamer

2
推荐指数
1
解决办法
7649
查看次数

如何使用 Gstreamer 制作可搜索的视频

我正在尝试使用 Gstreamer 制作一个可搜索的视频,经过多次研究,我发现 matroskamux 和 filesink 插件可以做到这一点,但它不起作用。

这是我的管道:

gst-launch-1.0 videotestsrc ! x264enc ! h264parse ! matroskamux ! filesink location=test.mkv
Run Code Online (Sandbox Code Playgroud)

我创建了一个 5 秒的视频:

^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:05.989791758
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Run Code Online (Sandbox Code Playgroud)

当我从 gstreamer 运行发现应用程序时:

user@IM00343:~/Desktop$ gst-discoverer-1.0 test.mkv 
Analyzing file:///home/user/Desktop/test.mkv
Done discovering file:///home/user/Desktop/test.mkv

Topology:
  container: Matroska
    video: H.264

Properties:
  Duration: 0:00:00.566333333
  Seekable: yes
  Tags: 
      container format: Matroska
      video codec: H264
      minimum bitrate: …
Run Code Online (Sandbox Code Playgroud)

video gstreamer

2
推荐指数
1
解决办法
1365
查看次数

Gstreamer - 示例 1 中的错误

当我运行示例 1 时:

#include <gst/gst.h>
int main(int argc, char *argv[]) {
GstElement *pipeline;
GstBus *bus;
GstMessage *msg;

/* Initialize GStreamer */
gst_init (&argc, &argv);

/* Build the pipeline */
pipeline = gst_parse_launch ("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL);

/* Start playing */
gst_element_set_state (pipeline, GST_STATE_PLAYING);

/* Wait until error or EOS */
bus = gst_element_get_bus (pipeline);
msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);

/* Free resources */
if (msg != NULL)
  gst_message_unref (msg);
gst_object_unref (bus);
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (pipeline);
return 0; …
Run Code Online (Sandbox Code Playgroud)

c++ gstreamer

2
推荐指数
1
解决办法
3195
查看次数

Gstreamer:udpsink/udpsrc 与 tcpserversink/tcpclientsrc

我对 gstreamer 非常陌生,但经过大量研究,我现在设法创建了自己的工作管道,通过 UDP 传输将网​​络摄像头从 Raspberry PI Zero 流式传输到 PC。我对自己的进步很满意!:)

但我正在努力创建一个 TCP 传输......

此管道在 UDP 上完美运行:(注意:使用测试视频源和 JPEG 编码进行了简化):

Server UDP (192.168.2.1):
gst-launch-1.0 videotestsrc is-live=true ! jpegenc ! rtpjpegpay  ! udpsink host=192.168.2.13  port=7001

Client UDP (192.168.2.13):
gst-launch-1.0 udpsrc port=7001 ! application/x-rtp,encoding-name=JPEG ! rtpjpegdepay ! jpegdec ! autovideosink
Run Code Online (Sandbox Code Playgroud)

...但是当我使用具有完全相同元素的 TCP 接收器/源时,我只收到错误消息。

使用tcpserversinktcpclientsrc修改后的管道:

Server TCP (192.168.2.1):
gst-launch-1.0 videotestsrc is-live=true ! jpegenc ! rtpjpegpay  ! tcpserversink port=7001

Client TCP (192.168.2.13):
gst-launch-1.0 tcpclientsrc host=192.168.2.1 port=7001 ! application/x-rtp,encoding-name=JPEG …
Run Code Online (Sandbox Code Playgroud)

gstreamer

2
推荐指数
1
解决办法
5441
查看次数

我们可以将gstreamer集成到Electron应用程序中吗?如何集成?

我正在做基于java脚本的桌面应用程序。问题是,我必须流式传输 rtsp 视频。是否可以将 g-streamer 插件与 Electron 一起使用?或者是否有其他插件可用于桌面应用程序的 rtsp?

我对流 rtsp 概念和桌面应用程序完全陌生。

html desktop-application rtsp gstreamer electron

2
推荐指数
1
解决办法
2422
查看次数

在python中将gstreamer管道转换为opencv

我使用以下 gstreamer 命令创建了一个网络流:

发件人:

gst-launch-1.0 -v videotestsrc ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=X.X.X.X port=5000
Run Code Online (Sandbox Code Playgroud)

接收者:

gst-launch-1.0 -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink
Run Code Online (Sandbox Code Playgroud)

这很好用。我现在想在 python 脚本中包含接收端的流。在脚本中,我想用 opencv 做一些视频处理。

有谁知道如何转换所描述的管道,以便它可以与 opencv 一起使用?

谢谢!

编辑1:

发现这应该有效:

cap = cv2.VideoCapture("udpsrc port=5000 ! application/x- rtp,media=video,payload=26,clock-rate=90000,encoding-name=H264, payload=96 ! rtph264depay ! decodebin ! videoconvert ! appsink", cv2.CAP_GSTREAMER)
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

OpenCV Error: Assertion failed (size.width>0 && size.height>0) …
Run Code Online (Sandbox Code Playgroud)

python opencv video-streaming gstreamer gst-launch-1.0

2
推荐指数
1
解决办法
1万
查看次数

使用 vaapi 硬件加速播放视频的 gst-launch 命令

我需要两个 gst-launch-1.0 命令行

1)第一个是简单的播放视频(.mp4)而不使用任何硬件加速。

2)第二个是使用硬件加速播放视频(.mp4),我使用的是带有i965驱动程序的英特尔高清显卡。

我已经安装了 gstreamer 插件。

任何帮助,将不胜感激。

gstreamer hardware-acceleration vaapi

2
推荐指数
1
解决办法
908
查看次数

Gstreamer。对“gst_video_overlay_set_window_handle”的未定义引用

我正在尝试一起使用 gstreamer 和 Qt5。只是带有 src->sink 的简单应用程序 - 用于在屏幕上显示某些内容。

这是源代码的示例:

#include <glib.h>
#include <gst/gst.h>
#include <gst/video/videooverlay.h>    

...

WId xwinid = window.winId();
gst_video_overlay_set_window_handle( (GST_VIDEO_OVERLAY (sink)), xwinid);
Run Code Online (Sandbox Code Playgroud)

在这里我遇到了下一个错误:

/.../gst_qt/main.cpp:33: error: undefined reference to `gst_video_overlay_set_window_handle'
/.../gst_qt/main.cpp:33: error: undefined reference to `gst_video_overlay_get_type'
Run Code Online (Sandbox Code Playgroud)

我在我的环境中找到了 .c 和 .h “videooverlay”文件,但看起来很奇怪,该标头无法调用源。

在我的 .pro 文件中,我包含了 gstreamer:

# files needed for gstreamer
INCLUDEPATH += /.../usr/include/gstreamer-1.0
INCLUDEPATH += /.../usr/include/glib-2.0
INCLUDEPATH += /.../usr/lib/glib-2.0/include
INCLUDEPATH += /.../usr/lib/gstreamer-1.0

# external libraries
CONFIG += link_pkgconfig
PKGCONFIG += gstreamer-1.0
PKGCONFIG += gobject-2.0
PKGCONFIG += glib-2.0
Run Code Online (Sandbox Code Playgroud)

有谁知道这里出了什么问题?

c qt gstreamer qt5

2
推荐指数
1
解决办法
3896
查看次数