标签: gstreamer

gstreamer库未解决包括

我用GStreamer库编写了一个简单的C代码(gstreamer示例代码手册参考)

我的GStreamer标头位于/usr/include/gstreamer-0.10/gst

因此,我在C代码中写了以下行:

#include "gstreamer-0.10/gst/gst.h"
Run Code Online (Sandbox Code Playgroud)

编译时出现以下错误:

里面有未解决的包含

我怎么解决这个问题?

谢谢...

gstreamer

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

OSX上的Gstreamer

我正在尝试创建一个非常简单的Gstreamer管道,其中我的源元素是FaceTime相机,而接收器元素是udp接收器。

我首先按照此处的说明安装Gstreamer 。我运行一些基本管道没有问题;但是,当我尝试使用以下命令时

./gst-launch-0.10 v4l2src ! xviimagesink
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

ERROR: pipeline could not be constructed: no element "v4l2src".
Run Code Online (Sandbox Code Playgroud)

因此,我进行了一些挖掘,结果发现v4l2src插件在gst-plugins-good中。我使用以下命令使用macports安装了这些优秀的插件:

port install gst-plugins-good
Run Code Online (Sandbox Code Playgroud)

经过很长一段时间后,所有内容均已正确安装。现在,gst-launch出现在三个位置。

/Library/Frameworks/GStreamer.framework/Versions/0.10/bin/gst-launch-0.10
/opt/local/bin/gst-launch
/opt/local/bin/gst-launch-0.10
Run Code Online (Sandbox Code Playgroud)

如果我尝试从任何这些目录中运行上面提到的pipline,我仍然会得到

ERROR: pipeline could not be constructed: no element "v4l2src".
Run Code Online (Sandbox Code Playgroud)

如果我从任何地方键入以下命令,都会遇到更多错误,但似乎仍然找不到v4lsrc。

gst-launch v4l2src ! xviimagesink
Run Code Online (Sandbox Code Playgroud)

给出:

Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
Dynamic …
Run Code Online (Sandbox Code Playgroud)

gstreamer facetime gst-launch osx-mountain-lion

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

GST_DEBUG:如何将日志保存在应用程序内线程的单独文件中

我正在运行一个 gstreamer 示例程序,它作为线程从 C++ 应用程序中调用。已设置GST_DEBUG=*:5级别以捕获所有可能的场景。

该应用程序还在标准输出上打印大量日志,gstreamer 线程也执行相同的操作(级别 5 增加了痛苦)。

问题 - 有没有办法在给定调试级别的文件中分离出 gstreamer 线程的日志打印?

补充问题——根据答案下面的答案设置 GST_DEBUG_FILE 但文件从某些字符开始而不是从 GST_DEBUG 开始

