<div dir="ltr"><div>Hi,</div><div><br></div><div>As stated previously you should use the timeline auto transition[0] feature instead of creating them yourself, it is just simpler.</div><div><br></div><div>- Thibault<br></div><div><br></div><div>[0]: <a href="https://gstreamer.freedesktop.org/documentation/gst-editing-services/gestimeline.html?gi-language=c#overlaps-and-autotransitions">https://gstreamer.freedesktop.org/documentation/gst-editing-services/gestimeline.html?gi-language=c#overlaps-and-autotransitions</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 2, 2020 at 3:15 AM xmufzy <<a href="mailto:xmufzy@foxmail.com">xmufzy@foxmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Got it!<br>
I try to add a transition, but the program hunged, if I remove the<br>
transition codes , it worked.<br>
the code:<br>
<br>
<br>
//clip1[3:6]<br>
offset=3*GST_SECOND;<br>
inpoint=5*GST_SECOND;<br>
duration=3*GST_SECOND;<br>
priority=0;<br>
uri = gst_filename_to_uri ("./shoe.mp4", NULL);<br>
src = GES_CLIP(ges_uri_clip_new (uri));<br>
g_assert (src);<br>
g_free (uri);<br>
g_object_set (src, "start",offset,"in-point", inpoint,"duration" ,<br>
duration, "priority",priority,NULL);<br>
g_assert(ges_layer_add_clip (layer, src));<br>
ges_timeline_element_set_child_properties (GES_TIMELINE_ELEMENT (src),<br>
"posx", 400, "posy", 400, "width",200,"height",200, NULL);<br>
<br>
// add a transition code here<br>
GESTransitionClip *tr ;<br>
if (!(tr = ges_transition_clip_new_for_nick ( "crossfade")))<br>
g_error ("invalid transition type \n");<br>
<br>
g_object_set (tr, "start", (guint64) 6*GST_SECOND, "duration", (guint64)<br>
2*GST_SECOND, "in-point", (guint64) 0, NULL);<br>
g_assert(ges_layer_add_clip (layer, GES_CLIP (tr)));<br>
<br>
//clip2 [8:11]<br>
offset=8*GST_SECOND;<br>
inpoint=3*GST_SECOND;<br>
duration=3*GST_SECOND;<br>
priority=1;<br>
uri = gst_filename_to_uri ("./poc_backgroup.mp4", NULL);<br>
src = GES_CLIP(ges_uri_clip_new (uri));<br>
g_assert (src);<br>
g_free (uri);<br>
g_object_set (src, "start",offset,"in-point", inpoint,"duration" ,<br>
duration, "priority",priority,NULL);<br>
g_assert(ges_layer_add_clip (layer, src));<br>
ges_timeline_element_set_child_properties (GES_TIMELINE_ELEMENT (src),<br>
"posx", 400, "posy", 400, "width",200,"height",200, NULL);<br>
<br>
<br>
<br>
<br>
0:00:01.716036859 159716 0x7f2f8c0018a0 INFO basetransform<br>
gstbasetransform.c:1320:gst_base_transform_setcaps:<videoconvert11> reuse<br>
caps<br>
0:00:01.716066550 159716 0x7f2f8c0018a0 INFO GST_EVENT<br>
gstevent.c:847:gst_event_new_caps: creating caps event video/x-raw,<br>
format=(string)I420, width=(int)1280, height=(int)720,<br>
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,<br>
chroma-site=(string)mpeg2, framerate=(fraction)30/1<br>
0:00:01.718626927 159716 0x7f2f8c0018a0 INFO basetransform<br>
gstbasetransform.c:1320:gst_base_transform_setcaps:<tr-csp-a> reuse caps<br>
0:00:01.718656908 159716 0x7f2f8c0018a0 INFO GST_EVENT<br>
gstevent.c:847:gst_event_new_caps: creating caps event video/x-raw,<br>
format=(string)I420, width=(int)1280, height=(int)720,<br>
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,<br>
chroma-site=(string)mpeg2, framerate=(fraction)30/1<br>
0:00:01.723804049 159716 0x7f2f8c0018a0 INFO GST_EVENT<br>
gstevent.c:847:gst_event_new_caps: creating caps event video/x-raw,<br>
format=(string)AYUV, width=(int)1280, height=(int)720,<br>
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,<br>
framerate=(fraction)30/1<br>
0:00:01.726013362 159716 0x7f2f8c0018a0 INFO basetransform<br>
gstbasetransform.c:1320:gst_base_transform_setcaps:<videoconvert6> reuse<br>
caps<br>
0:00:01.726044911 159716 0x7f2f8c0018a0 INFO GST_EVENT<br>
gstevent.c:847:gst_event_new_caps: creating caps event video/x-raw,<br>
format=(string)AYUV, width=(int)1280, height=(int)720,<br>
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,<br>
framerate=(fraction)30/1<br>
0:00:01.726103897 159716 0x6a2a30 INFO videoaggregator<br>
gstvideoaggregator.c:1115:gst_video_aggregator_pad_sink_setcaps:<gessmartmixer1-compositor:sink_0><br>
Setting caps video/x-raw, format=(string)AYUV, width=(int)1280,<br>
height=(int)720, interlace-mode=(string)progressive,<br>
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1<br>
0:00:01.727332952 159716 0x7f2f8c0018a0 INFO GST_EVENT<br>
gstevent.c:928:gst_event_new_segment: creating segment event time segment<br>
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,<br>
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,<br>
base=0:00:00.000000000, position 0:00:00.080000000, duration<br>
99:99:99.999999999<br>
0:00:01.727345201 159716 0x7f2f6c0048a0 INFO videodecoder<br>
gstvideodecoder.c:3307:gst_video_decoder_clip_and_push_buf:<avdec_h264-9><br>
First buffer since flush took 0:00:00.065781628 to produce<br>
0:00:01.727356884 159716 0x7f2f8c0018a0 INFO GST_EVENT<br>
gstevent.c:928:gst_event_new_segment: creating segment event time segment<br>
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,<br>
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,<br>
base=0:00:00.000000000, position 0:00:00.080000000, duration<br>
99:99:99.999999999<br>
0:00:01.727364532 159716 0x7f2f8c0018a0 INFO GST_EVENT<br>
gstevent.c:928:gst_event_new_segment: creating segment event time segment<br>
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,<br>
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,<br>
base=0:00:00.000000000, position 0:00:00.080000000, duration<br>
99:99:99.999999999<br>
0:00:01.727374230 159716 0x7f2f8c0018a0 INFO GST_EVENT<br>
gstevent.c:928:gst_event_new_segment: creating segment event time segment<br>
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,<br>
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:06.000000000,<br>
base=0:00:00.000000000, position 0:00:00.080000000, duration<br>
99:99:99.999999999<br>
0:00:01.727380950 159716 0x7f2f8c0018a0 INFO GST_EVENT<br>
gstevent.c:928:gst_event_new_segment: creating segment event time segment<br>
start=0:00:00.080000000, offset=0:00:00.000000000, stop=0:00:12.080000000,<br>
rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,<br>
base=0:00:00.000000000, position 0:00:00.080000000, duration<br>
99:99:99.999999999<br>
0:00:01.727457347 159716 0x7f2f6c0048a0 INFO basetransform<br>
gstbasetransform.c:1320:gst_base_transform_setcaps:<capsfilter16> reuse caps<br>
0:00:01.736636413 159716 0x7f2f6c0048a0 INFO videodecoder<br>
gstvideodecoder.c:1415:gst_video_decoder_sink_event_default:<avdec_h264-9><br>
upstream tags: taglist, video-codec=(string)H.264, bitrate=(uint)20847403,<br>
minimum-bitrate=(uint)785400, maximum-bitrate=(uint)30797000;<br>
<br>
<br>
Thibault Saunier-4 wrote<br>
> Hi,<br>
> <br>
> I see, and the rule is pretty straight forward, 2 clips can't fully<br>
> overlap<br>
> in a layer.<br>
> <br>
> - Thibault<br>
> <br>
> On Tue, Sep 1, 2020 at 10:39 PM xmufzy <<br>
<br>
> xmufzy@<br>
<br>
> > wrote:<br>
> <br>
>> Well, the problem is I failed to add a new clip to the layer, So I need<br>
>> to<br>
>> follow the overlap rule<br>
>><br>
>><br>
>> 0:00:00.082988805 31704 0x622200 INFO GST_ELEMENT_PADS<br>
>> gstelement.c:752:gst_element_add_pad:<br>
> <videosrcbin><br>
> adding pad 'src'<br>
>> 0:00:00.082991746 31704 0x622200 INFO GST_ELEMENT_PADS<br>
>> gstelement.c:999:gst_element_get_static_pad: found pad queue1:sink<br>
>> 0:00:00.083017675 31704 0x622200 INFO GST_PADS<br>
>> gstpad.c:4309:gst_pad_peer_query:<br>
> <queue1:sink><br>
> pad has no peer<br>
>> 0:00:00.083715742 31704 0x622200 INFO GST_PADS<br>
>> gstpad.c:2378:gst_pad_link_prepare: trying to link videosrcbin:src and<br>
>> src:proxypad19<br>
>> 0:00:00.083722877 31704 0x622200 INFO GST_PADS<br>
>> gstpad.c:2586:gst_pad_link_full: linked videosrcbin:src and<br>
>> src:proxypad19,<br>
>> successful<br>
>> 0:00:00.083725022 31704 0x622200 INFO GST_EVENT<br>
>> gstevent.c:1610:gst_event_new_reconfigure: creating reconfigure event<br>
>> 0:00:00.083728769 31704 0x622200 INFO GST_EVENT<br>
>> gstpad.c:5891:gst_pad_send_event_unchecked:<br>
> <track-element-capsfilter:src><br>
>> Received event on flushing pad.<br>
>> Discarding<br>
>> 0:00:00.083787272 31704 0x622200 INFO nlecomposition<br>
>> nlecomposition.c:884:_add_action_locked:<br>
> <video_nlecomposition1><br>
> Adding<br>
>> Action for function: 0x8d92c0:_add_object_func<br>
>> 0:00:00.083802242 31704 0x622200 INFO gestree<br>
>> ges-timeline-tree.c:1007:set_edit_move_values:<GESVideoUriSource@0x8c2390><br>
>> videourisource1 will move by setting start to 0:00:02.000000000<br>
>> 0:00:00.083808188 31704 0x622200 INFO gestree<br>
>><br>
>> ges-timeline-tree.c:1236:set_edit_trim_end_values:<GESVideoUriSource@0x8c2390<br>
> > ><br>
>> videourisource1 will trim end by setting duration to 0:00:09.000000000<br>
>> 0:00:00.083820383 31704 0x622200 INFO gestree<br>
>> ges-timeline-tree.c:753:check_overlap_with_element: videourisource1<br>
>> (under<br>
>> uriclip1) [0:00:02.000000000 -<br>
>> 0:00:11.000000000] (layer: 0) (track :<br>
> <gesvideotrack0><br>
> ) and videourisource0<br>
>> (under uriclip0) [0:00:00.000000000 - 0:00:12.000000000] (layer: 0)<br>
>> (track<br>
>> :<br>
> <gesvideotrack0><br>
> ) fully overlap<br>
>> 0:00:00.083834717 31704 0x622200 INFO ges<br>
>> ges-track.c:1218:ges_track_add_element_full:<br>
> <gesvideotrack0><br>
> Could not add<br>
>> the track element videourisource1<0x8c2390> [ 0:00:02.000000000<br>
>> (0:00:03.000000000) - 0:00:09.000000000(0:00:12.000000000) layer: 0] to<br>
>> the<br>
>> track because it breaks the timeline configuration rules<br>
>> 0:00:00.083847483 31704 0x622200 INFO nlecomposition<br>
>> nlecomposition.c:884:_add_action_locked:<br>
> <video_nlecomposition1><br>
> Adding<br>
>> Action for function: 0x8d8080:_remove_object_func<br>
>> 0:00:00.083857936 31704 0x622200 INFO ges<br>
>> ges-clip.c:4491:ges_clip_add_child_to_track:<GESUriClip@0x8c05a0><br>
>> Could<br>
>> not<br>
>> add the track element videourisource1<0x8c2390> [ 0:00:02.000000000<br>
>> (0:00:03.000000000) - 0:00:09.000000000(0:00:12.000000000) layer: 0] to<br>
>> the<br>
>> track <br>
> <gesvideotrack0><br>
>> 0:00:00.083877078 31704 0x622200 INFO ges<br>
>> ges-layer.c:779:ges_layer_add_clip_full:<GESLayer@0x8856e0> Could<br>
>> not add<br>
>> the clip uriclip1<0x8c05a0> [ 0:00:02.000000000 (0:00:03.000000000) -<br>
>> 0:00:09.000000000(0:00:12.000000000) layer: 0] to the timeline<br>
>> <br>
> <gestimeline0><br>
>> 0:00:00.083886577 31704 0x622200 WARN ges<br>
>> ges-layer.c:787:ges_layer_add_clip_full:<br>
> <gestimeline0><br>
> Adding the clip<br>
>> uriclip1<0x8c05a0> [ 0:00:02.000000000 (0:00:03.000000000) -<br>
>> 0:00:09.000000000(0:00:12.000000000) layer: 0] to the timeline failed:<br>
>> The<br>
>> source "videourisource0" (parent: "uriclip0") would totally overlap the<br>
>> source "videourisource1" (parent: "uriclip1") in the track<br>
>> "gesvideotrack0"<br>
>> **<br>
>> ERROR:./poc_ges.cpp:108:int main(int, gchar**): assertion failed:<br>
>> (ges_layer_add_clip (layer, src))<br>
>> Bail out! ERROR:./poc_ges.cpp:108:int main(int, gchar**): assertion<br>
>> failed:<br>
>> (ges_layer_add_clip (layer, src))<br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Sent from: <a href="http://gstreamer-devel.966125.n4.nabble.com/" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/</a><br>
>> _______________________________________________<br>
>> gstreamer-devel mailing list<br>
>> <br>
<br>
> gstreamer-devel@.freedesktop<br>
<br>
>> <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
>><br>
> <br>
> _______________________________________________<br>
> gstreamer-devel mailing list<br>
<br>
> gstreamer-devel@.freedesktop<br>
<br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br>
<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://gstreamer-devel.966125.n4.nabble.com/" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div>