首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Gstreamer无RTP

Gstreamer无RTP
EN

Stack Overflow用户
提问于 2016-06-24 07:28:38
回答 1查看 702关注 0票数 1

我尝试使用最新的Gstreamer 1.8.0编译静态二进制文件。我想要不启动RTSP流并将其放入文件中。管道是:

代码语言:javascript
复制
rtspsrc location=rtsp://X.X.X.X/ protocols=GST_RTSP_LOWER_TRANS_TCP ! queue ! rtph264depay ! h264parse ! flvmux  name=\"mux\" streamable=\"true\" ! fakesink

运行编译后的二进制文件会导致错误:

RTP反加载gstrtpbasedepayload.c:484:gst_rtp_base_depayload_handle_buffer:[00m错误:未协商RTP格式。

代码语言:javascript
复制
int main(int argc, char *argv[]) {
  GstElement *pipeline;
  GstBus *bus;
  GstStateChangeReturn ret;
  GMainLoop *main_loop;
  CustomData data;

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

  /* Initialize our data structure */
  memset (&data, 0, sizeof (data));

  /* Build the pipeline */

  pipeline = gst_parse_launch ("rtspsrc location=rtsp://X.X.X.X/ protocols=GST_RTSP_LOWER_TRANS_TCP ! queue ! rtph264depay ! h264parse ! flvmux  name=\"mux\" streamable=\"true\" ! fakesink", NULL);

  bus = gst_element_get_bus (pipeline);

  /* Start playing */
  ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
  if (ret == GST_STATE_CHANGE_FAILURE) {
    g_printerr ("Unable to set the pipeline to the playing state.\n");
    gst_object_unref (pipeline);
    return -1;
  } else if (ret == GST_STATE_CHANGE_NO_PREROLL) {
    data.is_live = TRUE;
  }

  main_loop = g_main_loop_new (NULL, FALSE);
  data.loop = main_loop;
  data.pipeline = pipeline;

  gst_bus_add_signal_watch (bus);
  g_signal_connect (bus, "message", G_CALLBACK (cb_message), &data);

  g_main_loop_run (main_loop);

  /* Free resources */
  g_main_loop_unref (main_loop);
  gst_object_unref (bus);
  gst_element_set_state (pipeline, GST_STATE_NULL);
  gst_object_unref (pipeline);
  return 0;
}

完整输出:http://pastebin.com/Ln06d0iP

因为源是带有SDP数据的RTSP -我不需要手动设置上限。使用GStreamer0.10运行这个管道的部分很有趣。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-06-26 06:17:22

我自己修的。如果你不直接在管道中使用插件,Gstreamer不会抱怨缺少插件。插件的静态注册,udp和rtpmanager解决了这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38007896

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档