Skip to content

Instantly share code, notes, and snippets.

@sr105
Created August 2, 2017 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sr105/5a1bb43c98109bb9c798454342168db0 to your computer and use it in GitHub Desktop.
Save sr105/5a1bb43c98109bb9c798454342168db0 to your computer and use it in GitHub Desktop.
static GstEncodingProfile* create_encoding_profile()
{
// At some point, we might want to allow multiple formats etc.
// FIXME: hook up Configure() parameters here
GstEncodingContainerProfile *container;
GstEncodingVideoProfile *video;
GstCaps *caps, *restr;
caps = gst_caps_new_simple("video/quicktime", "variant", G_TYPE_STRING, "iso", NULL);
container = gst_encoding_container_profile_new(NULL, NULL, caps, NULL);
gst_caps_unref(caps);
//caps = gst_caps_new_empty_simple("video/x-h264");
caps = gst_caps_from_string("vaapih264enc");
#ifdef FPS_LIMIT
restr = gst_caps_new_simple("video/x-raw", "framerate", GST_TYPE_FRACTION, FPS_LIMIT, 1, NULL);
#else
restr = NULL;
#endif
video = gst_encoding_video_profile_new(caps, NULL, restr, 1);
gst_caps_unref(caps);
if (restr)
gst_caps_unref(restr);
gst_encoding_container_profile_add_profile(container, GST_ENCODING_PROFILE(video));
return GST_ENCODING_PROFILE(container);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment