Why does lossless video compression cause the file size to go way up?

0

I have a 200MB AVI that I'm trying to add hardsubs to. I'm using VirtualDub to do it. I selected the H264 lossless codec for compression. The resulting file is 800MB. Why does this happen? Is there a better way to do this?

tony_sid

Posted 2011-01-01T02:01:00.553

Reputation: 11 651

fyi an avi can hold video with arbitrary encoding. – akostadinov – 2013-02-25T21:10:57.050

Answers

0

The reason is that lossless doesn't loss any quality but makes the file bigger and lossy which is the oppostite reduces video and sound quality but at a smaller file.

I would choose a different codec or choose the H.264 Lossy Codec for it.

EDIT: I would choose H.264 Lossless Codec and convert it using Handbrake MP4 ffmpeg format.

Benny

Posted 2011-01-01T02:01:00.553

Reputation: 658

Yes yes I know about lossy and lossless compression. Even if it's lossless that shouldn't cause the file size to go up by a multiple of four should it? I would expect the file size to not change much since I'm just adding subtitles. It should probably even go down since the subtitles cover graphical information. – tony_sid – 2011-01-01T02:16:10.623

See my edit. About Handbrake – Benny – 2011-01-01T02:17:43.337

Lossy compression loses information, and makes a smaller file size. When you expand you get an image back. That has a certain size (width x height) and colour depth (number of bits, normally between about 16 and 32 bits / pixel). When you then re-encode that in a lossless format, there is no permitted information that can be thrown away, so you are basically just (re-)encoding the picture, frame by frame. It will be bigger a consequence, and being lots bigger is no surprise. – quickly_now – 2011-01-01T02:26:07.053

So are you saying that the original AVI is compressed, and when I convert it it gets uncompressed and that's why it gets bigger? – tony_sid – 2011-01-01T02:35:19.223

every time you re-render and try not to lose data it will get bigger, hence the use of sameq or vcodec copy to generally maintain file size with ffmpeg. virtualdub may not be able to do this...and hard adding subs isn't something i like doing. you can add a track with sync data so that they can be toggled on and off with MUCH lower size overhead – RobotHumans – 2011-01-01T02:48:17.137

@quickly_now You should post it as an answer :) – Sathyajith Bhat – 2011-01-01T03:26:56.393

The reason I'm using hardsubs is because I want them to automatically show in youtube. – tony_sid – 2011-01-01T07:04:12.513