mendevi.encoder

The encoding and decoding ffmpeg cmd.

Functions

decorator_pix_fmt(func)

Add a 8 bit pixel format conversion if required.

quality_to_rate(kwargs)

Return the absolute target bitrate in kbit/s.

support_pix_fmt(encoder, pix_fmt)

Return True if the encoder supports the given pixel format.

Details

mendevi.encoder.decorator_pix_fmt(func: Callable) Callable[source]

Add a 8 bit pixel format conversion if required.

Return general: None, vid_filter: str, cmd: list[str]

mendevi.encoder.quality_to_rate(kwargs: dict[str]) int[source]

Return the absolute target bitrate in kbit/s.

Based on https://twitch-overlay.fr/quelle-connexion-internet-choisir-pour-streamer-sur-twitch/ and https://bitmovin.com/blog/video-bitrate-streaming-hls-dash/

You can plot the bitrate with: mendevi plot mendevi.db -x bitrate -y psnr -f ‘mode = “vbr”’

The flow margin is taken to be twice as small and twice as large as the recommendations.

mendevi.encoder.support_pix_fmt(encoder: str, pix_fmt: str) bool[source]

Return True if the encoder supports the given pixel format.