1

I'm serving some videos. Basically the user uses VLC to play a https stream, the request hits my server then I look at the HTTP-RANGE request and provide the asked bytes. I would like to save the user progression timestamp in the videos. I tried to served_byte/video_size*video_duration but this is not working properly. I also tried using ffprobe like this ffprobe -i cool.mkv -show_entries packet=pos,pts_time -select_streams v -of compact=p=0:nk=1 -v 0 (see this post) but it takes approximately 5s to parse a 3Gb video which is quiet long... Isn't there just a simpler way to have the timestamp for a given byte?

Cheers :)

  • 2
    With a video that does not have a constant bitrate, there is no real simple way to do this - because there _is_ no direct correlation between play time and byte positions then. A halfway educated guess is the best thing you can attempt if you want to keep it pure math, and not actually decode the video. – CBroe Mar 03 '20 at 11:26
  • 1
    Yeah I see... I might push every frames and timestamps in the database then! Thank you for your answer! –  Nathoufresh Mar 03 '20 at 11:34

0 Answers0