How to segment seek in dynamic pipeline

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

How to segment seek in dynamic pipeline

xmufzy
Hello, I'm a newbie for Gstreamer
I need implement a pipeline for join server segment of video to one file,
the pipeline like this


Stage0:

pipeline:
filesrc(backgroup.mp4) --> qtdemux --> h264dec --> queue --> x264enc -->
filesink

```cpp
g_assert(gst_element_seek (demux_bg,
                  1.0, GST_FORMAT_TIME,
                  GstSeekFlags(GST_SEEK_FLAG_ACCURATE| GST_SEEK_FLAG_SEGMENT
|GST_SEEK_FLAG_FLUSH| GST_SEEK_FLAG_TRICKMODE),
                  GST_SEEK_TYPE_SET,  3 * GST_SECOND,
                  GST_SEEK_TYPE_SET, (3
+g_elements.stage_dua[0])*GST_SECOND)==true);
```

Stage1:

pipeline change  :
filesrc(backgroup.mp4) --> qtdemux --> h264dec --> queue --\
                                                            --> mixer -->
x264enc --> filesink
filesrc(fga.mp4) --> qtdemux --> h264dec -->queue ---------/

```cpp
g_assert(gst_element_seek (g_elements.demux_bg,
                  1.0, GST_FORMAT_TIME,
                  GstSeekFlags(GST_SEEK_FLAG_ACCURATE |
GST_SEEK_FLAG_SEGMENT| GST_SEEK_FLAG_TRICKMODE),
                  GST_SEEK_TYPE_SET, 5 * GST_SECOND,
                  GST_SEEK_TYPE_SET, (5+g_elements.stage_dua[1]) *
GST_SECOND)==true);
g_assert(gst_element_seek (g_elements.demux_fga,
                  1.0, GST_FORMAT_TIME,
                  GstSeekFlags(GST_SEEK_FLAG_ACCURATE|
GST_SEEK_FLAG_SEGMENT| GST_SEEK_FLAG_TRICKMODE),
                  GST_SEEK_TYPE_SET,  1 * GST_SECOND,
                  GST_SEEK_TYPE_SET, (1+g_elements.stage_dua[1]) *
GST_SECOND)==true);
```
Stage2:
pipeline change  :

filesrc(backgroup.mp4) --> qtdemux --> h264dec --> queue --\
                                                            --> mixer -->
x264enc --> filesink
filesrc(fga.mp4) --> qtdemux --> h264dec -->queue ---------//
filesrc(fgb.mp4) --> qtdemux --> h264dec -->queue ---------/

```cpp
g_assert(gst_element_seek (g_elements.demux_bg,
                  1.0, GST_FORMAT_TIME,
                  GstSeekFlags(GST_SEEK_FLAG_ACCURATE
|GST_SEEK_FLAG_SEGMENT| GST_SEEK_FLAG_TRICKMODE),
                  GST_SEEK_TYPE_SET,  2 * GST_SECOND,

                  GST_SEEK_TYPE_SET, (2+g_elements.stage_dua[2]) *
GST_SECOND)==true);
g_assert(gst_element_seek (g_elements.demux_fga,
                  1.0, GST_FORMAT_TIME,
                  GstSeekFlags(GST_SEEK_FLAG_ACCURATE
|GST_SEEK_FLAG_SEGMENT| GST_SEEK_FLAG_TRICKMODE),
                  GST_SEEK_TYPE_SET, 6 * GST_SECOND,
                  GST_SEEK_TYPE_SET, (6+g_elements.stage_dua[2]) *
GST_SECOND)==true);
g_assert(gst_element_seek (g_elements.demux_shoe,
                  1.0, GST_FORMAT_TIME,
                  GstSeekFlags(GST_SEEK_FLAG_ACCURATE| GST_SEEK_FLAG_SEGMENT
|  GST_SEEK_FLAG_TRICKMODE),
                  GST_SEEK_TYPE_SET, 9 * GST_SECOND,
                  GST_SEEK_TYPE_SET, (9+g_elements.stage_dua[2]) *
GST_SECOND)==true);


The pipeline can't work.

Thank you.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

xmufzy
For stage 0, it work fine.
1. When receive segment done after stage 0, I send a eos event to qtdemux
sink pad, and block in queue sink pad, then unlink h264dec and queue, and
change the pipeline to stage1, then do segment seek for demux_bg and
demux_fga and set the pad offset



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

xmufzy
In reply to this post by xmufzy
If we can do 2 segment seek for the element


pipeline change  :
filesrc(backgroup.mp4) --> qtdemux --> h264dec --> queue --\
                                                                                         
--> mixer -->x264enc --> filesink
filesrc(fga.mp4) --> qtdemux --> h264dec -->queue ---------/

if I need mix fga.mp4 3~8s, and backgroup.mp4 9~14s, I try to use 2
gst_element_seek(SEGMENT)  for that, but failed




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

Nicolas Dufresne-5
Le jeudi 27 août 2020 à 08:14 -0500, xmufzy a écrit :

> If we can do 2 segment seek for the element
>
>
> pipeline change  :
> filesrc(backgroup.mp4) --> qtdemux --> h264dec --> queue --\
>                                                                                          
> --> mixer -->x264enc --> filesink
> filesrc(fga.mp4) --> qtdemux --> h264dec -->queue ---------/
>
> if I need mix fga.mp4 3~8s, and backgroup.mp4 9~14s, I try to use 2
> gst_element_seek(SEGMENT)  for that, but failed

This is easier done with ges-launch-1.0 (from gst-editing-services).

ges-launch-1.0 +clip background.mp4 inpoint=9.0 duration=5.0 \
               +clip fga.mp4 inpoint=3.0 duration=5.0 \
               --smart-rendering --outputuri=file:///tmp/test.mp4

You can live preview the edit by removing the render options (last
line).

>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

xmufzy
Thank you , I known it's easier with ges, but I don't known how to change the
encoder to nvenc, and hown can I export the data from ges to app sink, or
import data from appsrc.

Nicolas Dufresne-5 wrote

> Le jeudi 27 août 2020 à 08:14 -0500, xmufzy a écrit :
>> If we can do 2 segment seek for the element
>>
>>
>> pipeline change  :
>> filesrc(backgroup.mp4) --> qtdemux --> h264dec --> queue --\
>>                                                                                          
>> --> mixer -->x264enc --> filesink
>> filesrc(fga.mp4) --> qtdemux --> h264dec -->queue ---------/
>>
>> if I need mix fga.mp4 3~8s, and backgroup.mp4 9~14s, I try to use 2
>> gst_element_seek(SEGMENT)  for that, but failed
>
> This is easier done with ges-launch-1.0 (from gst-editing-services).
>
> ges-launch-1.0 +clip background.mp4 inpoint=9.0 duration=5.0 \
>                +clip fga.mp4 inpoint=3.0 duration=5.0 \
>                --smart-rendering --outputuri=file:///tmp/test.mp4
>
> You can live preview the edit by removing the render options (last
> line).
>
>>
>>
>>
>>
>> --
>> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
>> _______________________________________________
>> gstreamer-devel mailing list
>>

> gstreamer-devel@.freedesktop

>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel@.freedesktop

> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

Thibault Saunier-4
Hi,

On Sun, Aug 30, 2020 at 9:57 PM xmufzy <[hidden email]> wrote:
Thank you , I known it's easier with ges, but I don't known how to change the
encoder to nvenc, and hown can I export the data from ges to app sink, or
import data from appsrc.

You can check the EncodingProfile[0] API to enforce a certain encoder, on the command line you could even do for example `video/quicktime:nvenc:audio/x-opus`.

You can set your sinks as you would do with `playbin` if you use GESPipeline, or you can use GESTimeline as any bin if you need more control. For appsrc you can use the `appsrc://` protocol for your clips and then work from there, or you can subclass `GES[Video|Audio]Source` to implement exactly what you need.

