Earlier quoted context omitted.
If you assume there's only one file you could probably skip it. But the question was about using the zip file as a source for streaming, and that will work fine even if you have to spend an extra read to load the directory first.
I don't think you can safely assume random reads if you are streaming. Usually the point of a stream is you have to process the file in-order. Regardless, if for some weird reason you really liked the zip compression algorithm (DEFLATE), you would probably just use gzip instead (same compression algorithm, no weird file format with critical metadata at the end). Its also the compression algo used by PNGs.
I could interpret this a couple ways, so let me try to clarify.
If you're talking about the ability to seek around inside the video, it is correct that this will not work well.
If you're talking about seeking to the end of the zip file to read the directory, I don't think that was part of the scenario. My interpretation of the question is that the server has a zip file and has to output a video stream directly from the zip.
If the zip itself is being delivered as a single stream, start to end... I have no idea what kind of scenario this is. There's no zip-streaming protocol out there. Filesystems can give you the end of a zip. HTTP can give you the end of a zip.
> Regardless, if for some weird reason you really liked the zip compression algorithm (DEFLATE), you would probably just use gzip instead (same compression algorithm, no weird file format with critical metadata at the end). Its also the compression algo used by PNGs.
Maybe. You might want windows users to be able to easily extract the video.