[gst-devel] Looking for some advices for playing sequence of images with a sound track

wl2776 wl2776 at gmail.com
Tue Sep 7 12:57:32 CEST 2010



Nicolas Bertrand-4 wrote:
> 
> I use gstreamer for making snapshot and play the movie.
> I want to add the possibility of playing a music or sound in the same
> time the video is playing.
> The input of the 'play' function is a sequence of images.
> 
I'd suggest using imagefreeze element to play images. 
Then, use filesrc, multifilesrc, or appsrc to feed the images in. Appsrc
would help you to create a sophisticated image sequence, if you need one.
Also, it can help you to avoid storing images to disk, you your app
generates them on the fly.
Usual sound playback chain would suit, if you have sound files on the disk.

So, to put it all together, you create a pipeline and put two chains in it:

1. <some image source, filesrc, or multifilesrc, or appsrc> ! decodebin2 !
imagefreeze ! video-sink

2. filesrc ! audio-decoder ! audio-sink

This can be accomplished in 3 calls:

gst_bin_add_many(pipeline, imagesrc, decodebin2, imagefreeze, videosink,
audiofile_src, audio_decoder, audio_sink,NULL);
gst_element_link_many(imagesrc,decodebin2,imagefreeze,videosink,NULL);
gst_element_link_many(audiofile_src, audio_decoder, audio_sink,NULL);

Probably, it would be useful to add a couple of queues, to create several
threads.


Nicolas Bertrand-4 wrote:
> 
> To mix a sound track in the play function. It is better to use an
> audio-sink or use gnolin ?
> 

I doubt, you can use gnonlin, because, afair, it doesn't support single
images.
You must use audio-sink in any case, whether you use gnonlin or not, because
gnonlin gives you only decoded streams, and you're on your own, when you
want to play them or save to a file.


Nicolas Bertrand-4 wrote:
> 
> I expect to implement also a 'seek' function, controlled by a scale bar
> who allow to start the play at any time/frame.
> For that function, what is the best gstreamer choice ?
> 

As for filesrc and appsrc, they support seeking. For multifilesrc, consult
manuals.


Nicolas Bertrand-4 wrote:
> 
> N.B : the app is developed with python
> 
Don't see any obstacles. 
-- 
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Looking-for-some-advices-for-playing-sequence-of-images-with-a-sound-track-tp2529476p2529498.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list