gstreamer 接收rtsp存储为h264

  g_message("save to file");
    50                 GstElement * caps = gst_element_factory_make("capsfilter", "filter");
    51                 GstCaps * c = gst_caps_new_simple("video/x-h264",
    52                         "stream-format", G_TYPE_STRING, "byte-stream",
    53                         NULL);
    54                 g_object_set(caps, "caps", c, NULL);
    55                 
    56                 GstElement * filesink = gst_element_factory_make("filesink", "filesink");
    57                 g_object_set(filesink, "location", "/opt/test.h264", NULL);
    58                 gst_bin_add_many(GST_BIN(pipeline()), caps, filesink, NULL);
    59                 gboolean ok = gst_element_link_many(video_tee, caps, filesink, NULL);
    60                 g_warn_if_fail(ok);
原文地址:https://www.cnblogs.com/missmzt/p/8946092.html