4 ms·
I use zstd in my btrfs filesystem as a transparent file compression. I can still seek inside files.
by traverseda 4y ago
I use zstd in my btrfs filesystem as a transparent file compression. I can still seek inside files.
- heavyset_go 4y agobtrfs does compression at the block level, whereas video compression would do it at the stream level. Files themselves are not compressed on btrfs, it's the blocks that get compressed.
- formerly_proven 4y agoVideo streams are generally compressed in blocks called group of pictures (GOP) as well. That's how seeking in a video stream works - skip to the beginning of the GOP the desired timestamp is in, start decoding from there and show images once the timestamp is reached.
- traverseda 4y agoWell that was kind of my point, why assume that the above poster would go for the most naive possible implementation when thinking about it for more than a minute yields several obvious solutions, and there are known implementations that have already solved that problem? ZSTD also has some fun "dictionary" operations so that even if you're chunking your data you can still take advantage of cross-chunk redundancy by "training" across all your chunks before the compression stage.