How to read data from file as from live source?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to read data from file as from live source?

sonntex
I read mp4 file using filesrc, qtdemux, h264parse and appsink elements. The pipeline reads all of data from the file immediately, but I want to read it from the file as from live source based on fps. How can I do it?

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to read data from file as from live source?

Tim Müller
On Mon, 2016-12-26 at 18:54 +0300, sonntex wrote:

> I read mp4 file using filesrc, qtdemux, h264parse and appsink
> elements. The pipeline reads all of data from the file immediately,
> but I want to read it from the file as from live source based on fps.
> How can I do it?

You can use appsink sync=true to make appsink sync to the pipeline
clock, then you get the frames in "real time" according to the
timestamps in the file.

In C code:  g_object_set (appsink, "sync", TRUE, NULL);

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to read data from file as from live source?

sonntex
In reply to this post by sonntex
On Mon, 26 Dec 2016 16:22:05 +0000, Tim wrote:

> You can use appsink sync=true to make appsink sync to the pipeline
> clock, then you get the frames in "real time" according to the
> timestamps in the file.

> In C code:  g_object_set (appsink, "sync", TRUE, NULL);

Thanks, Tim.

I have already set sync parameter to appsink and it still not works. So, I wrote small example to reproduce this behavior and noticed that timestamps are very strange.

#include <gst/gst.h>
#include <gst/app/gstappsink.h>

...

GstFlowReturn callback_new_sample(GstAppSink* sink, gpointer opaque)
{
    GstSample* sample = gst_app_sink_pull_sample(GST_APP_SINK(sink));
    GstBuffer* buffer = gst_sample_get_buffer(sample);

    unsigned int pts = GST_BUFFER_PTS(buffer) / 1000000;

    GST_INFO("pts %u", pts);

    gst_sample_unref(sample);

    return GST_FLOW_OK;
}

...

int main(int arc, char* argv[])
{
    const char* filename = argv[1];

    ...

    source_ = gst_element_factory_make("filesrc", nullptr);
    g_object_set(G_OBJECT(source_), "location", filename, nullptr);

    demux_ = gst_element_factory_make("qtdemux", nullptr);
    g_signal_connect(G_OBJECT(demux_), "pad-added", G_CALLBACK(callback_pad_added), nullptr);

    sink_ = gst_element_factory_make("appsink", nullptr);
    g_object_set(G_OBJECT(sink_), "sync", TRUE, nullptr);
    GstAppSinkCallbacks callbacks;
    callbacks.eos = callback_eos;
    callbacks.new_preroll = callback_new_preroll;
    callbacks.new_sample = callback_new_sample;
    gst_app_sink_set_callbacks(GST_APP_SINK(sink_), &callbacks, nullptr, nullptr);

    pipeline_ = gst_pipeline_new(nullptr);
    gst_bin_add_many(GST_BIN(pipeline_), source_, demux_, sink_, nullptr);
    gst_element_link_many(source_, demux_, nullptr);

    gst_element_set_state(pipeline_, GST_STATE_PLAYING);

    ...                                                                                                                                                                                                                       

    return 0;
}

Log looks like:


# GST_DEBUG=4 ./a.out test.mp4
0:00:00.000024789  1351       0xedf600 INFO                GST_INIT gst.c:511:init_pre: Initializing GStreamer Core Library version 1.8.3
0:00:00.000046383  1351       0xedf600 INFO                GST_INIT gst.c:512:init_pre: Using library installed in /usr/lib64
0:00:00.000051828  1351       0xedf600 INFO                GST_INIT gst.c:523:init_pre: Linux work 4.4.6-gentoo #1 SMP Mon Jun 20 21:47:25 MSK 2016 x86_64
0:00:00.000166972  1351       0xedf600 INFO                GST_INIT gstmessage.c:119:_priv_gst_message_initialize: init messages
0:00:00.000382660  1351       0xedf600 INFO                GST_INIT gstcontext.c:83:_priv_gst_context_initialize: init contexts
0:00:00.000474209  1351       0xedf600 INFO      GST_PLUGIN_LOADING gstplugin.c:316:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.000517428  1351       0xedf600 INFO      GST_PLUGIN_LOADING gstplugin.c:224:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.000523021  1351       0xedf600 INFO      GST_PLUGIN_LOADING gstplugin.c:226:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.000533622  1351       0xedf600 INFO            GST_REGISTRY gstregistry.c:1723:ensure_current_registry: reading registry cache: /home/sonntex/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.006085663  1351       0xedf600 INFO            GST_REGISTRY gstregistrybinary.c:619:priv_gst_registry_binary_read_cache: loaded /home/sonntex/.cache/gstreamer-1.0/registry.x86_64.bin in 0.005544 seconds
0:00:00.006109244  1351       0xedf600 INFO            GST_REGISTRY gstregistry.c:1579:scan_and_update_registry: Validating plugins from registry cache: /home/sonntex/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.006453591  1351       0xedf600 INFO            GST_REGISTRY gstregistry.c:1681:scan_and_update_registry: Registry cache has not changed
0:00:00.006459902  1351       0xedf600 INFO            GST_REGISTRY gstregistry.c:1758:ensure_current_registry: registry reading and updating done, result = 1
0:00:00.006463467  1351       0xedf600 INFO                GST_INIT gst.c:724:init_post: GLib runtime version: 2.48.2
0:00:00.006467367  1351       0xedf600 INFO                GST_INIT gst.c:726:init_post: GLib headers version: 2.48.2
0:00:00.006470279  1351       0xedf600 INFO                GST_INIT gst.c:727:init_post: initialized GStreamer successfully
0:00:00.006688576  1351       0xedf600 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib64/gstreamer-1.0/libgstcoreelements.so" loaded
0:00:00.006696099  1351       0xedf600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:364:gst_element_factory_create: creating element "filesrc"
0:00:00.006751118  1351       0xedf600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseSrc@0x1042110> adding pad 'src'
0:00:00.006767442  1351       0xedf600 INFO                 filesrc gstfilesrc.c:262:gst_file_src_set_location: filename : test.mp4
0:00:00.006771123  1351       0xedf600 INFO                 filesrc gstfilesrc.c:263:gst_file_src_set_location: uri      : file:///home/sonntex/devel/test/test.mp4
0:00:00.007559798  1351       0xedf600 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib64/gstreamer-1.0/libgstisomp4.so" loaded
0:00:00.007568188  1351       0xedf600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:364:gst_element_factory_create: creating element "qtdemux"
0:00:00.007619874  1351       0xedf600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstQTDemux@0x104fa00> adding pad 'sink'
0:00:00.007698294  1351       0xedf600 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib64/gstreamer-1.0/libgstapp.so" loaded
0:00:00.007704788  1351       0xedf600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:364:gst_element_factory_create: creating element "appsink"
0:00:00.007763602  1351       0xedf600 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<GstBaseSink@0x10551f0> adding pad 'sink'
0:00:00.007775545  1351       0xedf600 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:364:gst_element_factory_create: creating element "pipeline"
0:00:00.007807031  1351       0xedf600 INFO        GST_ELEMENT_PADS gstutils.c:1573:gst_element_link_pads_full: trying to link element filesrc0:(any) to element qtdemux0:(any)
0:00:00.007813983  1351       0xedf600 INFO                GST_PADS gstutils.c:932:gst_pad_check_link: trying to link filesrc0:src and qtdemux0:sink
0:00:00.007825108  1351       0xedf600 INFO                GST_PADS gstutils.c:1446:prepare_link_maybe_ghosting: filesrc0 and qtdemux0 in same bin, no need for ghost pads
0:00:00.007831980  1351       0xedf600 INFO                GST_PADS gstpad.c:2315:gst_pad_link_prepare: trying to link filesrc0:src and qtdemux0:sink
0:00:00.007837913  1351       0xedf600 INFO                GST_PADS gstpad.c:2521:gst_pad_link_full: linked filesrc0:src and qtdemux0:sink, successful
0:00:00.007841939  1351       0xedf600 INFO               GST_EVENT gstevent.c:1382:gst_event_new_reconfigure: creating reconfigure event
0:00:00.007845735  1351       0xedf600 INFO               GST_EVENT gstpad.c:5634:gst_pad_send_event_unchecked:<filesrc0:src> Received event on flushing pad. Discarding
0:00:00.007856986  1351       0xedf600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<appsink0> current NULL pending VOID_PENDING, desired next READY
0:00:00.007863943  1351       0xedf600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<appsink0> completed state change to READY
0:00:00.007867942  1351       0xedf600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<appsink0> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.007876749  1351       0xedf600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<pipeline0> child 'appsink0' changed state to 2(READY) successfully
0:00:00.007882375  1351       0xedf600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<qtdemux0> current NULL pending VOID_PENDING, desired next READY
0:00:00.007886530  1351       0xedf600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<qtdemux0> completed state change to READY
0:00:00.007889458  1351       0xedf600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<qtdemux0> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.007894090  1351       0xedf600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<pipeline0> child 'qtdemux0' changed state to 2(READY) successfully
0:00:00.007898132  1351       0xedf600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<filesrc0> current NULL pending VOID_PENDING, desired next READY
0:00:00.007906107  1351       0xedf600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<filesrc0> completed state change to READY
0:00:00.007910314  1351       0xedf600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filesrc0> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.007915219  1351       0xedf600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<pipeline0> child 'filesrc0' changed state to 2(READY) successfully
0:00:00.007921417  1351       0xedf600 INFO              GST_STATES gstelement.c:2347:gst_element_continue_state:<pipeline0> committing state from NULL to READY, pending PLAYING, next PAUSED
0:00:00.007925725  1351       0xedf600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<pipeline0> notifying about state-changed NULL to READY (PLAYING pending)
0:00:00.007929851  1351       0xedf600 INFO              GST_STATES gstelement.c:2354:gst_element_continue_state:<pipeline0> continue state change READY to PAUSED, final PLAYING
0:00:00.007935450  1351       0xedf600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<appsink0> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.007942516  1351       0xedf600 INFO              GST_STATES gstbin.c:2770:gst_bin_change_state_func:<pipeline0> child 'appsink0' is changing state asynchronously to PAUSED
0:00:00.007947776  1351       0xedf600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<qtdemux0> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.007953441  1351       0xedf600 INFO                 filesrc gstfilesrc.c:465:gst_file_src_start:<filesrc0> opening file test.mp4
0:00:00.007964619  1351       0xedf600 WARN                 basesrc gstbasesrc.c:3489:gst_base_src_start_complete:<filesrc0> pad not activated yet
0:00:00.007975058  1351       0xedf600 INFO                 filesrc gstfilesrc.c:465:gst_file_src_start:<filesrc0> opening file test.mp4
0:00:00.007991495  1351       0xedf600 INFO                    task gsttask.c:451:gst_task_set_lock: setting stream lock 0x10462e0 on task 0x105a050
0:00:00.007996993  1351       0xedf600 INFO                GST_PADS gstpad.c:5980:gst_pad_start_task:<qtdemux0:sink> created task 0x105a050
0:00:00.008024612  1351       0xedf600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<qtdemux0> completed state change to PAUSED
0:00:00.008030469  1351       0xedf600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<qtdemux0> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.008037059  1351       0xedf600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<pipeline0> child 'qtdemux0' changed state to 3(PAUSED) successfully
0:00:00.008042842  1351       0xedf600 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<filesrc0> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.008049092  1351       0xedf600 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<filesrc0> completed state change to PAUSED
0:00:00.008053129  1351       0xedf600 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filesrc0> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.008058672  1351       0xedf600 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<pipeline0> child 'filesrc0' changed state to 3(PAUSED) successfully
0:00:00.008089488  1351      0x104c2d0 INFO                 qtdemux qtdemux.c:12065:qtdemux_parse_tree:<qtdemux0> timescale: 1800
0:00:00.008099620  1351      0x104c2d0 INFO                 qtdemux qtdemux.c:12066:qtdemux_parse_tree:<qtdemux0> duration: 107969
0:00:00.008105428  1351      0x104c2d0 WARN                 qtdemux qtdemux.c:2651:qtdemux_parse_trex:<qtdemux0> failed to find fragment defaults for stream 1
0:00:00.008125053  1351      0x104c2d0 INFO                 qtdemux qtdemux.c:9770:qtdemux_parse_trak:<qtdemux0> type avc1 caps video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4, profile=(string)main, codec_data=(buffer)014d0028ffe1000d674d00288d8d280a00b760201001000468ee3c80
0:00:00.008165490  1351      0x104c2d0 WARN                 basesrc gstbasesrc.c:2396:gst_base_src_update_length:<filesrc0> processing at or past EOS
0:00:00.008170281  1351      0x104c2d0 INFO          GST_SCHEDULING gstpad.c:4757:gst_pad_get_range_unchecked:<filesrc0:src> getrange failed, flow: eos
0:00:00.008175076  1351      0x104c2d0 INFO          GST_SCHEDULING gstpad.c:4972:gst_pad_pull_range:<qtdemux0:sink> pullrange failed, flow: eos
0:00:00.008195578  1351      0x104c2d0 INFO        GST_ELEMENT_PADS gstelement.c:907:gst_element_get_static_pad: found pad qtdemux0:sink
0:00:00.008214760  1351      0x104c2d0 INFO               GST_EVENT gstevent.c:679:gst_event_new_caps: creating caps event video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4, profile=(string)main, codec_data=(buffer)014d0028ffe1000d674d00288d8d280a00b760201001000468ee3c80, width=(int)1280, height=(int)720, framerate=(fraction)30000/1001, pixel-aspect-ratio=(fraction)1/1
0:00:00.008230859  1351      0x104c2d0 INFO        GST_ELEMENT_PADS gstelement.c:659:gst_element_add_pad:<qtdemux0> adding pad 'video_0'
0:00:00.008243006  1351      0x104c2d0 INFO                 default main.cpp:42:callback_pad_added: pad video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4, profile=(string)main, codec_data=(buffer)014d0028ffe1000d674d00288d8d280a00b760201001000468ee3c80, width=(int)1280, height=(int)720, framerate=(fraction)30000/1001, pixel-aspect-ratio=(fraction)1/1
0:00:00.008249071  1351      0x104c2d0 INFO                 default main.cpp:46:callback_pad_added: pad linking
0:00:00.008252887  1351      0x104c2d0 INFO        GST_ELEMENT_PADS gstutils.c:1573:gst_element_link_pads_full: trying to link element qtdemux0:video_0 to element appsink0:sink
0:00:00.008258225  1351      0x104c2d0 INFO        GST_ELEMENT_PADS gstelement.c:907:gst_element_get_static_pad: found pad qtdemux0:video_0
0:00:00.008262557  1351      0x104c2d0 INFO        GST_ELEMENT_PADS gstelement.c:907:gst_element_get_static_pad: found pad appsink0:sink
0:00:00.008266602  1351      0x104c2d0 INFO                GST_PADS gstutils.c:1446:prepare_link_maybe_ghosting: qtdemux0 and appsink0 in same bin, no need for ghost pads
0:00:00.008272895  1351      0x104c2d0 INFO                GST_PADS gstpad.c:2315:gst_pad_link_prepare: trying to link qtdemux0:video_0 and appsink0:sink
0:00:00.008281034  1351      0x104c2d0 INFO                GST_PADS gstpad.c:2521:gst_pad_link_full: linked qtdemux0:video_0 and appsink0:sink, successful
0:00:00.008285766  1351      0x104c2d0 INFO               GST_EVENT gstevent.c:1382:gst_event_new_reconfigure: creating reconfigure event
0:00:00.008303260  1351      0x104c2d0 INFO               GST_EVENT gstevent.c:760:gst_event_new_segment: creating segment event time segment start=39:01:02.610400000, offset=0:00:00.000000000, stop=39:02:02.593177777, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 39:01:02.610400000, duration 99:99:99.999999999
0:00:00.008322506  1351      0x104c2d0 INFO               GST_EVENT gstevent.c:679:gst_event_new_caps: creating caps event video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4, profile=(string)main, codec_data=(buffer)014d0028ffe1000d674d00288d8d280a00b760201001000468ee3c80, width=(int)1280, height=(int)720, framerate=(fraction)30000/1001, pixel-aspect-ratio=(fraction)1/1
0:00:00.008384508  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140462610
0:00:00.008406598  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140462643
0:00:00.008416023  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140462677
0:00:00.008424983  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140462710
0:00:00.008433337  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140462744
0:00:00.008441179  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140462777
0:00:00.008449325  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140462810
0:00:00.008457575  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140462844
0:00:00.008465503  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140462877
0:00:00.008473565  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140462911
0:00:00.008481699  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140462944
0:00:00.008489477  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140462977
0:00:00.008497337  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140463011