- Thibault

 
Nicolas Dufresne-5 wrote
> Le jeudi 27 août 2020 à 08:14 -0500, xmufzy a écrit :
>> If we can do 2 segment seek for the element
>>
>>
>> pipeline change  :
>> filesrc(backgroup.mp4) --> qtdemux --> h264dec --> queue --\
>>                                                                                         
>> --> mixer -->x264enc --> filesink
>> filesrc(fga.mp4) --> qtdemux --> h264dec -->queue ---------/
>>
>> if I need mix fga.mp4 3~8s, and backgroup.mp4 9~14s, I try to use 2
>> gst_element_seek(SEGMENT)  for that, but failed
>
> This is easier done with ges-launch-1.0 (from gst-editing-services).
>
> ges-launch-1.0 +clip background.mp4 inpoint=9.0 duration=5.0 \
>                +clip fga.mp4 inpoint=3.0 duration=5.0 \
>                --smart-rendering --outputuri=file:///tmp/test.mp4
>
> You can live preview the edit by removing the render options (last
> line).
>
>>
>>
>>
>>
>> --
>> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
>> _______________________________________________
>> gstreamer-devel mailing list
>>

> gstreamer-devel@.freedesktop

>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel@.freedesktop

> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

xmufzy
Thank you, I try like this:
ges-launch-1.0  \
    +clip ./poc_backgroup.mp4  layer=2 \
    +clip ./poc_backgroup.mp4  inpoint=2 duration=3  layer=1 set-posx 100
set-posy 100 set-width 200 set-height 200 +effect "agingtv" \
    +clip ./shoe.mp4  inpoint=7  duration=2  layer=0 set-posx 400 set-posy
400 set-width 200 set-height 200 \
    --outputuri=file:////home/qingfu.cqf/gst-poc/hi.mp4  -e
video/quicktime:x264enc:audio/x-opus
It worked fine.

I have some other queuestion:
1.How can I use nvdec for decoder?
2. I need to implement some filter between clips, such as clip 1's alpha
change from 255 -> 0 and clip 2's alpha change from 0 -> 255 in 3 seconds,
how can I do that by ges?
3. for appsrc:// do you have some more example? I don't understand .

After some tests, I find that I can't use gst_element_seek() for seek for
multiple input souce,
Maybe I can use gessrc as a gstelement to build the pipeline? such as:

gessrc(backgroup.mp4 9-15s) -- \
                                                  -------------> mixer
-->encoder...                                                  
gessrc(fga.mp4 3-8s)             --- /





Thibault Saunier-4 wrote
> Hi,
>
> On Sun, Aug 30, 2020 at 9:57 PM xmufzy &lt;

> xmufzy@

> &gt; wrote:
>
>> Thank you , I known it's easier with ges, but I don't known how to change
>> the
>> encoder to nvenc, and hown can I export the data from ges to app sink, or
>> import data from appsrc.
>>
>
> You can check the EncodingProfile[0] API to enforce a certain encoder, on
> the command line you could even do for example
> `video/quicktime:nvenc:audio/x-opus`.
>
> You can set your sinks as you would do with `playbin` if you use
> GESPipeline, or you can use GESTimeline as any bin if you need more
> control. For appsrc you can use the `appsrc://` protocol for your clips
> and
> then work from there, or you can subclass `GES[Video|Audio]Source` to
> implement exactly what you need.
>
> - Thibault
>
> [0]
> https://gstreamer.freedesktop.org/documentation/pbutils/encoding-profile.html
>
>
>> Nicolas Dufresne-5 wrote
>> > Le jeudi 27 août 2020 à 08:14 -0500, xmufzy a écrit :
>> >> If we can do 2 segment seek for the element
>> >>
>> >>
>> >> pipeline change  :
>> >> filesrc(backgroup.mp4) --> qtdemux --> h264dec --> queue --\
>> >>
>>
>> >> --> mixer -->x264enc --> filesink
>> >> filesrc(fga.mp4) --> qtdemux --> h264dec -->queue ---------/
>> >>
>> >> if I need mix fga.mp4 3~8s, and backgroup.mp4 9~14s, I try to use 2
>> >> gst_element_seek(SEGMENT)  for that, but failed
>> >
>> > This is easier done with ges-launch-1.0 (from gst-editing-services).
>> >
>> > ges-launch-1.0 +clip background.mp4 inpoint=9.0 duration=5.0 \
>> >                +clip fga.mp4 inpoint=3.0 duration=5.0 \
>> >                --smart-rendering --outputuri=file:///tmp/test.mp4
>> >
>> > You can live preview the edit by removing the render options (last
>> > line).
>> >
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
>> >> _______________________________________________
>> >> gstreamer-devel mailing list
>> >>
>>
>> > gstreamer-devel@.freedesktop
>>
>> >> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>> >
>> > _______________________________________________
>> > gstreamer-devel mailing list
>>
>> > gstreamer-devel@.freedesktop
>>
>> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>>
>>
>>
>>
>> --
>> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
>> _______________________________________________
>> gstreamer-devel mailing list
>>

> gstreamer-devel@.freedesktop

>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel@.freedesktop

> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

xmufzy
In reply to this post by Thibault Saunier-4
Hi,
I try with ges in c codes, the follow code would segmentation fault, but if
I add a new layer for each clip, it'll work fine, what's the problem?
And from examples/c/transition.c I find that I can only add transition for
single layer, is it right?

    priority=2;
    gchar *uri = gst_filename_to_uri ("./poc_backgroup.mp4", NULL);
    GESUriClip *src = ges_uri_clip_new (uri);
    g_assert (src);
    g_free (uri);
    //g_object_set (layer, "priority",priority,NULL);
    g_object_set (src, "start",offset, "priority",priority,NULL);
    ges_layer_add_clip (layer, (GESClip *) src);

    //layer = ges_layer_new ();
    //if (!ges_timeline_add_layer (timeline, layer))
    //    return -1;
    offset+=2*GST_SECOND;
    inpoint=3*GST_SECOND;
    duration=9*GST_SECOND;
    priority=1;
    uri = gst_filename_to_uri ("./poc_backgroup.mp4", NULL);
    src = ges_uri_clip_new (uri);
    g_assert (src);
    g_free (uri);
    g_object_set (src, "start",offset,"in-point", inpoint,"duration" ,
duration, "priority",priority,NULL);
    ges_layer_add_clip (layer, (GESClip *) src);
    ges_timeline_element_set_child_properties (GES_TIMELINE_ELEMENT
((GESClip*)src), "posx", 100, "posy", 100, "width",200,"height",200, NULL);






--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

Thibault Saunier-4
In reply to this post by xmufzy
Hi,

answering in-line.

Thank you, I try like this:
ges-launch-1.0  \
    +clip ./poc_backgroup.mp4  layer=2 \
    +clip ./poc_backgroup.mp4  inpoint=2 duration=3  layer=1 set-posx 100
set-posy 100 set-width 200 set-height 200 +effect "agingtv" \
    +clip ./shoe.mp4  inpoint=7  duration=2  layer=0 set-posx 400 set-posy
400 set-width 200 set-height 200 \
    --outputuri=file:////home/qingfu.cqf/gst-poc/hi.mp4  -e
video/quicktime:x264enc:audio/x-opus
It worked fine.

I have some other queuestion:
1.How can I use nvdec for decoder?

Well, you should make sure it has the highest rank so it is picked.
 
2. I need to implement some filter between clips, such as clip 1's alpha
change from 255 -> 0 and clip 2's alpha change from 0 -> 255 in 3 seconds,
how can I do that by ges?

You can interpolate the `alpha` child property of the video source, you can find an example here:

 
3. for appsrc:// do you have some more example? I don't understand .

I do not think we have an example for that but it is doable.
 
After some tests, I find that I can't use gst_element_seek() for seek for
multiple input souce,
Maybe I can use gessrc as a gstelement to build the pipeline? such as:

gessrc(backgroup.mp4 9-15s) -- \
                                                  -------------> mixer
-->encoder...                                                 
gessrc(fga.mp4 3-8s)             --- /

GES mixes the layers, so if I understand correctly what you are trying to do, what you want is something like:

```
ges-launch-1.0 \
    +clip fga.mp4 inpoint=3.0 duration=5.0 layer=0 # foreground layer \
    +clip background.mp4 inpoint=9.0 duration=6.0 layer=1 # background layer
 ```

You will need to write a small program to replicate that timeline to be able to interpolate the alpha.

- Thibault

Thibault Saunier-4 wrote
> Hi,
>
> On Sun, Aug 30, 2020 at 9:57 PM xmufzy &lt;

> xmufzy@

> &gt; wrote:
>
>> Thank you , I known it's easier with ges, but I don't known how to change
>> the
>> encoder to nvenc, and hown can I export the data from ges to app sink, or
>> import data from appsrc.
>>
>
> You can check the EncodingProfile[0] API to enforce a certain encoder, on
> the command line you could even do for example
> `video/quicktime:nvenc:audio/x-opus`.
>
> You can set your sinks as you would do with `playbin` if you use
> GESPipeline, or you can use GESTimeline as any bin if you need more
> control. For appsrc you can use the `appsrc://` protocol for your clips
> and
> then work from there, or you can subclass `GES[Video|Audio]Source` to
> implement exactly what you need.
>
> - Thibault
>
> [0]
> https://gstreamer.freedesktop.org/documentation/pbutils/encoding-profile.html
>
>
>> Nicolas Dufresne-5 wrote
>> > Le jeudi 27 août 2020 à 08:14 -0500, xmufzy a écrit :
>> >> If we can do 2 segment seek for the element
>> >>
>> >>
>> >> pipeline change  :
>> >> filesrc(backgroup.mp4) --> qtdemux --> h264dec --> queue --\
>> >>
>>
>> >> --> mixer -->x264enc --> filesink
>> >> filesrc(fga.mp4) --> qtdemux --> h264dec -->queue ---------/
>> >>
>> >> if I need mix fga.mp4 3~8s, and backgroup.mp4 9~14s, I try to use 2
>> >> gst_element_seek(SEGMENT)  for that, but failed
>> >
>> > This is easier done with ges-launch-1.0 (from gst-editing-services).
>> >
>> > ges-launch-1.0 +clip background.mp4 inpoint=9.0 duration=5.0 \
>> >                +clip fga.mp4 inpoint=3.0 duration=5.0 \
>> >                --smart-rendering --outputuri=file:///tmp/test.mp4
>> >
>> > You can live preview the edit by removing the render options (last
>> > line).
>> >
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
>> >> _______________________________________________
>> >> gstreamer-devel mailing list
>> >>
>>
>> > gstreamer-devel@.freedesktop
>>
>> >> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>> >
>> > _______________________________________________
>> > gstreamer-devel mailing list
>>
>> > gstreamer-devel@.freedesktop
>>
>> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>>
>>
>>
>>
>> --
>> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
>> _______________________________________________
>> gstreamer-devel mailing list
>>

> gstreamer-devel@.freedesktop

>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel@.freedesktop

> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

Thibault Saunier-4
In reply to this post by xmufzy
Hi,

You should obviously be able to have several clips on a single layer, please provide a backtrace if you get a segfault.

Note that you should use `ges_timeline_append_layer` and do not take care of setting layer priority which is now deprecated.

Transition can happen only on a single layer, also you should use the timeline `auto-transition` option so the feature is much more simple to use (and usually does the right thing).

If you want to create a crossfade between layers you can interpolate the `alpha` child property of the video source as explained in a previous mail.

- Thibault

On Tue, Sep 1, 2020 at 10:39 AM xmufzy <[hidden email]> wrote:
Hi,
I try with ges in c codes, the follow code would segmentation fault, but if
I add a new layer for each clip, it'll work fine, what's the problem?
And from examples/c/transition.c I find that I can only add transition for
single layer, is it right?

    priority=2;
    gchar *uri = gst_filename_to_uri ("./poc_backgroup.mp4", NULL);
    GESUriClip *src = ges_uri_clip_new (uri);
    g_assert (src);
    g_free (uri);
    //g_object_set (layer, "priority",priority,NULL);
    g_object_set (src, "start",offset, "priority",priority,NULL);
    ges_layer_add_clip (layer, (GESClip *) src);

    //layer = ges_layer_new ();
    //if (!ges_timeline_add_layer (timeline, layer))
    //    return -1;
    offset+=2*GST_SECOND;
    inpoint=3*GST_SECOND;
    duration=9*GST_SECOND;
    priority=1;
    uri = gst_filename_to_uri ("./poc_backgroup.mp4", NULL);
    src = ges_uri_clip_new (uri);
    g_assert (src);
    g_free (uri);
    g_object_set (src, "start",offset,"in-point", inpoint,"duration" ,
duration, "priority",priority,NULL);
    ges_layer_add_clip (layer, (GESClip *) src);
    ges_timeline_element_set_child_properties (GES_TIMELINE_ELEMENT
((GESClip*)src), "posx", 100, "posy", 100, "width",200,"height",200, NULL);






--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

xmufzy
Well, the problem is I failed to add a new clip to the layer, So I need to
follow the overlap rule


0:00:00.082988805 31704       0x622200 INFO        GST_ELEMENT_PADS
gstelement.c:752:gst_element_add_pad:<videosrcbin> adding pad 'src'
0:00:00.082991746 31704       0x622200 INFO        GST_ELEMENT_PADS
gstelement.c:999:gst_element_get_static_pad: found pad queue1:sink
0:00:00.083017675 31704       0x622200 INFO                GST_PADS
gstpad.c:4309:gst_pad_peer_query:<queue1:sink> pad has no peer
0:00:00.083715742 31704       0x622200 INFO                GST_PADS
gstpad.c:2378:gst_pad_link_prepare: trying to link videosrcbin:src and
src:proxypad19
0:00:00.083722877 31704       0x622200 INFO                GST_PADS
gstpad.c:2586:gst_pad_link_full: linked videosrcbin:src and src:proxypad19,
successful
0:00:00.083725022 31704       0x622200 INFO               GST_EVENT
gstevent.c:1610:gst_event_new_reconfigure: creating reconfigure event
0:00:00.083728769 31704       0x622200 INFO               GST_EVENT
gstpad.c:5891:gst_pad_send_event_unchecked:<track-element-capsfilter:src>
Received event on flushing pad.
Discarding
0:00:00.083787272 31704       0x622200 INFO          nlecomposition
nlecomposition.c:884:_add_action_locked:<video_nlecomposition1> Adding
Action for function: 0x8d92c0:_add_object_func
0:00:00.083802242 31704       0x622200 INFO                 gestree
ges-timeline-tree.c:1007:set_edit_move_values:<GESVideoUriSource@0x8c2390>
videourisource1 will move by setting start to 0:00:02.000000000
0:00:00.083808188 31704       0x622200 INFO                 gestree
ges-timeline-tree.c:1236:set_edit_trim_end_values:<GESVideoUriSource@0x8c2390>
videourisource1 will trim end by setting duration to 0:00:09.000000000
0:00:00.083820383 31704       0x622200 INFO                 gestree
ges-timeline-tree.c:753:check_overlap_with_element: videourisource1 (under
uriclip1) [0:00:02.000000000 -
0:00:11.000000000] (layer: 0) (track :<gesvideotrack0>) and videourisource0
(under uriclip0) [0:00:00.000000000 - 0:00:12.000000000] (layer: 0) (track
:<gesvideotrack0>) fully overlap
0:00:00.083834717 31704       0x622200 INFO                     ges
ges-track.c:1218:ges_track_add_element_full:<gesvideotrack0> Could not add
the track element videourisource1<0x8c2390> [ 0:00:02.000000000
(0:00:03.000000000) - 0:00:09.000000000(0:00:12.000000000) layer: 0]  to the
track because it breaks the timeline configuration rules
0:00:00.083847483 31704       0x622200 INFO          nlecomposition
nlecomposition.c:884:_add_action_locked:<video_nlecomposition1> Adding
Action for function: 0x8d8080:_remove_object_func
0:00:00.083857936 31704       0x622200 INFO                     ges
ges-clip.c:4491:ges_clip_add_child_to_track:<GESUriClip@0x8c05a0> Could not
add the track element videourisource1<0x8c2390> [ 0:00:02.000000000
(0:00:03.000000000) - 0:00:09.000000000(0:00:12.000000000) layer: 0]  to the
track <gesvideotrack0>
0:00:00.083877078 31704       0x622200 INFO                     ges
ges-layer.c:779:ges_layer_add_clip_full:<GESLayer@0x8856e0> Could not add
the clip uriclip1<0x8c05a0> [ 0:00:02.000000000 (0:00:03.000000000) -
0:00:09.000000000(0:00:12.000000000) layer: 0]  to the timeline
<gestimeline0>
0:00:00.083886577 31704       0x622200 WARN                     ges
ges-layer.c:787:ges_layer_add_clip_full:<gestimeline0> Adding the clip
uriclip1<0x8c05a0> [ 0:00:02.000000000 (0:00:03.000000000) -
0:00:09.000000000(0:00:12.000000000) layer: 0]  to the timeline failed: The
source "videourisource0" (parent: "uriclip0") would totally overlap the
source "videourisource1" (parent: "uriclip1") in the track "gesvideotrack0"
**
ERROR:./poc_ges.cpp:108:int main(int, gchar**): assertion failed:
(ges_layer_add_clip (layer, src))
Bail out! ERROR:./poc_ges.cpp:108:int main(int, gchar**): assertion failed:
(ges_layer_add_clip (layer, src))




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

Thibault Saunier-4
Hi,

I see, and the rule is pretty straight forward, 2 clips can't fully overlap in a layer.

- Thibault

On Tue, Sep 1, 2020 at 10:39 PM xmufzy <[hidden email]> wrote:
Well, the problem is I failed to add a new clip to the layer, So I need to
follow the overlap rule


