https://github.com/osom8979/avplayer
PyAV Media Player
https://github.com/osom8979/avplayer
pyav python3
Last synced: about 1 year ago
JSON representation
PyAV Media Player
- Host: GitHub
- URL: https://github.com/osom8979/avplayer
- Owner: osom8979
- License: mit
- Created: 2023-01-18T10:56:28.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-09-27T07:21:34.000Z (over 1 year ago)
- Last Synced: 2025-03-23T19:51:31.430Z (about 1 year ago)
- Topics: pyav, python3
- Language: Python
- Homepage:
- Size: 159 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# avplayer
[](https://pypi.org/project/avplayer/)

[](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
### AioCv
See the [examples/aio_cv.py](./examples/aio_cv.py) file.
### 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**.