0:00:00.000036045 ^[[335m21088^[[00m  0x8405800 ^[[37mLOG    ^[[00m ^[[00;01;33m           GST_DEBUG gstinfo.c:1329:for_each_threshold_by_entry:^[[00m category default matches pattern 0x8405570 - gets set to level 5  
0:00:00.000109741 ^[[335m21088^[[00m  0x8405800 ^[[32;01mINFO   ^[[00m ^[[00;01;31m            GST_INIT gst.c:613:init_pre:^[[00m Initializing GStreamer Core Library version 0.10.36  
0:00:00.000123496 ^[[335m21088^[[00m  0x8405800 ^[[32;01mINFO   ^[[00m ^[[00;01;31m            GST_INIT gst.c:614:init_pre:^[[00m Using library installed in /usr/lib/i386-linux-gnu 
Run Code Online (Sandbox Code Playgroud)

Q2 如何删除像 "^[[" 这样的字符并从 GST 开始?

参考文献
发现了一个类似的问题

c c++ logging multithreading gstreamer

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

如何使用 gstreamer 将网络摄像头视频保存到文件?

我一直在尝试让 emgu 将相同的网络摄像头视频保存到文件中

问题是opencv只支持avi,avi好像不太适合X264这样的格式。

我可以使用 Gstreamer 在 C 中为我做这件事吗?

如果我也可以选择文件格式和容器类型就好了。如果我能使用像薛定谔狄拉克这样的格式就好了。

我是 GStreamer 的新手,所以我不太确定我在这里是否走在正确的轨道上。

编辑

我已经设法使用捕获网络摄像头视频

gst-launch-0.10 ksvideosrc !自动视频接收器

现在如何将其转码为 H264 或 dirac 等格式?

编辑

gst-launch-0.10 ksvideosrc num-buffers=10 !解码器2!ffmpeg 色彩空间!x264enc!matroskamux !文件接收器位置=video.mkv

这似乎创建了一个文件,但 VLC 播放器无法读取它。

c opencv avi gstreamer x264

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

Gstreamer理解

Okey的家伙我以为在用gstreamer几天之后我就明白了,我写了一些管道,但是在逻辑上工作但是在保存流到文件时我很头疼.

gst-launch-1.0 rtspsrc location=rstp://ip/url ! decodebin ! textoverlay text="Work you damn thing " ! x264enc ! h264parse ! mp4mux ! filesink location=some_video.mp4
Run Code Online (Sandbox Code Playgroud)

哦,这是我的逻辑:

 1. rtspsrc - has one pad and it's src it outputs x/rtps
 2. decodebin - is a bin (bunch of elements) it has ghost pads and one of those
    sink pads accept x/rtps then on source pad it generates raw video
 4. x264enc - accepts raw video on sink pad and encodes it to a h264 raw …
Run Code Online (Sandbox Code Playgroud)

c python gstreamer

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

Gst-launch:在观看时保存视频流的每个图像

我目前正在尝试使用 gst-launch 将视频流保存到文件中,同时观看视频本身(使用 v4l2src)。到目前为止,我通过使用 ! multifilesink 同时拥有一个 tcl 脚本,它会自动显示 X 窗口中一个文件夹中的最新文件。这有效,但当然有一点我想减少的延迟。

是否有可能仅使用 gst-launch 来做到这一点?不幸的是,我对 gstreamer 不是很有经验。是否可以在使用 multifilesrc 显示文件的同时使用 multifilesink 保存文件?或者只有 gst-launch 是不可能的?

gstreamer v4l2 gst-launch

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

使用gstreamer暂停后如何继续播放?

我为每个 Gstreamer 类型编写了 C++ 包装器。它们简单直观,所以我认为不需要在此处发布它们的实现(尽管我可以在需要时发布它们(也许在 github 上))。

我面临的问题是我开始播放视频(并同时使用 gst tee 元素将其保存到文件中)......在播放时,我暂停(来自不同的线程),效果很好。但是,当我想恢复它时,它不起作用:

void pause()
{
    _pipeline.state(GST_STATE_PAUSED)
}

void resume()
{
    _pipeline.state(GST_STATE_PLAYING);
}
Run Code Online (Sandbox Code Playgroud)

这是play()我创建管道并将其状态设置为 GST_STATE_PLAYING的函数。

int play(std::string const & source_path, std::string const & save_as_file)
{
    gst::element source(source_path.substr(0,4) == "http" ? "souphttpsrc" : "filesrc", "media-source");
    gst::element demuxer("decodebin", "decoder");
    gst::element vconv("videoconvert",  "vconverter");
    gst::element vsink("autovideosink", "video-output");
    gst::element aconv("audioconvert",  "aconverter");
    gst::element asink("autoaudiosink", "audio-output");
    gst::element filesink("filesink", "file-sink");
    gst::element fq("queue", "file-queqe");
    gst::element tee("tee", "media-tee");
    gst::element aq("queue", "audio-queue");
    gst::element vq("queue", "video-queue");

    source.set("location", source_path.c_str());

    gst::bus bus = _pipeline.bus(); …
Run Code Online (Sandbox Code Playgroud)

c++ video gstreamer media-player

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

将图像推送到 Gstreamer 管道

我一直在关注许多关于将图像推送到 Gstreamer 管道的示例,但仍然无法使我的代码工作。

任何建议(除了告诉我尝试使用 Gstreamer1.0 而不是 0.10)将不胜感激。我想了解以下appsrc使用 jpeg 图像提供元素的脚本有什么问题。稍后我将使用相同的代码来提供我从相机获取的 openCv 图像,但首先我想通过使这个简单的示例工作来了解基础知识。

#include <gst/gst.h>
#include <string.h>
#include <cv.h>
#include <highgui.h>
#include <stdio.h>


#define VIDEO_CAPS "video/x-raw-rgb,bpp=8,depth=8,width=640,height=360,framerate=5/1,red_mask=224,green_mask=28,blue_mask=3,endianness=1234;"


/* Structure to contain all our information, so we can pass it to callbacks */
guint64 imagecounter=1;

typedef struct _CustomData {
  GstElement *pipeline, *app_source;
  GstElement *video_convert, *video_sink;
  GstElement *image_manage;
  guint64 num_samples;   /* Number of samples generated so far (for timestamp generation) */

  guint sourceid;        /* To control the GSource */

  GMainLoop *main_loop;  /* GLib's …
Run Code Online (Sandbox Code Playgroud)

c opencv gstreamer

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

如何使用 Gstreamer 播放原始字符 * 缓冲区?

我有从 video.mp4 文件中读取的 char* 缓冲区。此缓冲区的大小为 4096。我尝试从 char* 缓冲区创建 GstBuffer

GstBuffer* Buffer = gst_buffer_new_wrapped(data, size);
dataBuffer = gst_buffer_copy(tmpBuf);
Run Code Online (Sandbox Code Playgroud)

然后我把这个缓冲区推到appsrc

GstElement* source = gst_bin_get_by_name (GST_BIN (consumer), "source");
gst_app_src_push_buffer (GST_APP_SRC (source), dataBuffer);
gst_object_unref (source);
Run Code Online (Sandbox Code Playgroud)

管道消费者是通过以下方式创建的:

gchar* videoConsumerString = g_strdup_printf ("appsrc max-buffers=5 drop=false name=source ! decodebin ! xvimagesink");
consumer = gst_parse_launch (videoConsumerString, NULL);
gst_element_set_state (consumer, GST_STATE_NULL);
g_free (videoConsumerString);
Run Code Online (Sandbox Code Playgroud)

创建管道后,我将其状态设置为 GST_STATE_NULL。当我开始播放时,我将其状态设置为 GST_STATE_PLAYING。

但在外面我得到了错误:

ERROR from element mpegvparse0: No valid frames found before end of stream
Run Code Online (Sandbox Code Playgroud)

我尝试更改 char* 缓冲区的大小,在管道中使用不同的元素(例如 ffmpegcolorspace、videconvert 等),但没有解决此问题。

如果使用 GST_DEBUG=3 …

c++ gstreamer

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

GStreamer-CRITICAL **:gst_element_make_from_uri:断言“ gst_uri_is_valid(uri)”失败

我在使用Python中的OpenCV 3.1的Ubuntu 16.04中。我可以对大量视频运行良好,但是在此特定视频中却失败了。我正在使用XVID进行编码。URI似乎是正确的,所以我在这里茫然不知所措...

下面是完整的错误(我知道可能需要一些上下文,但是为文件提供的路径是正确的。我尝试在其他建议的结尾处末尾加一个空格,但它没有用。

(240, 320, 3)
Converting all images into a video...
v_HandStandPushups_g01_c01
['', 'media', 'pedro', 'actv3', 'UCF101', 'videos', 'HandstandPushups']
Height: 224 Width: 224 FPS: 25.0
/media/pedro/actv3/UCF101/pose/HandstandPushups/v_HandStandPushups_g01_c01_pose.avi
/media/pedro/actv3/UCF101/pose/HandstandPushups/v_HandStandPushups_g01_c01_joints.npy

(python:1923): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
GStreamer Plugin: Embedded video playback halted; module filesink0 reported: Could not open file "/media/pedro/actv3/UCF101/pose/HandstandPushups/v_HandStandPushups_g01_c01_pose.avi" for writing.
GStreamer Plugin: Embedded video playback halted; module filesink0 reported: GStreamer error: state change failed and some element failed to post a proper error message with the reason …
Run Code Online (Sandbox Code Playgroud)

python opencv gstreamer opencv3.1

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