0:00:00.082988805 31704       0x622200 INFO        GST_ELEMENT_PADS
gstelement.c:752:gst_element_add_pad:<videosrcbin> adding pad 'src'
0:00:00.082991746 31704       0x622200 INFO        GST_ELEMENT_PADS
gstelement.c:999:gst_element_get_static_pad: found pad queue1:sink
0:00:00.083017675 31704       0x622200 INFO                GST_PADS
gstpad.c:4309:gst_pad_peer_query:<queue1:sink> pad has no peer
0:00:00.083715742 31704       0x622200 INFO                GST_PADS
gstpad.c:2378:gst_pad_link_prepare: trying to link videosrcbin:src and
src:proxypad19
0:00:00.083722877 31704       0x622200 INFO                GST_PADS
gstpad.c:2586:gst_pad_link_full: linked videosrcbin:src and src:proxypad19,
successful
0:00:00.083725022 31704       0x622200 INFO               GST_EVENT
gstevent.c:1610:gst_event_new_reconfigure: creating reconfigure event
0:00:00.083728769 31704       0x622200 INFO               GST_EVENT
gstpad.c:5891:gst_pad_send_event_unchecked:<track-element-capsfilter:src>
Received event on flushing pad.
Discarding
0:00:00.083787272 31704       0x622200 INFO          nlecomposition
nlecomposition.c:884:_add_action_locked:<video_nlecomposition1> Adding
Action for function: 0x8d92c0:_add_object_func
0:00:00.083802242 31704       0x622200 INFO                 gestree
ges-timeline-tree.c:1007:set_edit_move_values:<GESVideoUriSource@0x8c2390>
videourisource1 will move by setting start to 0:00:02.000000000
0:00:00.083808188 31704       0x622200 INFO                 gestree
ges-timeline-tree.c:1236:set_edit_trim_end_values:<GESVideoUriSource@0x8c2390>
videourisource1 will trim end by setting duration to 0:00:09.000000000
0:00:00.083820383 31704       0x622200 INFO                 gestree
ges-timeline-tree.c:753:check_overlap_with_element: videourisource1 (under
uriclip1) [0:00:02.000000000 -
0:00:11.000000000] (layer: 0) (track :<gesvideotrack0>) and videourisource0
(under uriclip0) [0:00:00.000000000 - 0:00:12.000000000] (layer: 0) (track
:<gesvideotrack0>) fully overlap
0:00:00.083834717 31704       0x622200 INFO                     ges
ges-track.c:1218:ges_track_add_element_full:<gesvideotrack0> Could not add
the track element videourisource1<0x8c2390> [ 0:00:02.000000000
(0:00:03.000000000) - 0:00:09.000000000(0:00:12.000000000) layer: 0]  to the
track because it breaks the timeline configuration rules
0:00:00.083847483 31704       0x622200 INFO          nlecomposition
nlecomposition.c:884:_add_action_locked:<video_nlecomposition1> Adding
Action for function: 0x8d8080:_remove_object_func
0:00:00.083857936 31704       0x622200 INFO                     ges
ges-clip.c:4491:ges_clip_add_child_to_track:<GESUriClip@0x8c05a0> Could not
add the track element videourisource1<0x8c2390> [ 0:00:02.000000000
(0:00:03.000000000) - 0:00:09.000000000(0:00:12.000000000) layer: 0]  to the
track <gesvideotrack0>
0:00:00.083877078 31704       0x622200 INFO                     ges
ges-layer.c:779:ges_layer_add_clip_full:<GESLayer@0x8856e0> Could not add
the clip uriclip1<0x8c05a0> [ 0:00:02.000000000 (0:00:03.000000000) -
0:00:09.000000000(0:00:12.000000000) layer: 0]  to the timeline
<gestimeline0>
0:00:00.083886577 31704       0x622200 WARN                     ges
ges-layer.c:787:ges_layer_add_clip_full:<gestimeline0> Adding the clip
uriclip1<0x8c05a0> [ 0:00:02.000000000 (0:00:03.000000000) -
0:00:09.000000000(0:00:12.000000000) layer: 0]  to the timeline failed: The
source "videourisource0" (parent: "uriclip0") would totally overlap the
source "videourisource1" (parent: "uriclip1") in the track "gesvideotrack0"
**
ERROR:./poc_ges.cpp:108:int main(int, gchar**): assertion failed:
(ges_layer_add_clip (layer, src))
Bail out! ERROR:./poc_ges.cpp:108:int main(int, gchar**): assertion failed:
(ges_layer_add_clip (layer, src))




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

xmufzy
Got it!
I try to add a transition, but the program hunged, if I remove the
transition codes , it worked.
the code:


    //clip1[3:6]
    offset=3*GST_SECOND;
    inpoint=5*GST_SECOND;
    duration=3*GST_SECOND;
    priority=0;
    uri = gst_filename_to_uri ("./shoe.mp4", NULL);
    src = GES_CLIP(ges_uri_clip_new (uri));
    g_assert (src);
    g_free (uri);
    g_object_set (src, "start",offset,"in-point", inpoint,"duration" ,
duration, "priority",priority,NULL);
    g_assert(ges_layer_add_clip (layer,  src));
    ges_timeline_element_set_child_properties (GES_TIMELINE_ELEMENT (src),
"posx", 400, "posy", 400, "width",200,"height",200, NULL);

    // add a transition code here
    GESTransitionClip *tr ;
    if (!(tr = ges_transition_clip_new_for_nick ( "crossfade")))
      g_error ("invalid transition type \n");

    g_object_set (tr, "start", (guint64) 6*GST_SECOND, "duration", (guint64)
2*GST_SECOND, "in-point", (guint64) 0, NULL);
    g_assert(ges_layer_add_clip (layer, GES_CLIP (tr)));

    //clip2 [8:11]
    offset=8*GST_SECOND;
    inpoint=3*GST_SECOND;
    duration=3*GST_SECOND;
    priority=1;
    uri = gst_filename_to_uri ("./poc_backgroup.mp4", NULL);
    src = GES_CLIP(ges_uri_clip_new (uri));
    g_assert (src);
    g_free (uri);
    g_object_set (src, "start",offset,"in-point", inpoint,"duration" ,
duration, "priority",priority,NULL);
    g_assert(ges_layer_add_clip (layer, src));
    ges_timeline_element_set_child_properties (GES_TIMELINE_ELEMENT (src),
"posx", 400, "posy", 400, "width",200,"height",200, NULL);




0:00:01.716036859 159716 0x7f2f8c0018a0 INFO           basetransform
gstbasetransform.c:1320:gst_base_transform_setcaps:<videoconvert11> reuse
caps
0:00:01.716066550 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:847:gst_event_new_caps: creating caps event video/x-raw,
format=(string)I420, width=(int)1280, height=(int)720,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
chroma-site=(string)mpeg2, framerate=(fraction)30/1
0:00:01.718626927 159716 0x7f2f8c0018a0 INFO           basetransform
gstbasetransform.c:1320:gst_base_transform_setcaps:<tr-csp-a> reuse caps
0:00:01.718656908 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:847:gst_event_new_caps: creating caps event video/x-raw,
format=(string)I420, width=(int)1280, height=(int)720,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
chroma-site=(string)mpeg2, framerate=(fraction)30/1
0:00:01.723804049 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:847:gst_event_new_caps: creating caps event video/x-raw,
format=(string)AYUV, width=(int)1280, height=(int)720,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)30/1
0:00:01.726013362 159716 0x7f2f8c0018a0 INFO           basetransform
gstbasetransform.c:1320:gst_base_transform_setcaps:<videoconvert6> reuse
caps
0:00:01.726044911 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:847:gst_event_new_caps: creating caps event video/x-raw,
format=(string)AYUV, width=(int)1280, height=(int)720,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)30/1
0:00:01.726103897 159716       0x6a2a30 INFO         videoaggregator
gstvideoaggregator.c:1115:gst_video_aggregator_pad_sink_setcaps:<gessmartmixer1-compositor:sink_0>
Setting caps video/x-raw, format=(string)AYUV, width=(int)1280,
height=(int)720, interlace-mode=(string)progressive,
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
0:00:01.727332952 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:928:gst_event_new_segment: creating segment event time segment
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,
base=0:00:00.000000000, position 0:00:00.080000000, duration
99:99:99.999999999
0:00:01.727345201 159716 0x7f2f6c0048a0 INFO            videodecoder
gstvideodecoder.c:3307:gst_video_decoder_clip_and_push_buf:<avdec_h264-9>
First buffer since flush took 0:00:00.065781628 to produce
0:00:01.727356884 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:928:gst_event_new_segment: creating segment event time segment
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,
base=0:00:00.000000000, position 0:00:00.080000000, duration
99:99:99.999999999
0:00:01.727364532 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:928:gst_event_new_segment: creating segment event time segment
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,
base=0:00:00.000000000, position 0:00:00.080000000, duration
99:99:99.999999999
0:00:01.727374230 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:928:gst_event_new_segment: creating segment event time segment
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:06.000000000,
base=0:00:00.000000000, position 0:00:00.080000000, duration
99:99:99.999999999
0:00:01.727380950 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:928:gst_event_new_segment: creating segment event time segment
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,
base=0:00:00.000000000, position 0:00:00.080000000, duration
99:99:99.999999999
0:00:01.727457347 159716 0x7f2f6c0048a0 INFO           basetransform
gstbasetransform.c:1320:gst_base_transform_setcaps:<capsfilter16> reuse caps
0:00:01.736636413 159716 0x7f2f6c0048a0 INFO            videodecoder
gstvideodecoder.c:1415:gst_video_decoder_sink_event_default:<avdec_h264-9>
upstream tags: taglist, video-codec=(string)H.264, bitrate=(uint)20847403,
minimum-bitrate=(uint)785400, maximum-bitrate=(uint)30797000;


