← Back to context

Comment by cbluth

1 day ago

How do you stream a timestamp?

I'm not sure if you're being facetious and making fun of my saying stream a timestamp instead of stream to a particular time in the video, but if so I guess https://news.ycombinator.com/item?id=46364765 suggested a way.

I just expected you would stream to point X in the stream that would be to the timestamp set to start and then to point y which would be the end. Obviously it would have to be able to figure out how the streamed file would map to time, which I don't know how to do which is why I said I would like a tool that did it other than announcing I made a tool that did it myself.

Of course obviously some tools like yt-dlp etc. have this capability with the --download-sections property but I want something for torrents.

You negotiate the header to find the video length, to then issue http get requests with the offset to the timestamp. Sometimes there’s an API that cuts with ffmpeg and returns the buffer. Sometimes you just need to fetch the raw bytes between offset+0 and offset+n.