File: tools_version.py

package info (click to toggle)
ha-ffmpeg 3.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 184 kB
  • sloc: python: 625; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 453 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import asyncio
import logging

import click

from haffmpeg.tools import FFVersion

logging.basicConfig(level=logging.DEBUG)


@click.command()
@click.option("--ffmpeg", "-f", default="ffmpeg", help="FFmpeg binary")
def cli(ffmpeg):
    """FFMPEG version."""

    async def get_version():
        ffversion = FFVersion(ffmpeg_bin=ffmpeg)
        print(await ffversion.get_version())

    asyncio.run(get_version())


if __name__ == "__main__":
    cli()