Skip to main content

Direct Download - no timestamp

Answered

Comments

3 comments

  • Andrey Terentyev
    • Network Optix team

    Hello,

    Direct download interface has been deprecated. We don't recommend using it.

    Here are interfaces where timestamp is available or can be calcualted.

    1. RTSP streaming. /{deviceId}

    2. HLS streaming. /hls/{deviceId}.m3u. Use the EXT-X-PROGRAM-DATE-TIME tag of a stream.

    The EXT-X-PROGRAM-DATE-TIME tag associates the first sample of a
       Media Segment with an absolute date and/or time.

    for calculating the timestamp, add sequentially a chunk duration to this value

    #EXTM3U
    #EXT-X-VERSION:3
    #EXT-X-TARGETDURATION:6
    #EXT-X-MEDIA-SEQUENCE:194

    #EXT-X-PROGRAM-DATE-TIME:2023-01-19T19:02:12.537+04:00
    #EXTINF:5,014000,
    /hls/9587e75c794530f24a430331628bebd6.ts?authKey=9464cb17-dee9-43c0-8f81-cf409d930aaa&hi&sessionID=2&startTimestamp=1674140532537000&durationUsec=5014000&live

    3. /media/{deviceId}.{format} - advised to be used instead of direct download.

    use mp4 format with utc parameter set to true.

    Here is an example of atom

    UUIDTfxdBox:
                                    type: uuid
                                    size: 44
                                    uuid: 6d1d9b05-42d5-44e6-80e2-141daff757b2
                                    version: 1
                                    flags: 0(0x00000000)
                                    FragmentAbsoluteTime: 16741428026210000
                                    FragmentDuration: 83340000
    0
  • Thibault Bougerolles

    Hello,

    Could we have more information on how to retrieve FragmentAbsoluteTime from an HTTP stream? (using FFmpeg preferably).
    I manage to find the information for an HLS stream quite easily, but I can't seem to find a way to retrieve that timestamp data from an HTTP stream using the ffmpeg API or in the command line. (or with any other tool).

    The opened stream always starts with a pts at 0.

    The URL we request has this format :
    https://localhost:7001/media/{device_id}.mp4?utc=true 

    We do not specify anything else, maybe it is only available if we ask for a pos and endPos?

    0
  • Andrey Terentyev
    • Network Optix team

    Hello,

    https://localhost:7001/media/{device_id}.mp4?utc=true 

    By the url you've provided the Server will send you endless mp4 file vie HTTP.

    We don't have a ready to use code example, but here is what I've found.

    https://stackoverflow.com/questions/45942670/ffmpeg-c-how-to-get-the-timestamp-in-seconds-since-epoch-that-a-frame-was-tak

     

    0

Please sign in to leave a comment.