How to segment seek in dynamic pipeline
Thibault Saunier
tsaunier at gnome.org
Wed Sep 2 16:00:10 UTC 2020
Hi,
As stated previously you should use the timeline auto transition[0] feature
instead of creating them yourself, it is just simpler.
- Thibault
[0]:
https://gstreamer.freedesktop.org/documentation/gst-editing-services/gestimeline.html?gi-language=c#overlaps-and-autotransitions
On Wed, Sep 2, 2020 at 3:15 AM xmufzy <xmufzy at foxmail.com> 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 <
>
> > xmufzy@
>
> > > 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 at 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 at 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 at 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 at 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
> >>
>
> > gstreamer-devel at .freedesktop
>
> >> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> >>
> >
> > _______________________________________________
> > gstreamer-devel mailing list
>
> > gstreamer-devel at .freedesktop
>
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200902/bf659718/attachment-0001.htm>
More information about the gstreamer-devel
mailing list