Is there a simple way (on the command line – I want to write a script which compresses all videos in a folder) to reduce the filesize of a video (almost) without quality loss? Is there a method which works equally well for different video format (mp4, flv, m4v, mpg, mov, avi)?
I should mention that most of the videos I would like to compress are downloaded web-videos (mp4, flv), so it's not clear if there is much room for further compression.
Best Answer
In the mystical land of the PNG, the most effective way of near-lossless compression is to compress the image with almost every possible combination of settings and compare the output. This is what applications like
pngcrush
do.There's no reason why a similar process wouldn't work, on paper. In practice, there are a few issues:
To top it all off, you're dealing with content that's already poisoned with artefacts and encoding sludge. My simple answer for "Is there a simple way" has to be No.
But if you have a shed load of low-compression videos like FLV (a fairly rubbish compression in my experience with the format), it might be worth having a go with
ffmpeg
ormencoder
for the FLVs. Something like this might work:But there will be loss. You just have to judge how much is acceptable.