Metadata-Version: 2.1
Name: avplayer
Version: 1.9.1
Summary: PyAV Media Player
Home-page: https://github.com/osom8979/avplayer
Author: zer0
Author-email: osom8979@gmail.com
Maintainer: zer0
Maintainer-email: osom8979@gmail.com
License: MIT License
Project-URL: GitHub: issues, https://github.com/osom8979/avplayer/issues
Project-URL: GitHub: repo, https://github.com/osom8979/avplayer
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: av
Requires-Dist: coloredlogs
Requires-Dist: numpy
Requires-Dist: overrides
Provides-Extra: pillow
Requires-Dist: Pillow; extra == "pillow"

# avplayer

[![PyPI](https://img.shields.io/pypi/v/avplayer?style=flat-square)](https://pypi.org/project/avplayer/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/avplayer?style=flat-square)
[![GitHub](https://img.shields.io/github/license/osom8979/avplayer?style=flat-square)](https://github.com/osom8979/avplayer/)

PyAV Media Player

## Installation

Install `avplayer`:

```shell
pip install avplayer
```

If you want to use the [tk](https://docs.python.org/3/library/tkinter.html) preview:

```shell
pip install avplayer[Pillow]
```

## Commandline Tools

```shell
python -m avplayer --help
```

## Realtime support

If it is important to get the latest frame in real-time streaming
such as RTSP streaming, we recommend adjusting the `--drop-*` related options.

```bash
python -m avplayer --drop-slow-frame --drop-threshold=1 ...
```

The `cvplayer.avconfig.AvConfig` class can be used as follows:

```python
from avplayer.avconfig import AvConfig

config = AvConfig(
    input_file="rtsp://...",
    drop_slow_frame=True,
    drop_threshold=1,
)
```

## Features

### [opencv-python](https://pypi.org/project/opencv-python/) compatibility

To prevent freeze when using opencv-python's imshow,
do not use `import av` at file-scope.

Please refer to the following link:
* [AV import leads to OpenCV imshow freeze · Issue #21952 · opencv/opencv](https://github.com/opencv/opencv/issues/21952)
* [python - Can't show image with opencv when importing av - Stack Overflow](https://stackoverflow.com/questions/72604912/cant-show-image-with-opencv-when-importing-av)

## Examples

### OpenCV - highgui

See the [examples/cv2_example.py](./examples/cv2_example.py) file.

## License

See the [LICENSE](./LICENSE) file for details. In summary,
**avplayer** is licensed under the **MIT license**.


