Skip to content

File size control in CQP mode #165

Open

Description

@brauliobo

Hi, I'm speaking as the author of https://github.com/brauliobo/media-downloader-bot

I need to ensure the file size isn't bigger than Telegram 50mb limit for bot uploads.
I'm using the CQP setting there to provide a consistent quality.

In H264 I can provide a buffer size of 50M and restrict the max rate while using -crf option in FFMpeg (see https://github.com/brauliobo/media-downloader-bot/blob/main/zipper.rb#L33)

How can I do something similar with SVT-VP9?

Activity

  1. davidebeatrici commented on Mar 27, 2024

    @davidebeatrici
    Contributor

    If you know the video duration in advance you can calculate the maximum bitrate in order for the resulting file not to exceed 50 MB.

    Let's suppose the duration is 100 seconds:

    50 MB * 8 = 400 Mb
    400 Mb / 100 s = 4 Mb/s
    

    The command would be:

    ffmpeg -i vid.mp4 -c:v libsvt_vp9 -rc 1 -b:v 4M vid.webm
    

    Please note that the resulting file size is not determined by the video track(s) alone. Audio track(s) and the container itself should be taken into account.

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