After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794837 - cannot pass arguments to effects with ges-launch-1.0
cannot pass arguments to effects with ges-launch-1.0
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-editing-services
unspecified
Other Linux
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-03-30 10:55 UTC by Antonio Ospite
Modified: 2018-04-14 17:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
command-line-formatter: Refactor to generate the documentation automatically (11.86 KB, patch)
2018-03-30 21:27 UTC, Thibault Saunier
committed Details | Review

Description Antonio Ospite 2018-03-30 10:55:38 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
Comment 1 Thibault Saunier 2018-03-30 12:03:58 UTC
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.
Comment 2 Antonio Ospite 2018-03-30 16:40:20 UTC
(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
Comment 3 Thibault Saunier 2018-03-30 21:27:57 UTC
Created attachment 370358 [details] [review]
command-line-formatter: Refactor to generate the documentation automatically
Comment 4 Thibault Saunier 2018-03-30 21:31:03 UTC
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>
Comment 5 Thibault Saunier 2018-03-30 21:32:20 UTC
Attachment 370358 [details] pushed as 0f486de - command-line-formatter: Refactor to generate the documentation automatically
Comment 6 Antonio Ospite 2018-04-14 14:34:48 UTC
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
Comment 7 Thibault Saunier 2018-04-14 17:55:28 UTC
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.