Click here to Skip to main content
15,845,436 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using it to create a windows app interface. I would like a video to play in the interface and not have another window pop up that plays the video. I have discovered a library called Tkinter VideoPlayer which is specifically used to play a video in a label. However, when I run the code with the existing code I have, I get the error: "TypeError: init() got multiple values for argument 'scaled'" I understand that the "scaled" variable is getting different values at the same time which is the reason why the code is not running. However, I am not sure how to fix this. I will include my code and the Github repository link. Github link: <a href=""></a>

<pre>import tkinter as tk
from tkVideoPlayer import TkinterVideo

HEIGHT = 700
WIDTH = 800

root = tk.Tk()

canvas = tk.Canvas(root, height = HEIGHT, width=WIDTH)

#Background Picture
background_img = tk.PhotoImage(file = "GundamNarrative2.png")
background_label = tk.Label(root, image=background_img), relheight=1)

background = tk.Frame(root, bg = "blue"), rely=.1, relwidth=0.75, relheight=0.1, anchor="n")

# Buttons
record_button = tk.Button(background, text = "Record", bg = "green") = 0, rely = .5, relwidth = 0.15, relheight = .5)

skeleton_button = tk.Button(background, text = "Skeleton", bg = "red") = .4, rely = .5, relwidth = 0.15, relheight = .5)

frame_button = tk.Button(background, text = "Frame", bg = "yellow") = .85, rely = .5, relwidth = 0.15, relheight = .5)

video_label = tk.Label(background, text = "Enter video name below") = 0.4, rely=0, relwidth=.25, relheight=.15)

#Entry Area
entry = tk.Entry(background, bg = 'gray') = 0.4, rely=.15, relwidth=.25, relheight=.35)

#Bottom Frame
bottom_frame = tk.Frame(root, bg = "blue", bd=10) = .5, rely=0.25, relwidth=.75, relheight=.65, anchor = "n")

screen = tk.Label(bottom_frame, text = "I want video to play here", bg = "gray"), rely=0, relwidth=1, relheight=1)

#Error in line below
videoplayer = TkinterVideo(screen, scaled=True, pre_load=False)
videoplayer.load("C:\\Users\\jcoli\\PycharmProjects\\SwimCodeProject\\PoseVideos\\"), rely=0, relwidth=1, relheight=1)


What I have tried:

I have tried taking a look at the Tkinter VideoPlayer library and asking others on StackOverflow
Richard MacCutchan 19-Dec-21 12:41pm    
The problem must be in the library, or the manner in which you are calling it, But without more details it is impossible to guess.
Junwoo Kim 19-Dec-21 12:44pm    
I agree with that. What details would be helpful to add?
Richard MacCutchan 19-Dec-21 12:49pm    
No idea, since I do not know what the library code is doing. You will need to do some debugging first.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900