Advice wanted: Wanting to play video clips as they arrive. Appsrc? fdsrc?

Sebastian Dröge sebastian at centricular.com
Thu Oct 13 08:15:24 UTC 2016


On Mon, 2016-10-10 at 11:54 -0700, Piper984 wrote:
> Hello Forum,
> 
> I have a process where (1) a small camera system generates H264 video
> segments ~ every 10 seconds,  (2) a small application  encodes the H264 into
> MP4, (3) the video segment file is transferred to a file server, and finally
> (4) the video clip is registered in a database.  
> 
> I need to write an application that will play the videos sequentially with
> no gap, loading and playing the new video clips as they arrive (well,
> getting the next clip from the database). So far I've tried the Playbin
> element where I set the url property to the next video clip when the
> _AboutToFinish event fires.  However, there are some gap in the play back
> using this method.  I've also tried to just pipe the output of files into a
> named pipe and then feed the Gtreamer pipeline from the fdsrc element, but
> this is is really brittle and gets stuck more often than I've been able to
> get it work.
> 
> Does anyone know if an existing example of someone doing a similar
> application like this?  From reading docs online, I think I *could* hook up
> the appsrc element to a method that preloads each video clip in memory, and
> then give chunks of the clip to the app's buffer request?  But it's seems
> there should be an easier method ?

Take a look at the splitmuxsink and splitmuxsrc elements. They
basically do exactly what you want.

If you do the splitting yourself, you need to be very careful with how
you generate the MP4 files to ensure that they can be played back
gaplessly. It's probably better to use splitmuxsink for that directly.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 967 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161013/da74a095/attachment.sig>


More information about the gstreamer-devel mailing list