-2

I made this script for converting images to video using Python.

Problem: When I run this it is showing a blank screen.

Here is the code (uses tkinter and moviepy):

from moviepy.editor import *
from tkinter import *       
from tkinter.ttk import *
from tkinter import Tk     
from tkinter.filedialog import askopenfilename
from tkinter import Tk     
root = Tk()

print("-----Welcome to photo video maker by Adhi-----")
#1----------------------------------------------------------------
a =("Enter the name of image 1:  ")
img1 = input(a)
#2----------------------------------------------------------------
b =("Enter the name of image 2:  ")
img2 = input(b)
#3................................................................
c =("Enter the name of image 3:  ")
img3 = input(c)
 
#--------------------------------
Duration=input("Enter video duration:  ")
name=input("Enter new video name:  ")
#############################################################################
def b1():
    
    img = [img1, img2, img3]

    clips = [ImageClip(m).set_duration(duration)
          for m in img]

    concat_clip = concatenate_videoclips(clips, method="compose")
    concat_clip.write_videofile(name, fps=50)

btn = Button(root, text = 'Start', command = img)
btn.pack(side = 'top')

root.mainloop()
VC.One
  • 14,790
  • 4
  • 25
  • 57
  • I don't use Python but from research it seems `concatenate_videoclips` expects a list of video files (_eg:_ MP4 files) not images. If you want images as video frames you need to find an encoder. Remember MPEG is not free so don't expect to find an MP4 encoder easily. You can try **FFmpeg** which has an open-source encoder. – VC.One Nov 13 '20 at 07:53

1 Answers1

0

The answer for this is simple. Just wait for a minute and your code will be working.