[Libav-user] Syncronize RTSP with computer time

Dídac Pérez perez.didac at gmail.com
Mon Dec 17 09:31:06 CET 2012


I am successfully using libav to receive the video stream from an RTSP
network source. The point is that I need to syncronize my computer's time
with the video capturing, meaning that I need to know which datetime of my
computer corresponds to the first frame (pts = 0). My API calls are the
following ones:

    av_register_all()
    avcodec_register_all()
    avformat_network_init()
    avformat_open_input()
    avformat_find_stream_info()
    av_read_play()
    loop
      av_init_packet()
      av_read_frame()
      [...]
      av_free_packet
    end loop

With the calls above, I successfully read frames, but I do need to know how
can I know the exact absolute datetime that corresponds to the first frame,
since it has a pts of 0. Maybe I can use a time() function or GetSystemTime
(I am using Windows) between two calls of the above, but do not really know
how libav works. I will appreciate your help,

Kind regards,

--
Dídac Pérez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20121217/1ce70702/attachment.html>


More information about the Libav-user mailing list