tkvideo/README.md

131 lines
3.7 KiB
Markdown
Raw Permalink Normal View History

2022-11-30 14:47:08 +00:00
<h1><strong>NOTE: This repository is archived as I'm no longer able to work on this project. Thanks to everyone who contributed to this.</strong></h1>
<hr></hr>
2020-11-22 02:41:52 +00:00
<p align="center">
<a href="https://github.com/huskeee/tkvideo">
2020-11-22 18:36:19 +00:00
<img src="https://raw.githubusercontent.com/huskeee/tkvideo/master/images/logo.png" alt="Logo" >
2020-11-22 02:41:52 +00:00
</a>
<h1 align="center">tkVideo</h1>
<p align="center">
Python module for playing videos (without sound) inside tkinter Label widget using Pillow and imageio
<br />
</p>
<p align = center>
<a href="https://github.com/huskeee/tkvideo/graphs/contributors">
<img src="https://img.shields.io/github/contributors/huskeee/tkvideo.svg?style=flat-square" alt="Contributors" />
</a>
<a href="https://github.com/huskeee/tkvideo/network/members">
<img src="https://img.shields.io/github/forks/huskeee/tkvideo.svg?style=flat-square" alt="Forks" />
</a>
<a href="https://github.com/huskeee/tkvideo/stargazers">
<img src="https://img.shields.io/github/stars/huskeee/tkvideo.svg?style=flat-squarem/huskeee/tkvideo/network/members" alt="Stargazers" />
</a>
<a href="https://github.com/huskeee/tkvideo/issues">
<img src="https://img.shields.io/github/issues/huskeee/tkvideo.svg?style=flat-square" alt="Issues" />
</a>
<a href="https://github.com/huskeee/tkvideo/blob/master/LICENSE">
2020-11-22 02:41:52 +00:00
<img src="https://img.shields.io/github/license/huskeee/tkvideo.svg?style=flat-square" alt="MIT License" />
</a>
</p>
<!-- ABOUT THE PROJECT -->
## About The Project
tkVideo is a Python module for playing videos in GUIs created with tkinter. It does so by binding to a `tkinter.Label` widget of the user's choice and rapidly changing its image object.
### Built With
* [tkinter (Python built-in)](https://docs.python.org/3/library/tkinter.html)
2021-03-26 14:42:46 +00:00
* [imageio](https://imageio.github.io)
2020-11-22 02:41:52 +00:00
* [Pillow](https://pypi.org/project/Pillow/)
## Installation
### End-users:
* Clone the repo and run `setup.py`
```sh
git clone https://github.com/huskeee/tkvideo.git
python ./tkvideo/setup.py
```
or
* Install the package from PyPI
```sh
pip install tkvideo
```
### Developers and contributors
* Clone the repo and install the module in developer mode
```sh
git clone https://github.com/huskeee/tkvideo.git
python ./tkvideo/setup.py develop
```
or
* Install the package from PyPI in editable mode
```sh
pip install -e tkvideo
```
This will create a shim between your code and the module binaries that gets updated every time you change your code.
<!-- USAGE EXAMPLES -->
## Usage
* Import tkinter and tkvideo
* Create `Tk()` parent and the label you'd like to use
2021-03-26 14:42:46 +00:00
* Create `tkvideo` object with its parameters (video file path, label name, whether to loop the video or not and size of the video)
2020-11-22 02:41:52 +00:00
* Start the player thread with `<player_name>.play()`
* Start the Tk main loop
Example code:
```py
from tkinter import *
from tkvideo import tkvideo
root = Tk()
my_label = Label(root)
my_label.pack()
2021-03-26 14:42:46 +00:00
player = tkvideo("C:\\path\\to\\video.mp4", my_label, loop = 1, size = (1280,720))
2020-11-22 02:41:52 +00:00
player.play()
root.mainloop()
```
## Issues / suggestions
Have a problem that needs to be solved or a suggestion to make? See the [issues](https://github.com/huskeee/tkvideo/issues) page.
## License
Distributed under the MIT License. See `LICENSE` for more information.
## Contact
Xenofon Konitsas - [@huskeeeeee](https://twitter.com/huskeeeeee) - konitsasx@gmail.com
Project Link: [https://github.com/huskeee/tkvideo](https://github.com/huskeee/tkvideo)
## Special thanks to
* [@Pythonista](https://stackoverflow.com/users/5230901/pythonista) on StackOverflow for the frame loading code
2021-03-26 14:42:46 +00:00
##### Readme file created using [Othneil Drew's awesome template ♥](https://github.com/othneildrew/Best-README-Template)