Thibault Saunier-4 wrote
> Hi,
>
> I see, and the rule is pretty straight forward, 2 clips can't fully
> overlap
> in a layer.
>
> - Thibault
>
> On Tue, Sep 1, 2020 at 10:39 PM xmufzy &lt;

> xmufzy@

> &gt; wrote:
>
>> Well, the problem is I failed to add a new clip to the layer, So I need
>> to
>> follow the overlap rule
>>
>>
>> 0:00:00.082988805 31704       0x622200 INFO        GST_ELEMENT_PADS
>> gstelement.c:752:gst_element_add_pad:
> <videosrcbin>
>  adding pad 'src'
>> 0:00:00.082991746 31704       0x622200 INFO        GST_ELEMENT_PADS
>> gstelement.c:999:gst_element_get_static_pad: found pad queue1:sink
>> 0:00:00.083017675 31704       0x622200 INFO                GST_PADS
>> gstpad.c:4309:gst_pad_peer_query:
> <queue1:sink>
>  pad has no peer
>> 0:00:00.083715742 31704       0x622200 INFO                GST_PADS
>> gstpad.c:2378:gst_pad_link_prepare: trying to link videosrcbin:src and
>> src:proxypad19
>> 0:00:00.083722877 31704       0x622200 INFO                GST_PADS
>> gstpad.c:2586:gst_pad_link_full: linked videosrcbin:src and
>> src:proxypad19,
>> successful
>> 0:00:00.083725022 31704       0x622200 INFO               GST_EVENT
>> gstevent.c:1610:gst_event_new_reconfigure: creating reconfigure event
>> 0:00:00.083728769 31704       0x622200 INFO               GST_EVENT
>> gstpad.c:5891:gst_pad_send_event_unchecked:
> <track-element-capsfilter:src>
>> Received event on flushing pad.
>> Discarding
>> 0:00:00.083787272 31704       0x622200 INFO          nlecomposition
>> nlecomposition.c:884:_add_action_locked:
> <video_nlecomposition1>
>  Adding
>> Action for function: 0x8d92c0:_add_object_func
>> 0:00:00.083802242 31704       0x622200 INFO                 gestree
>> ges-timeline-tree.c:1007:set_edit_move_values:&lt;GESVideoUriSource@0x8c2390&gt;
>> videourisource1 will move by setting start to 0:00:02.000000000
>> 0:00:00.083808188 31704       0x622200 INFO                 gestree
>>
>> ges-timeline-tree.c:1236:set_edit_trim_end_values:&lt;GESVideoUriSource@0x8c2390
> &gt; >
>> videourisource1 will trim end by setting duration to 0:00:09.000000000
>> 0:00:00.083820383 31704       0x622200 INFO                 gestree
>> ges-timeline-tree.c:753:check_overlap_with_element: videourisource1
>> (under
>> uriclip1) [0:00:02.000000000 -
>> 0:00:11.000000000] (layer: 0) (track :
> <gesvideotrack0>
> ) and videourisource0
>> (under uriclip0) [0:00:00.000000000 - 0:00:12.000000000] (layer: 0)
>> (track
>> :
> <gesvideotrack0>
> ) fully overlap
>> 0:00:00.083834717 31704       0x622200 INFO                     ges
>> ges-track.c:1218:ges_track_add_element_full:
> <gesvideotrack0>
>  Could not add
>> the track element videourisource1<0x8c2390> [ 0:00:02.000000000
>> (0:00:03.000000000) - 0:00:09.000000000(0:00:12.000000000) layer: 0]  to
>> the
>> track because it breaks the timeline configuration rules
>> 0:00:00.083847483 31704       0x622200 INFO          nlecomposition
>> nlecomposition.c:884:_add_action_locked:
> <video_nlecomposition1>
>  Adding
>> Action for function: 0x8d8080:_remove_object_func
>> 0:00:00.083857936 31704       0x622200 INFO                     ges
>> ges-clip.c:4491:ges_clip_add_child_to_track:&lt;GESUriClip@0x8c05a0&gt;
>> Could
>> not
>> add the track element videourisource1<0x8c2390> [ 0:00:02.000000000
>> (0:00:03.000000000) - 0:00:09.000000000(0:00:12.000000000) layer: 0]  to
>> the
>> track
> <gesvideotrack0>
>> 0:00:00.083877078 31704       0x622200 INFO                     ges
>> ges-layer.c:779:ges_layer_add_clip_full:&lt;GESLayer@0x8856e0&gt; Could
>> not add
>> the clip uriclip1<0x8c05a0> [ 0:00:02.000000000 (0:00:03.000000000) -
>> 0:00:09.000000000(0:00:12.000000000) layer: 0]  to the timeline
>>
> <gestimeline0>
>> 0:00:00.083886577 31704       0x622200 WARN                     ges
>> ges-layer.c:787:ges_layer_add_clip_full:
> <gestimeline0>
>  Adding the clip
>> uriclip1<0x8c05a0> [ 0:00:02.000000000 (0:00:03.000000000) -
>> 0:00:09.000000000(0:00:12.000000000) layer: 0]  to the timeline failed:
>> The
>> source "videourisource0" (parent: "uriclip0") would totally overlap the
>> source "videourisource1" (parent: "uriclip1") in the track
>> "gesvideotrack0"
>> **
>> ERROR:./poc_ges.cpp:108:int main(int, gchar**): assertion failed:
>> (ges_layer_add_clip (layer, src))
>> Bail out! ERROR:./poc_ges.cpp:108:int main(int, gchar**): assertion
>> failed:
>> (ges_layer_add_clip (layer, src))
>>
>>
>>
>>
>> --
>> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
>> _______________________________________________
>> gstreamer-devel mailing list
>>