...

0:00:00.023391797  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140522493
0:00:00.023399748  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140522526
0:00:00.023407601  1351      0x104c2d0 INFO                 default main.cpp:30:callback_new_sample: pts 140522560
0:00:00.023414189  1351      0x104c2d0 INFO                 default main.cpp:15:callback_eos: eos
0:00:00.023424894  1351      0x104c2d0 INFO              GST_STATES gstbin.c:3238:bin_handle_async_done:<pipeline0> committing state from READY to PAUSED, old pending PLAYING
0:00:00.023430630  1351      0x104c2d0 INFO              GST_STATES gstbin.c:3267:bin_handle_async_done:<pipeline0> continue state change, pending PLAYING
0:00:00.023435062  1351      0x104c2d0 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<pipeline0> notifying about state-changed READY to PAUSED (PLAYING pending)
0:00:00.023471893  1351 0x7fb220009370 INFO              GST_STATES gstbin.c:3061:gst_bin_continue_func:<pipeline0> continue state change PAUSED to PLAYING, final PLAYING
0:00:00.023551495  1351 0x7fb220009370 INFO               GST_EVENT gstevent.c:1253:gst_event_new_latency: creating latency event 0:00:00.000000000
0:00:00.023567781  1351 0x7fb220009370 INFO                     bin gstbin.c:2593:gst_bin_do_latency_func:<pipeline0> configured latency of 0:00:00.000000000
0:00:00.023580785  1351 0x7fb220009370 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<appsink0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.023588790  1351 0x7fb220009370 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<appsink0> completed state change to PLAYING
0:00:00.023594097  1351 0x7fb220009370 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<appsink0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.023598944  1351      0x104c2d0 INFO                    task gsttask.c:316:gst_task_func:<qtdemux0:sink> Task going to paused
0:00:00.023600873  1351 0x7fb220009370 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<pipeline0> child 'appsink0' changed state to 4(PLAYING) successfully
0:00:00.023610995  1351 0x7fb220009370 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<qtdemux0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.023616256  1351 0x7fb220009370 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<qtdemux0> completed state change to PLAYING
0:00:00.023620188  1351 0x7fb220009370 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<qtdemux0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.023625923  1351 0x7fb220009370 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<pipeline0> child 'qtdemux0' changed state to 4(PLAYING) successfully
0:00:00.023630932  1351 0x7fb220009370 INFO              GST_STATES gstbin.c:2316:gst_bin_element_set_state:<filesrc0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.023635868  1351 0x7fb220009370 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<filesrc0> completed state change to PLAYING
0:00:00.023639614  1351 0x7fb220009370 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<filesrc0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.023644775  1351 0x7fb220009370 INFO              GST_STATES gstbin.c:2764:gst_bin_change_state_func:<pipeline0> child 'filesrc0' changed state to 4(PLAYING) successfully
0:00:00.023650205  1351 0x7fb220009370 INFO              GST_STATES gstelement.c:2372:gst_element_continue_state:<pipeline0> completed state change to PLAYING
0:00:00.023654303  1351 0x7fb220009370 INFO              GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<pipeline0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
^C

As you can see all frames were read before pipeline moved to playing state and timestamps counted not from zero. Why? Is it a problem of my test.mp4 file?

# gst-discoverer-1.0 -v test.mp4
Analyzing file:///home/sonntex/devel/test/test.mp4
Done discovering file:///home/sonntex/devel/test/test.mp4

Topology:
  container: video/quicktime, variant=(string)iso
    video: video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4, profile=(string)main, codec_data=(buffer)014d0028ffe1000d674d00288d8d280a00b760201001000468ee3c80, width=(int)1280, height=(int)720, framerate=(fraction)30000/1001, pixel-aspect-ratio=(fraction)1/1
      Tags:
        video codec: H.264 / AVC
        bitrate: 4938555
        language code: en
        datetime: 2016-12-26T15:02:36Z
        container format: ISO MP4/M4A
     
      Codec:
        video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4, profile=(string)main, codec_data=(buffer)014d0028ffe1000d674d00288d8d280a00b760201001000468ee3c80, width=(int)1280, height=(int)720, framerate=(fraction)30000/1001, pixel-aspect-ratio=(fraction)1/1
      Additional info:
        None
      Stream ID: d83440ba6fe683cff74bed3048a01ab4826a1e09dc9345c944fb75c69014812e/001
      Width: 1280
      Height: 720
      Depth: 24
      Frame rate: 30000/1001
      Pixel aspect ratio: 1/1
      Interlaced: false
      Bitrate: 4938555
      Max bitrate: 0

Properties:
  Duration: 0:00:59.982777777
  Seekable: yes
  Tags:
      video codec: H.264 / AVC
      bitrate: 4938555
      language code: en
      datetime: 2016-12-26T15:02:36Z
      container format: ISO MP4/M4A


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel