Skip to main content

Play moviepy video clips with tkiner

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

Users

From PyPI

pip install tkvideo

From cloned repo

git clone https://github.com/MysteryBlokHed/tkvideo-moivepy
cd tkvideo-moviepy
python setup.py install

Developers and contributors

From cloned repo

git clone https://github.com/MysteryBlokHed/tkvideo-moivepy
cd tkvideo-moviepy
python setup.py develop

or

Editable mode from PyPI

pip install -e tkvideo-moviepy

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-moviepy
  • Create Tk() parent and the label you'd like to use
  • Get a moviepy video
  • Create tkvideo object with its parameters (moviepy clip, 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
from moviepy.editor import VideoFileClip

root = Tk()
my_label = Label(root)
my_label.pack()

clip = VideoFileClip('path/to/video.mp4')

player = tkvideo(clip, 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.

Project details


Download files

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

Source Distribution

tkvideo-moviepy-0.1.0.tar.gz (301.4 kB view hashes)

Uploaded Source

Built Distributions

tkvideo_moviepy-0.1.0-py3.10.egg (5.2 kB view hashes)

Uploaded Source

tkvideo_moviepy-0.1.0-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

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