> gstreamer-devel@.freedesktop

>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel@.freedesktop

> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

Thibault Saunier-4
Hi,

As stated previously you should use the timeline auto transition[0] feature instead of creating them yourself, it is just simpler.

- Thibault


On Wed, Sep 2, 2020 at 3:15 AM xmufzy <[hidden email]> wrote:
Got it!
I try to add a transition, but the program hunged, if I remove the
transition codes , it worked.
the code:


    //clip1[3:6]
    offset=3*GST_SECOND;
    inpoint=5*GST_SECOND;
    duration=3*GST_SECOND;
    priority=0;
    uri = gst_filename_to_uri ("./shoe.mp4", NULL);
    src = GES_CLIP(ges_uri_clip_new (uri));
    g_assert (src);
    g_free (uri);
    g_object_set (src, "start",offset,"in-point", inpoint,"duration" ,
duration, "priority",priority,NULL);
    g_assert(ges_layer_add_clip (layer,  src));
    ges_timeline_element_set_child_properties (GES_TIMELINE_ELEMENT (src),
"posx", 400, "posy", 400, "width",200,"height",200, NULL);

    // add a transition code here
    GESTransitionClip *tr ;
    if (!(tr = ges_transition_clip_new_for_nick ( "crossfade")))
      g_error ("invalid transition type \n");

    g_object_set (tr, "start", (guint64) 6*GST_SECOND, "duration", (guint64)
2*GST_SECOND, "in-point", (guint64) 0, NULL);
    g_assert(ges_layer_add_clip (layer, GES_CLIP (tr)));

    //clip2 [8:11]
    offset=8*GST_SECOND;
    inpoint=3*GST_SECOND;
    duration=3*GST_SECOND;
    priority=1;
    uri = gst_filename_to_uri ("./poc_backgroup.mp4", NULL);
    src = GES_CLIP(ges_uri_clip_new (uri));
    g_assert (src);
    g_free (uri);
    g_object_set (src, "start",offset,"in-point", inpoint,"duration" ,
duration, "priority",priority,NULL);
    g_assert(ges_layer_add_clip (layer, src));
    ges_timeline_element_set_child_properties (GES_TIMELINE_ELEMENT (src),
"posx", 400, "posy", 400, "width",200,"height",200, NULL);




0:00:01.716036859 159716 0x7f2f8c0018a0 INFO           basetransform
gstbasetransform.c:1320:gst_base_transform_setcaps:<videoconvert11> reuse
caps
0:00:01.716066550 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:847:gst_event_new_caps: creating caps event video/x-raw,
format=(string)I420, width=(int)1280, height=(int)720,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
chroma-site=(string)mpeg2, framerate=(fraction)30/1
0:00:01.718626927 159716 0x7f2f8c0018a0 INFO           basetransform
gstbasetransform.c:1320:gst_base_transform_setcaps:<tr-csp-a> reuse caps
0:00:01.718656908 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:847:gst_event_new_caps: creating caps event video/x-raw,
format=(string)I420, width=(int)1280, height=(int)720,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
chroma-site=(string)mpeg2, framerate=(fraction)30/1
0:00:01.723804049 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:847:gst_event_new_caps: creating caps event video/x-raw,
format=(string)AYUV, width=(int)1280, height=(int)720,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)30/1
0:00:01.726013362 159716 0x7f2f8c0018a0 INFO           basetransform
gstbasetransform.c:1320:gst_base_transform_setcaps:<videoconvert6> reuse
caps
0:00:01.726044911 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:847:gst_event_new_caps: creating caps event video/x-raw,
format=(string)AYUV, width=(int)1280, height=(int)720,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)30/1
0:00:01.726103897 159716       0x6a2a30 INFO         videoaggregator
gstvideoaggregator.c:1115:gst_video_aggregator_pad_sink_setcaps:<gessmartmixer1-compositor:sink_0>
Setting caps video/x-raw, format=(string)AYUV, width=(int)1280,
height=(int)720, interlace-mode=(string)progressive,
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
0:00:01.727332952 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:928:gst_event_new_segment: creating segment event time segment
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,
base=0:00:00.000000000, position 0:00:00.080000000, duration
99:99:99.999999999
0:00:01.727345201 159716 0x7f2f6c0048a0 INFO            videodecoder
gstvideodecoder.c:3307:gst_video_decoder_clip_and_push_buf:<avdec_h264-9>
First buffer since flush took 0:00:00.065781628 to produce
0:00:01.727356884 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:928:gst_event_new_segment: creating segment event time segment
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,
base=0:00:00.000000000, position 0:00:00.080000000, duration
99:99:99.999999999
0:00:01.727364532 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:928:gst_event_new_segment: creating segment event time segment
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,
base=0:00:00.000000000, position 0:00:00.080000000, duration
99:99:99.999999999
0:00:01.727374230 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:928:gst_event_new_segment: creating segment event time segment
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:06.000000000,
base=0:00:00.000000000, position 0:00:00.080000000, duration
99:99:99.999999999
0:00:01.727380950 159716 0x7f2f8c0018a0 INFO               GST_EVENT
gstevent.c:928:gst_event_new_segment: creating segment event time segment
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,
base=0:00:00.000000000, position 0:00:00.080000000, duration
99:99:99.999999999
0:00:01.727457347 159716 0x7f2f6c0048a0 INFO           basetransform
gstbasetransform.c:1320:gst_base_transform_setcaps:<capsfilter16> reuse caps
0:00:01.736636413 159716 0x7f2f6c0048a0 INFO            videodecoder
gstvideodecoder.c:1415:gst_video_decoder_sink_event_default:<avdec_h264-9>
upstream tags: taglist, video-codec=(string)H.264, bitrate=(uint)20847403,
minimum-bitrate=(uint)785400, maximum-bitrate=(uint)30797000;


Thibault Saunier-4 wrote
> Hi,
>
> I see, and the rule is pretty straight forward, 2 clips can't fully
> overlap
> in a layer.
>
> - Thibault
>
> On Tue, Sep 1, 2020 at 10:39 PM xmufzy &lt;

> xmufzy@

