Fw:Re: How to play a list of MP4 files succesively

Shuang Bing shuangbing at 126.com
Mon Jul 4 21:56:35 PDT 2011


Hi, sirs
Thank you very much for you reply of my questions!
And can you give me further support on the problems I found later that I
have posted above? 
Thank you!

I have build a simple player to process the "about-to-finish" signal, the
player uses playbin2 to build a pipeline and filesrc element to source the
MP4 files.
I used two mp4 files for testing the gapless playback, and the mp4 video can
play succesively except some problems:
1. there is no audio for the second clip
2. when the second clip start, the play position value get with function
"gst_element_query_position" keeps the value equaling to the duration of
first clip, which means it can not get the real play position of the second
clip
3. if I do a seek operation during the playing of the second mp4, the audio
will come and play position value will be the real position

So, could you please give me some more advices, thank you very much!

P.S. The following codes are used in my testing and pasted here for your information.

///********************************************************************************************///
void player_play (const char *uri)
{
    loop = g_main_loop_new (NULL, FALSE);

    pipeline = gst_pipeline_new ("gst-player");

    bin = gst_element_factory_make ("playbin2", "bin");
    videosink = gst_element_factory_make ("ximagesink", "videosink");
    audiosink = gst_element_factory_make ("alsasink", "alsasink");

    g_object_set (G_OBJECT (bin), "video-sink", videosink, NULL);
    g_object_set (G_OBJECT (bin), "audio-sink", audiosink, NULL);

    g_object_set (G_OBJECT (bin), "uri", uri, NULL);

    gst_bin_add (GST_BIN (pipeline), bin);

    if (GST_IS_X_OVERLAY (videosink))
    {
        gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GPOINTER_TO_INT (window));
    }    

   {
        GstBus *bus;
        bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
        gst_bus_add_watch (bus, bus_cb, loop);
	g_signal_connect (bin, "about-to-finish", G_CALLBACK (about_to_finish_cb), uri_to_play);
        gst_object_unref (bus);
    }

    gst_element_set_state (pipeline, GST_STATE_PLAYING);

    g_print ("Running\n");

    ProgressBarID = g_timeout_add (1000, timeout, pipeline);

    g_main_loop_run (loop);
}

void about_to_finish_cb (GstElement * element, gchar * uri)
{
    g_object_set (G_OBJECT (element), "uri", uri, NULL);
}

///********************************************************************************************///


2011-06-09 19:36:00,"Stefan Kost" <[hidden email]> wrote:
>Am 09.06.2011 10:30, schrieb BING SHUANG:
>> Hi,
>>      I am working on a project needs to play several MP4 files succesively,
>> which should be played continuously (succesively as it was only one file).
>>      Is it possible for this functions in gstreamer?
>>      I know there is a plugin named "applehlssrc" for playing .m3u8 playlist
>> contains a list of ".ts" stream, so I want to know is there such a plugin can
>> support a playlist contains a list of MP4 files/streams and play succesively?
>> Which kind of playlist will it be?  
>
>GStreamer won't do the playlist handling. But please have a look at gap-less
>playback in playin2 ("about-to-finish" signal). You should be able to implement
>your case with that.
>
>Stefan
>
>>      Or how can I design a plugin in gstreamer for supporting suck kind of
>> functions?
>> 
>>      I am newer in gstreamer and I really need your help.
>>      Thank you very much!
>> 
>>  
>> 
>> Best Regards!
>> 
>>  
>> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110705/16806676/attachment.htm>
-------------- next part --------------
An embedded message was scrubbed...
From: bigbilly <shuangbing at 126.com>
Subject: Re: How to play a list of MP4 files succesively
Date: Mon, 4 Jul 2011 21:44:02 -0700 (PDT)
Size: 2369
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110705/16806676/attachment.eml>


More information about the gstreamer-devel mailing list