Dear All
This is my pipeline video_bin = gst_parse_bin_from_description("tee name=t t. ! queue ! autovideosink t. ! decklinkvideosink mode=3", TRUE, NULL); video_filter_bin = gst_parse_bin_from_description("capssetter caps=video/x-raw,interlace-mode=interleaved,width=720,height=576", TRUE, NULL); audio_bin = gst_parse_bin_from_description("audioconvert ! decklinkaudiosink", TRUE, NULL); When I play list of files I face the issue that my files are not playing till the last frame. Only the last file playing till the end What I am lacking in the code Regards Adeel Arshad |
Hi all GST_DEBUG("Creating pipeline"); context = g_main_context_new(); g_main_context_push_thread_default(context);
pipeline = gst_parse_launch("playbin uri=file:///Users/administrator/Desktop/MAC_APPS/SUZUKI.mpg", &error); const char *char_uri = [uri UTF8String]; g_object_set(pipeline, "uri", char_uri, NULL); GST_DEBUG("URI set to %s", char_uri);
if(error){ gchar *message = g_strdup_printf("Unable to build pipeline: %s", error->message); g_clear_error(&error); NSLog(@"pipeline error %s",message); [self setUIMessage:message]; g_free(message); return; }
GstElement *videosink = gst_bin_get_by_interface(GST_BIN(pipeline), GST_TYPE_VIDEO_OVERLAY); if(!videosink){ GST_ERROR("Could not retrieve video sink"); return; }
gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(videosink), (guintptr)(id)ui_video_view);
ret = gst_element_set_state (pipeline, GST_STATE_PLAYING); if (ret == GST_STATE_CHANGE_FAILURE) { NSLog(@"Unable to set the pipeline to the playing state.\n"); gst_object_unref (pipeline); return; }
bus = gst_element_get_bus(pipeline); bus_source = gst_bus_create_watch(bus); g_source_set_callback(bus_source, (GSourceFunc)gst_bus_async_signal_func, NULL, NULL); g_source_attach(bus_source, context); g_source_unref(bus_source);
g_signal_connect (G_OBJECT(bus), "message::error", (GCallback)error_cb, (__bridge void *)self); g_signal_connect (G_OBJECT(bus), "message::eos", (GCallback)eos_cb, (__bridge void *)self); g_signal_connect (G_OBJECT(bus), "message::state-changed", (GCallback)state_changed_cb, (__bridge void *)self); g_signal_connect (G_OBJECT(bus), "message::duration", (GCallback)duration_cb, (__bridge void *)self); g_signal_connect (G_OBJECT(bus), "message::clock-lost", (GCallback)clock_lost_cb, (__bridge void *)self); g_signal_connect (pipeline, "about-to-finish", (GCallback)prepare_next_stream, (__bridge void *)self); timeout_source = g_timeout_source_new(1); g_source_set_callback(timeout_source, (GSourceFunc)refresh_ui, (__bridge void *)self,NULL); g_source_attach(timeout_source, context); g_source_unref(timeout_source);
GST_DEBUG("Entering main loop..."); main_loop = g_main_loop_new(context, FALSE); [self check_initializing_complete]; g_main_loop_run(main_loop); GST_DEBUG("Exiting main loop..."); g_main_loop_unref(main_loop); main_loop = NULL; static void prepare_next_stream (GstElement *obj, GStreamerBackend *self){ NSString* uri = [self playNext]; if(![uri isEqualToString:@""]) { const char *char_uri = [uri UTF8String]; g_object_set (self->pipeline, "uri", char_uri, NULL); } } On Wed, Aug 17, 2016 at 2:40 PM, adeel <[hidden email]> wrote: Dear All _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
You might be getting EOS from audio stream and not video stream. Try probing audio pad and intercept EOS events and drop it until you get EOS for video stream.
From: gstreamer-devel [mailto:[hidden email]]
On Behalf Of Adeel Arshad Hi all I checked with only playbin element and still file is not playing till the end in gapless playback. Following is my code GST_DEBUG("Creating
pipeline");
context =
g_main_context_new();
g_main_context_push_thread_default(context);
pipeline =
gst_parse_launch("playbin uri=file:///Users/administrator/Desktop/MAC_APPS/SUZUKI.mpg",
&error);
const char *char_uri = [uri
UTF8String];
g_object_set(pipeline,
"uri", char_uri, NULL);
GST_DEBUG("URI set to %s", char_uri);
if(error){
gchar *message =
g_strdup_printf("Unable to build
pipeline: %s", error->message);
g_clear_error(&error);
NSLog(@"pipeline error %s",message); [self
setUIMessage:message];
g_free(message);
return; }
GstElement *videosink =
gst_bin_get_by_interface(GST_BIN(pipeline),
GST_TYPE_VIDEO_OVERLAY);
if(!videosink){
GST_ERROR("Could not retrieve
video sink");
return; }
gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(videosink),
(guintptr)(id)ui_video_view);
ret =
gst_element_set_state (pipeline,
GST_STATE_PLAYING);
if (ret
== GST_STATE_CHANGE_FAILURE) {
NSLog(@"Unable to set the pipeline
to the playing state.\n");
gst_object_unref (pipeline);
return; } bus =
gst_element_get_bus(pipeline); bus_source =
gst_bus_create_watch(bus);
g_source_set_callback(bus_source, (GSourceFunc)gst_bus_async_signal_func,
NULL,
NULL);
g_source_attach(bus_source,
context);
g_source_unref(bus_source);
g_signal_connect (G_OBJECT(bus),
"message::error", (GCallback)error_cb, (__bridge
void *)self);
g_signal_connect (G_OBJECT(bus),
"message::eos", (GCallback)eos_cb, (__bridge
void *)self);
g_signal_connect (G_OBJECT(bus),
"message::state-changed", (GCallback)state_changed_cb, (__bridge
void *)self);
g_signal_connect (G_OBJECT(bus),
"message::duration", (GCallback)duration_cb, (__bridge
void *)self);
g_signal_connect (G_OBJECT(bus),
"message::clock-lost", (GCallback)clock_lost_cb, (__bridge
void *)self);
g_signal_connect (pipeline,
"about-to-finish", (GCallback)prepare_next_stream, (__bridge
void *)self); timeout_source =
g_timeout_source_new(1);
g_source_set_callback(timeout_source, (GSourceFunc)refresh_ui, (__bridge
void *)self,NULL);
g_source_attach(timeout_source,
context);
g_source_unref(timeout_source);
GST_DEBUG("Entering main loop...");
main_loop =
g_main_loop_new(context,
FALSE); [self
check_initializing_complete];
g_main_loop_run(main_loop);
GST_DEBUG("Exiting main loop...");
g_main_loop_unref(main_loop);
main_loop =
NULL; //My about to finish function static
void prepare_next_stream (GstElement *obj,
GStreamerBackend *self){
NSString* uri = [self
playNext];
if(![uri isEqualToString:@""]) {
const char *char_uri = [uri
UTF8String];
g_object_set (self->pipeline,
"uri", char_uri, NULL); } } Regards On Wed, Aug 17, 2016 at 2:40 PM, adeel <[hidden email]> wrote:
_______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hi
I am using playbin and about to finish to perform gapless playback but the issue I am facing is GStreamer dynamically change the source before EOS. As the last file in the list is playing perfectly Regards Adeel Arshad |
Free forum by Nabble | Edit this page |