Create segments in a video

I am using Python 2.7, PyGTK 2.24 and PyGST (Gstreamer).

To ensure smooth playback of one clip to another (without blinking), I combined all the clips that I need into one larger video. This allows me to search for the exact place I need in the code. One of the clips is similar to the “fill”, which should loop whenever one of the other clips does not play.

However, to make my code simpler and more streamlined, I want to use segments to define different clips in a larger video. Then, at the end of each segment (I know that there is an event of the end of the segment), I look for the fill clip. When I need another clip, I'm just looking for this segment.

My question is: how exactly do I create these segments? I assume it will be event_new_new_segment () , but I'm not sure. Can I create multiple search clips using this function? Is there any other that I should use. Are there any problems with this search method in my video that I should know about?

Secondly, how do I look for this unit?

Thanks!

+6
source share
1 answer

It seems that only GstElement can generate NEWSEGMENT events, you cannot just bind it to an existing element. The closest thing you could do if you didn’t use Python would be to create a single snapshot or periodic GstClockID or use gst_clock_id_wait_async until the time is gst_clock_id_wait_async . But the problem is that GstClockID not wrapped in PyGst.

I think I'm actually working on a similar problem. Some solution I'm using now is to glue real-time video streams with gnonlin . The good side: it seems to work, I have not yet had time to thoroughly test it. Bad side: poorly documented and buggy. These sources from the flumotion project (and the comments inside!) Were very helpful for me to figure out how to make it all work.

+1
source

Source: https://habr.com/ru/post/897409/


All Articles