Compression on AVI recoreded by Fraps

  • Yumeyao

    Yumeyao - 2013-07-25

    I have recorded 2 AVIs using Fraps, because I know the video content is similar throughout the file, so I think compressing it using 7-zip would reduce the file size dramatically.

    And yes, for one AVI, using 64-bit 7-zip with LZMA (dictionary size of 1024MB, word size of 256, completely solid), I achieved a compression ratio of 7% of it, and the file size was 32.5GB -> 2.33GB.

    But for another, I could only achieve a compression ratio of ~35%(I haven't finished compressing it but definately it's hopeless for a ratio of lower than 10%). So could anyone suggest what should I do to compress it as efficient as the one mentioned above?
    They both have similar video content(and similar in common), same encoding(Fraps's YUV colorspace for video, PCM for audio).
    FWIW, the size of second file is 45.6GB.

    So I guess there should be something such as 'encoding offset' that makes it so different, am I right?

    In case someone is interested, I could upload the starting part(say, 100MB) of the files on request, the compression ratio is almost consist in the whole process.

    Last edit: Yumeyao 2013-07-25
  • Shell

    Shell - 2013-07-25

    There is no universal recipe to get maximal compression. You may try the following.
    1. Raise the word size - this usually (but not always) increases compression. The maximum is 273 rather than 256; I suggest you to try the values from 273 down to 267 or so.
    By the way, if you compress a single file, solid archiving has no effect. You should compress multiple similar files to benefit from the solid mode.
    2. Tune LZMA finely by using its command-line parameters lc, lp and pb. Perhaps, pb1 will be better than the default pb2. Try all possible combinations on a smaller file and choose the optimal one. However, be aware that the optimal LZMA parameters vary greatly from one file to another - especially word size.
    3. Try using the Delta filter. I guess that either Delta:6 or Delta:12 may be the optimal setting. Note that you may need to change LZMA parameters if you use this filter.

  • Yumeyao

    Yumeyao - 2013-07-26

    Thx for the suggestions.

    1. The video part is 8-bit YUV, and the audio part is 48khz 16-bit PCM, both multiple of 256, therefore 256 should be the best choice. Changing it to other values only made the result worse.
      Yes I know change 256 to 273 really helps in most cases, but not, and probably never on such periodly regular data.

    2. I tought changing to pb0..4 might impact on the result but sadly it didn't.
      I then followed your suggestion trying using different combinations of lc, lp and pb but still no good result..

    3. Using delta on muxed AVI doesn't seem a good choice either. But it might worth demuxing the AVI and then try out applying delta.

    Last edit: Yumeyao 2013-07-26
  • Yumeyao

    Yumeyao - 2013-07-26

    Anyway I think I may know the answer now.

    I thought the contents are so similar that they will have similar compression ratios, but in fact there's one point I missed:

    Both video have a framerate of 24fps, but actually the video is almost still, and inter-frame-similar.
    Yet one video has a small area that really changes every frame, and that's probably the main cause. Although the change is regular, say, ~1 second for a loop, but it's enough for a general compression algrithm(such as 7z, lzma) to be unable to handle this change, resulting in a compresstion radio raise.

    Last edit: Yumeyao 2013-07-26

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks