Skip to content

More robust FFmpeg version getter #100

@NicolasHug

Description

@NicolasHug

_core.get_ffmpeg_library_versions() returns a dict of strings. As discussed in D58974580, versions are better exposed as namedtuples, like so:

[nav] In [25]: _Version = namedtuple("_Version", ("major", "minor", "micro"))
[ins] In [26]: version = _Version(1, 2, 3)
[ins] In [27]: version
Out[27]: _Version(major=1, minor=2, micro=3)
[ins] In [28]: version < (1, 2, 4)
Out[28]: True
[ins] In [29]: version < (1, 2, 3, 4)
Out[29]: True
[ins] In [30]: version.major
Out[30]: 1

This is the same kind of struct that sys.version_info returns (we can't use their base class, but that doesn't matter).


Also, we're relying on av_version_info() to get the major FFmpeg version, but that's not recommended :

This string has no fixed format and can change any time. It should never be parsed by code.

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