This is a basic media player application for Windows built using tkinter
for the user interface and moviepy
for video playback. It allows you to open, play, and stop video files.
- Open Video: Select video files via a file dialog.
- Play Video: Plays the loaded video.
- Stop Video: Stops playback and clears the display.
- Resizable Window: Adjust the window size as needed.
tkinter
(Standard Python library)moviepy
Pillow
Install the required libraries:
pip install moviepy pillow
-
Run the application:
python main.py
-
Open a video:
- Click the "Open" button and select a video file.
-
Play/Stop:
- Use the "Play" and "Stop" buttons to control playback.
- Supported video formats:
.mp4
,.avi
,.mkv
,.mov
. - Audio playback is not currently supported.
- Large video files may affect performance.
- Add audio playback.
- Implement a pause feature.
- Optimize performance for high-resolution videos.
- Include a progress bar.
video
: Holds the currently loaded video object.
-
open_video()
:- Opens a file dialog to select a video file.
- Loads the selected video into the
video
variable. - Automatically starts playback after loading.
-
play_video()
:- Plays the currently loaded video.
- Renders video frames on the tkinter canvas.
- Contains nested functions:
update_frame(frame)
: Converts a video frame to an image and displays it on the canvas.render_video()
: Iterates through video frames and updates the canvas in real-time.
-
stop_video()
:- Stops the video playback by clearing the canvas.