I have access to a server via SSH, I download files from it over SFTP or HTTP. I want to pull down a 4.4GB .mkv file but I have limited bandwidth.

I have used zip, gzip and p7zip, but the file is always 4.4GBs after the compression process. After fiddling with some of the CLI args I managed on one attempt to get the file down to 4.3GBs. I understand that the video file I have is a compressed h.264 file. I don't understand why I can't compress this further though (perhaps a question for another Stack-exchange forum)

Is there some way I can compress at a byte level so the compression tool would be agnostic of the file contents (which I presume these other tools are anyway, but they aren't working).

Is there perhaps some other way I can pull this fill down using less than 4.4GBs? I have no target file size in mind, but 4.3GBs for example is pointless (only 2-3%~ less).


Compression takes advantage of the fact that there are patterns in data that can be optimized out and indicated in a different way. This results in a drastic reduction in the number of patterns (since if a pattern was left then the original compression could just optimize it out instead of leaving it in the final file), which means that another round of compression can't perform much further reduction in size.


Your h264 stream is likely to already be highly compressed. Likely by attempting to compress it further you will in fact inflate the file size slightly (through the addition of headers, etc). You can't merely continue compressing a file down to a size that you like without compromising elsewhere, gzip and other compressors are not magic.

Likely the only way you can do this is by re-encoding your h264 stream to a lower bitrate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.