Skip to content

How to measure compressed video size #191

Closed

Description

@Zayn-Rekhi

How to measure compressed video size?

Hi guys, I really appreciate all of your video compression work. I cannot thank you guys enough. I was wondering how I can measure the size of my compressed video. Any help or suggestions would be greatly appreciated :) Thanks.

Activity

  1. YodaEmbedding commented on Jan 3, 2023

    @YodaEmbedding
    Collaborator

    Two ways:

    • During runtime, generate a bitstream or file and check its size. This is non-differentiable.

    • During training, compute the differentiable rate via the method below.

      Just like with the VAE image compression models, the rate in bpp can be measured via the cross-entropy between the actual symbols and their "predicted" distributions. Whenever the predicted distribution matches, the bit cost for encoding that symbol is low. This is effectively a sum of the log-likelihoods. Since these models minimize loss = R + lambda D, you may find the calculation for rate R (measured in bpp) in the RateDistortionLoss class in examples/train_video.py.

    Note: This question is best asked in Discussions.

  2. Zayn-Rekhi commented on Jan 3, 2023

    @Zayn-Rekhi
    Author

    I apologize for writing my question, I will make sure to write it in discussion moving forward. I liked your first suggestion and looking at the evaluation code I think that this has already been implemented. However, when I check the size of the binary file it is much, much smaller than the mp4 file produced by h265. Hence, I think I did something wrong. What could I have done wrong?

  3. YodaEmbedding commented on Jan 4, 2023

    @YodaEmbedding
    Collaborator

    Perhaps one of these may help:
    #190 (comment)
    #190 (comment) (first bullet point)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions