Skip to main content

Python module for playing videos (without sound) inside tkinter Label widget using Pillow and imageio

Project description

Logo

tkVideo

Python module for playing videos (without sound) inside tkinter Label widget using Pillow and imageio

Contributors Forks Stargazers Issues MIT License

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

Installation

End-users:

  • Clone the repo and run setup.py
git clone https://github.com/huskeee/tkvideo.git
python ./tkvideo/setup.py

or

  • Install the package from PyPI
pip install tkvideo

Developers and contributors

  • Clone the repo and install the module in developer mode
git clone https://github.com/huskeee/tkvideo.git
python ./tkvideo/setup.py develop

or

  • Install the package from PyPI in editable mode
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

  • Import tkinter and tkvideo
  • Create Tk() parent and the label you'd like to use
  • Create tkvideo.tkvideo object with its parameters (video file path, label name, whether to loop the video or not and size of the video)
  • Start the player thread with <player_name>.play()
  • Start the Tk main loop

Example code:

from tkinter import *
from tkvideo import tkvideo

root = Tk()
my_label = Label(root)
my_label.pack()
player = tkvideo.tkvideo("C:\\path\\to\\video.mp4", my_label, loop = 1, size = (1280,720))
player.play()

root.mainloop()

Issues / suggestions

Have a problem that needs to be solved or a suggestion to make? See the issues page.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Xenofon Konitsas - @huskeeeeee - konitsasx@gmail.com

Project Link: https://github.com/huskeee/tkvideo

Special thanks to

  • @Pythonista on StackOverflow for the frame loading code
Readme file created using Othneil Drew's awesome template ♥

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tkVideo-0.1.tar.gz (301.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tkVideo-0.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file tkVideo-0.1.tar.gz.

File metadata

  • Download URL: tkVideo-0.1.tar.gz
  • Upload date:
  • Size: 301.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0

File hashes

Hashes for tkVideo-0.1.tar.gz
Algorithm Hash digest
SHA256 9f149696ac02eeb94f25b2501ad95bd403fbe689946562b6b0d56040961519f5
MD5 025e33c22e3b2f87a06a1c260a68bc74
BLAKE2b-256 72bef0259a7d8542b264f4327d745899dfbb69bc5e8087a0d0e3d7c5c47c8119

See more details on using hashes here.

File details

Details for the file tkVideo-0.1-py3-none-any.whl.

File metadata

  • Download URL: tkVideo-0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0

File hashes

Hashes for tkVideo-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f70e824dd03dc2742d90aeaf50cf66b8771421c4eeccdc63b9ae0865399d57b
MD5 ffa769de99086739eee67cec5acfce79
BLAKE2b-256 fd287f322b5f0b484d9d386049de07374c6bbdb22df62a3ceb860969a46f031c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page