> &gt; wrote:
>
>> Well, the problem is I failed to add a new clip to the layer, So I need
>> to
>> follow the overlap rule
>>
>>
>> 0:00:00.082988805 31704       0x622200 INFO        GST_ELEMENT_PADS
>> gstelement.c:752:gst_element_add_pad:
> <videosrcbin>
>  adding pad 'src'
>> 0:00:00.082991746 31704       0x622200 INFO        GST_ELEMENT_PADS
>> gstelement.c:999:gst_element_get_static_pad: found pad queue1:sink
>> 0:00:00.083017675 31704       0x622200 INFO                GST_PADS
>> gstpad.c:4309:gst_pad_peer_query:
> <queue1:sink>
>  pad has no peer
>> 0:00:00.083715742 31704       0x622200 INFO                GST_PADS
>> gstpad.c:2378:gst_pad_link_prepare: trying to link videosrcbin:src and
>> src:proxypad19
>> 0:00:00.083722877 31704       0x622200 INFO                GST_PADS
>> gstpad.c:2586:gst_pad_link_full: linked videosrcbin:src and
>> src:proxypad19,
>> successful
>> 0:00:00.083725022 31704       0x622200 INFO               GST_EVENT
>> gstevent.c:1610:gst_event_new_reconfigure: creating reconfigure event
>> 0:00:00.083728769 31704       0x622200 INFO               GST_EVENT
>> gstpad.c:5891:gst_pad_send_event_unchecked:
> <track-element-capsfilter:src>
>> Received event on flushing pad.
>> Discarding
>> 0:00:00.083787272 31704       0x622200 INFO          nlecomposition
>> nlecomposition.c:884:_add_action_locked:
> <video_nlecomposition1>
>  Adding
>> Action for function: 0x8d92c0:_add_object_func
>> 0:00:00.083802242 31704       0x622200 INFO                 gestree
>> ges-timeline-tree.c:1007:set_edit_move_values:&lt;GESVideoUriSource@0x8c2390&gt;
>> videourisource1 will move by setting start to 0:00:02.000000000
>> 0:00:00.083808188 31704       0x622200 INFO                 gestree
>>
>> ges-timeline-tree.c:1236:set_edit_trim_end_values:&lt;GESVideoUriSource@0x8c2390
> &gt; >
>> videourisource1 will trim end by setting duration to 0:00:09.000000000
>> 0:00:00.083820383 31704       0x622200 INFO                 gestree
>> ges-timeline-tree.c:753:check_overlap_with_element: videourisource1
>> (under
>> uriclip1) [0:00:02.000000000 -
>> 0:00:11.000000000] (layer: 0) (track :
> <gesvideotrack0>
> ) and videourisource0
>> (under uriclip0) [0:00:00.000000000 - 0:00:12.000000000] (layer: 0)
>> (track
>> :
> <gesvideotrack0>
> ) fully overlap
>> 0:00:00.083834717 31704       0x622200 INFO                     ges
>> ges-track.c:1218:ges_track_add_element_full:
> <gesvideotrack0>
>  Could not add
>> the track element videourisource1<0x8c2390> [ 0:00:02.000000000
>> (0:00:03.000000000) - 0:00:09.000000000(0:00:12.000000000) layer: 0]  to
>> the
>> track because it breaks the timeline configuration rules
>> 0:00:00.083847483 31704       0x622200 INFO          nlecomposition
>> nlecomposition.c:884:_add_action_locked:
> <video_nlecomposition1>
>  Adding
>> Action for function: 0x8d8080:_remove_object_func
>> 0:00:00.083857936 31704       0x622200 INFO                     ges
>> ges-clip.c:4491:ges_clip_add_child_to_track:&lt;GESUriClip@0x8c05a0&gt;
>> Could
>> not
>> add the track element videourisource1<0x8c2390> [ 0:00:02.000000000
>> (0:00:03.000000000) - 0:00:09.000000000(0:00:12.000000000) layer: 0]  to
>> the
>> track
> <gesvideotrack0>
>> 0:00:00.083877078 31704       0x622200 INFO                     ges
>> ges-layer.c:779:ges_layer_add_clip_full:&lt;GESLayer@0x8856e0&gt; Could
>> not add
>> the clip uriclip1<0x8c05a0> [ 0:00:02.000000000 (0:00:03.000000000) -
>> 0:00:09.000000000(0:00:12.000000000) layer: 0]  to the timeline
>>
> <gestimeline0>
>> 0:00:00.083886577 31704       0x622200 WARN                     ges
>> ges-layer.c:787:ges_layer_add_clip_full:
> <gestimeline0>
>  Adding the clip
>> uriclip1<0x8c05a0> [ 0:00:02.000000000 (0:00:03.000000000) -
>> 0:00:09.000000000(0:00:12.000000000) layer: 0]  to the timeline failed:
>> The
>> source "videourisource0" (parent: "uriclip0") would totally overlap the
>> source "videourisource1" (parent: "uriclip1") in the track
>> "gesvideotrack0"
>> **
>> ERROR:./poc_ges.cpp:108:int main(int, gchar**): assertion failed:
>> (ges_layer_add_clip (layer, src))
>> Bail out! ERROR:./poc_ges.cpp:108:int main(int, gchar**): assertion
>> failed:
>> (ges_layer_add_clip (layer, src))
>>
>>
>>
>>
>> --
>> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
>> _______________________________________________
>> gstreamer-devel mailing list
>>

> gstreamer-devel@.freedesktop

>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel@.freedesktop

> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

xmufzy
Great, I try autotransition and it worked, but I need to control the
transition type, the default is crossfade, can I change to other type?

autotransition:
*  the track-types is 6
          <clip id='3' asset-id='crossfade' type-name='GESTransitionClip'
layer-priority='1' track-types='6' start='5000000000' duration='1000000000'
inpoint='0' rate='0'      properties='properties,
name=(string)transitionclip0;' metadatas='metadatas;'
children-properties='properties, GESVideoTransition::border=(uint)0,
GESVideoTransition::       invert=(boolean)false;'

* insert transition ,the track-type is 4,  How can I change the transition
type to 6?

 &lt;clip id='3' asset-id='crossfade' type-name='GESTransitionClip'
layer-priority='1' track-types='4' start='5000000000' duration='1000000000'
inpoint='0' rate='0'      properties='properties,
name=(string)transitionclip0;' metadatas='metadatas;'
children-properties='properties, GESVideoTransition::border=(uint)0,
GESVideoTransition::       invert=(boolean)false;'>

====
One more question,
I have some other component write by open-gl ,the component mixer 2 video
and generate a new video segment, How can I make them work with ges?




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to segment seek in dynamic pipeline

xmufzy
In reply to this post by Thibault Saunier-4
Hi Thibault
     I can add the transition now,the codes:
   

    GESClip *tr ;
    GESAsset *asset;
    asset = ges_asset_request (GES_TYPE_TRANSITION_CLIP, "crossfade", NULL);
    tr = ges_layer_add_asset (layer, asset, 5*GST_SECOND, 0, 1*GST_SECOND,
GES_TRACK_TYPE_VIDEO);

The reason for the failure is that ges_transition_clip_new() only created
the audio transition.But there's only 1 audio  in the layer.





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel