On 25/11/15 13:27, Florian Iragne wrote:
> Hi,
> 
> I'm facing a problem with finding the real start timestamp of a live
> stream.
> 
> I have several streams (http/mp3, http/aac, udp multicast mp3/aac).
> 
> For udp streams, i have a slight difference between the "real" start
> time of the first packet  and the one i compute. For http streams,  i
> have a difference of 10s (more or less) : the first decoded packet
> contains data that have been played/on air 10s before the stream opening
> (i listen to the same stream).
> 
> I guess that when i open the http stream, the server gives me 10s of the
> past, but it's really hard to prove it.
> 
> I've tried the start_time_realtime property of AVFormatCtx, but it's
> always set to 0 on my streams.
> 
> Here is how i initiate the timestamp:
> 
>         _currentTimestamp =
> std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
> 
>         ret = avformat_open_input(&_iFormatCtx, _filePath, NULL, NULL);
> 
> Could someone provide an advice about this?

In general the protocols you are mentioning do not give you that
information, the only protocol telling you something (then it is up to
the server not giving you the wrong information) is rtsp.

that + the default settings of avformat_find_stream_info make quite
annoying figuring out the exact real time.

There is a flag to flush the find_stream_info queue that you might try
to use, but I'm not sure it would be what you are looking for.
(AVFMT_FLAG_NOBUFFER)

lu


_______________________________________________
libav-api mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-api

Reply via email to