GNOME Bugzilla – Bug 794837
cannot pass arguments to effects with ges-launch-1.0
Last modified: 2018-04-14 17:55:28 UTC
Hi, I wanted to experiment with the videocrop effect from the command line and I do not understand how to pass properties to an effect with ges-launch-1.0 From the help text I get that something like the following should work: ges-launch-1.0 +test-clip smpte s=0 d=2 set-alpha 0.5 +test-clip blink s=0 d=2 +effect "videocrop top=10" but it does not, I get this error: ERROR: Could not create timeline because: Unknown property in --effect: top Also the "d" property seems to be a duplicate and the "e" property seems broken too. Any idea? Thanks, Antonio
This should rather have gone into the mailling list than a bug report as it is a question. What you want to use is: ges-launch-1.0 +test-clip smpte s=0 d=2 set-alpha 0.5 +test-clip blink s=0 d=2 +effect videocrop set-top 10 Arguably your line should work but our parser is not smart enough and this command his how we imagine the feature. > Also the "d" property seems to be a duplicate and the "e" property seems broken too. What do you mean by that, the doc states: * d=, bin-description The description of the effect bin with a gst-launch-style pipeline description. * e=, element-name The name of the element to apply the effect on. So, `e=` is used to specify on what element (GESTimelineElement ie. clip most probably) the and `d=` is the bin description.
(In reply to Thibault Saunier from comment #1) > This should rather have gone into the mailling list than a bug report as it > is a question. > Maybe but I still feel that "something" is not quite how it should be :) > What you want to use is: > > ges-launch-1.0 +test-clip smpte s=0 d=2 set-alpha 0.5 +test-clip blink > s=0 d=2 +effect videocrop set-top 10 > > Arguably your line should work but our parser is not smart enough and this > command his how we imagine the feature. > What confused me was the fact that the help text says "The description of the effect bin with a gst-launch-style pipeline description." The gst-launch-style reference is maybe too optimistic for the time being. And after my mind was set on "gst-launch-style" I overlooked the last line which actually explains how to set properties. > > > Also the "d" property seems to be a duplicate and the "e" property seems broken too. > > What do you mean by that, the doc states: > > * d=, bin-description The description of the effect bin with a > gst-launch-style pipeline description. > * e=, element-name The name of the element to apply the effect on. > > So, `e=` is used to specify on what element (GESTimelineElement ie. clip > most probably) the and `d=` is the bin description. The bin description is already the first argument, so specifying "d" too gives error: $ ges-launch-1.0 +test-clip smpte s=0 d=2 +effect videocrop d=videocrop set-bottom 50 ERROR: Could not create timeline because: Using short and long name at the same time for property: bin-description, which one should I use?! Maybe +effect should not have an explicit "d" property just like +clip does not have an explicit property for the uri. And about the "e" property, is it intended to be used like the following? $ ges-launch-1.0 +test-clip smpte s=0 d=2 name=test0 +test-clip blink s=0 d=2 set-alpha 0.6 +effect videocrop e=test0 set-bottom 50 ERROR: Could not create timeline because: Unknown property in --effect: element-name Thanks, Antonio
Created attachment 370358 [details] [review] command-line-formatter: Refactor to generate the documentation automatically
The documentation was wrong about the -d, it should never have been there. I am now generating the doc which now looks like: Available ges-launch-1.0 commands: +clip <clip uri> - Adds a clip in the timeline. Properties: * name: The name of the clip, can be used as an ID later. * start: The starting position of the clip in the timeline. * duration: The duration of the clip. * inpoint: The inpoint of the clip (time in the input file to start playing from). * track-types: The type of the tracks where the clip should be used (audio or video or audio+video). * layer: The priority of the layer into which the clip should be added. +effect <effect bin description> - Adds an effect as specified by 'bin-description', similar to gst-launch-style pipeline description, without setting properties (see `set-` for information about how to set properties). Properties: * element-name: The name of the element to apply the effect on. * name: The name to be given to the effect. +test-clip <test clip pattern> - Add a test clip in the timeline. Properties: * name: The name of the clip, can be used as an ID later. * start: The starting position of the clip in the timeline. * duration: The duration of the clip. * inpoint: The inpoint of the clip (time in the input file to start playing). * layer: The priority of the layer into which the clip should be added. +title <title text> - Adds a clip in the timeline. Properties: * name: The name of the clip, can be used as an ID later. * start: The starting position of the clip in the timeline. * duration: The duration of the clip. * inpoint: The inpoint of the clip (time in the input file to start playing from). * track-types: The type of the tracks where the clip should be used (audio or video or audio+video). * layer: The priority of the layer into which the clip should be added. set- <property name> <value> - Set a property on the last added element. Any child property that exists on the previously added element can be used as <property name>
Attachment 370358 [details] pushed as 0f486de - command-line-formatter: Refactor to generate the documentation automatically
Thank you Thibault. One last question, the mention to "gst-launch-style pipeline description, without setting properties" seems correct to some extent, as something like this indeed works: ges-launch-1.0 +test-clip smpte s=0 d=2 +effect "videocrop ! rotate" set-top 20 set-bottom 40 set-angle 10 But what would happen in case of different elements which happen to use the same name for properties? For example circle and rotate both have a property called "angle": ges-launch-1.0 +test-clip smpte s=0 d=2 +effect "videocrop ! circle ! rotate" set-top 20 set-bottom 40 set-angle 1 set-angle 1 Is it correct that the property will be set only to the first element in the pipeline which supports that property name? I guess in the last example it is better to use multiple effects anyways, isn't it? Ciao, Antonio
Well, just add several effects in that case, end result will be the exact same :-) When you use code you can specify on what element an property setting should be applied on with the GstRotate::property-name synthax, the command line doesn't allow that, but you still have ways to achieve what you are asking for. So : ges-launch-1.0 +test-clip smpte s=0 d=2 +effect videocrop set-bottom 40 + effect circle set-angle 1 +effect rotate set-angle 1 should work.