summaryrefslogtreecommitdiff
path: root/subprojects/gst-editing-services
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2023-02-16 00:44:04 +0100
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-02-16 18:48:23 +0000
commit4c2bd05fdd06060407fe8319e3f5d62cb69f4e6e (patch)
tree8fb5f72ff81f40681104e34a2c724cb996499c8c /subprojects/gst-editing-services
parentf831b92540ffa23e6ead56c0c9200d380d7aa68b (diff)
downloadgstreamer-4c2bd05fdd06060407fe8319e3f5d62cb69f4e6e.tar.gz
ges-launcher: allow overriding container profile
When constructing an output profile using --profile-from, it is useful to be able to override the top level container profile. Expose a --container-profile option that applies as an override after other methods for constructing an output profile have run. If no other method was used, this will result in an empty top level container. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3977>
Diffstat (limited to 'subprojects/gst-editing-services')
-rw-r--r--subprojects/gst-editing-services/tools/ges-launcher.c45
-rw-r--r--subprojects/gst-editing-services/tools/utils.h1
2 files changed, 46 insertions, 0 deletions
diff --git a/subprojects/gst-editing-services/tools/ges-launcher.c b/subprojects/gst-editing-services/tools/ges-launcher.c
index 23b2cfe3b6..db9ca5a5fc 100644
--- a/subprojects/gst-editing-services/tools/ges-launcher.c
+++ b/subprojects/gst-editing-services/tools/ges-launcher.c
@@ -637,6 +637,44 @@ _set_rendering_details (GESLauncher * self)
return FALSE;
}
+ if (opts->container_profile) {
+ GstEncodingProfile *new_prof;
+ GList *tmp;
+
+ if (!(new_prof = parse_encoding_profile (opts->container_profile))) {
+ gst_printerr ("Failed to parse container profile %s",
+ opts->container_profile);
+ gst_object_unref (prof);
+ return FALSE;
+ }
+
+ if (!GST_IS_ENCODING_CONTAINER_PROFILE (new_prof)) {
+ gst_printerr ("Top level profile should be container profile");
+ gst_object_unref (prof);
+ gst_object_unref (new_prof);
+ return FALSE;
+ }
+
+ if (gst_encoding_container_profile_get_profiles
+ (GST_ENCODING_CONTAINER_PROFILE (new_prof))) {
+ gst_printerr ("--container-profile cannot contain children profiles");
+ gst_object_unref (prof);
+ gst_object_unref (new_prof);
+ return FALSE;
+ }
+
+ for (tmp = (GList *)
+ gst_encoding_container_profile_get_profiles
+ (GST_ENCODING_CONTAINER_PROFILE (prof)); tmp; tmp = tmp->next) {
+ gst_encoding_container_profile_add_profile
+ (GST_ENCODING_CONTAINER_PROFILE (new_prof),
+ GST_ENCODING_PROFILE (gst_encoding_profile_ref (tmp->data)));
+ }
+
+ gst_encoding_profile_unref (prof);
+ prof = new_prof;
+ }
+
gst_print ("\nEncoding details:\n");
gst_print ("================\n");
@@ -1275,6 +1313,11 @@ ges_launcher_get_rendering_option_group (GESLauncherParsedOptions * opts)
"of the rendered output. This will have no effect if no outputuri "
"has been specified.",
"<clip-name>"},
+ {"container-profile", 0, 0, G_OPTION_ARG_STRING, &opts->container_profile,
+ "Set a container profile for rendering. Applies after --format, "
+ "--encoding-profile and profile-from, potentially overriding the "
+ "existing top level container profile",
+ "<container-profile>"},
{"forward-tags", 0, 0, G_OPTION_ARG_NONE, &opts->forward_tags,
"Forward tags from input files to the output",
NULL},
@@ -1327,6 +1370,7 @@ ges_launcher_parse_options (GESLauncher * self,
gboolean owns_ctx = ctx == NULL;
GESLauncherParsedOptions *opts = &self->priv->parsed_options;
gchar *prev_videosink = opts->videosink, *prev_audiosink = opts->audiosink;
+
/* *INDENT-OFF* */
GOptionEntry options[] = {
{"disable-mixing", 0, 0, G_OPTION_ARG_NONE, &opts->disable_mixing,
@@ -1672,6 +1716,7 @@ _finalize (GObject * object)
g_free (opts->format);
g_free (opts->encoding_profile);
g_free (opts->profile_from);
+ g_free (opts->container_profile);
g_free (opts->videosink);
g_free (opts->audiosink);
g_free (opts->video_track_caps);
diff --git a/subprojects/gst-editing-services/tools/utils.h b/subprojects/gst-editing-services/tools/utils.h
index 09ba6f2781..c29979db51 100644
--- a/subprojects/gst-editing-services/tools/utils.h
+++ b/subprojects/gst-editing-services/tools/utils.h
@@ -39,6 +39,7 @@ typedef struct
gchar *outputuri;
gchar *encoding_profile;
gchar *profile_from;
+ gchar *container_profile;
gchar *videosink;
gchar *audiosink;
gboolean list_transitions;