Tag: gstreamer

gstreamer gst_element_seek在mpeg2ts上非常慢

这是我到目前为止在玩的时候想出来的: case GDK_Up: { gint64 pos_ns, dur_ns, seek_ns; GstFormat format; format = GST_FORMAT_TIME; gst_element_query_duration(pipeline,&format,&dur_ns); gst_element_query_position(pipeline,&format,&pos_ns); g_print (“Time: %” GST_TIME_FORMAT ” / %” GST_TIME_FORMAT “\n”, GST_TIME_ARGS (pos_ns), GST_TIME_ARGS (dur_ns)); seek_ns = pos_ns + 60*GST_SECOND; if (!gst_element_seek (pipeline, 1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT, GST_SEEK_TYPE_SET, seek_ns, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) { g_print (“Seek failed!\n”); } } break; 这是我的管道: pipeline = […]

g_signal_connect“pad-added”不起作用

我正在尝试学习如何在gstreamer中使用动态垫。 所以我尝试添加pad-added信号,这样我就可以在创建元素后收到消息。 但是,我没有收到任何消息。 这是代码: #include static void cb_new_pad (GstElement *element, GstPad *pad, gpointer data) { gchar *name; name = gst_pad_get_name (pad); g_print (“A new pad %s was created\n”, name); g_free (name); /* here, you would setup a new pad link for the newly created pad */ } int main (int argc, char *argv[]) { GstElement […]

如何修复Gstreamer捕获麦克风音频和缓冲或转储为原始文件,当我说它不保存任何东西

我正在尝试捕获麦克风音频并将其另存为文件。 但它不起作用,我只能在分配时播放文件。 如何启用麦克风并将其缓冲或保存或转储为原始.odd / vorbis? #include #include static gboolean bus_call (GstBus *bus, GstMessage *msg, gpointer data) { GMainLoop *loop = (GMainLoop *) data; switch (GST_MESSAGE_TYPE (msg)) { case GST_MESSAGE_EOS: g_print (“End of stream\n”); g_main_loop_quit (loop); break; case GST_MESSAGE_ERROR: { gchar *debug; GError *error; gst_message_parse_error (msg, &error, &debug); g_free (debug); g_printerr (“Error: %s\n”, error->message); g_error_free (error); […]

使用g_object_set / strchr进行分段错误

这行给我一个分段错误 : g_object_set(G_OBJECT(data.udpsrc), “port”, 5000, “caps”, caps, NULL); 哪里 data.udpsrc = gst_element_factory_make(“udpsrc”, “source”); caps = gst_caps_new_empty_simple(“application/x-rtp”); 这是gdb的输出: Program received signal SIGSEGV, Segmentation fault. strchr () at ../ports/sysdeps/arm/armv6/strchr.S:28 28 ../ports/sysdeps/arm/armv6/strchr.S: No such file or directory. (gdb) bt #0 strchr () at ../ports/sysdeps/arm/armv6/strchr.S:28 #1 0x76e618d8 in g_param_spec_pool_lookup () from /usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0 #2 0x76e5c6a4 in g_object_set_valist () from /usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0 […]

如何覆盖GstBin中的handle_message?

试图创建一个子类: mybin.h: #pragma once #include G_BEGIN_DECLS G_DECLARE_DERIVABLE_TYPE(MyBin, my_bin, MY, BIN, GstBin) struct _MyBinClass { GstBinClass parent_class; }; GstElement* my_bin_new(const gchar *name); G_END_DECLS mybin.c: #include “mybin.h” G_DEFINE_TYPE(MyBin, my_bin, GST_TYPE_BIN) static void my_bin_init(MyBin *bin) { } static void my_bin_class_init(MyBinClass *class) { // virtual function overrides go here } GstElement* my_bin_new(const gchar *name) { // ??? } 在my_bin_new()写什么来调用my_bin_class_init() […]

将图像推入Gstreamer管道

我一直在关注将图像推送到Gstreamer管道的许多例子,但我仍然无法使我的代码工作。 任何建议(除了告诉我尝试使用Gstreamer1.0而不是0.10)将非常感激。 我想了解以下脚本中的错误,该脚本使用jpeg图像提供appsrc元素。 稍后我将使用相同的代码来提供我从相机中获取的openCv图像,但首先我想通过使这个简单的示例工作来理解基础知识。 #include #include #include #include #include #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 […]

使用带有c API的gstreamer显示图像

我尝试使用c API执行gstreamer管道来显示图像我使用此gst-launch命令 gst-launch filesrc location=”pluto.jpg” ! jpegdec ! ffmpegcolorspace ! videobalance saturation=0 ! freeze ! ximagesink 当我尝试它它工作正常但当我尝试将其转换为C代码它不起作用有人可以帮助我吗? #include int main(int argc, char *argv[]) { GstElement *pipeline, *jpdec, *imgf, *cod, *source, *sink; GstBus *bus; GstMessage *msg; GstStateChangeReturn ret; /* Initialize GStreamer */ gst_init (&argc, &argv); /* Create the elements */ source = gst_element_factory_make (“filesrc”, “source”); sink […]

Gstreamer1.0:将decodebin链接到video会话

我有以下管道工作正常: gst-launch-1.0 -v filesrc location = / home / Videos / sample_h264.mov! decodebin! video转换! autovideosink 我想写一个C程序来做同样的事情。 所以我将以前的管道转换为以下代码: pipeline = gst_pipeline_new (“video_pipeline”); if (!pipeline) { g_print(“Failed to create the pipeline\n”); return -1; } bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); watch_id = gst_bus_add_watch (bus, bus_call, loop); gst_object_unref (bus); source = gst_element_factory_make (“filesrc”, “file-source”); decoder = gst_element_factory_make (“decodebin”, “standard-decoder”); […]

Gstreamer在iPhone,黑莓,Android,诺基亚? 它会如何表现?

IPhone,Android,Blackberry,Nokia上的Gstreamer。 我们如何使用C或D或Vala语言制作它? 或者我们应该只使用Java还是Lua? 1)Glib移植到iPhone,Android,Blackberry,诺基亚可用吗? 对于Android,有一个提示http://gstreamer.freedesktop.org/wiki/GstreamerAndroid_InstallInstructions 对于iPhone,不知道 诺基亚,不知道 对于黑莓,不知道 希望有人就此主题提出一些答案和反馈。

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

我正在运行gstreamer的示例程序,它是从C ++应用程序作为线程调用的。 已设置GST_DEBUG=*:5级别以捕获所有可能的方案。 该应用程序还在stdout上打印了大量的日志,而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 […]