Trekky12 / kburns-slideshow

generate slideshow movies with Ken Burns effect on images
MIT License
60 stars 15 forks source link

GUI AttributeError #11

Closed danya-gharbieh closed 2 years ago

danya-gharbieh commented 2 years ago

The following error was appears in the console when I pressed start video creation button on the GUI:

Note that I installed python version 3.10.4

Error:

Exception in thread Thread-3 (startVideoCreation): Traceback (most recent call last): File "C:\Program Files\Python310\lib\threading.py", line 1009, in _bootstrap_inner self.run() File "C:\Program Files\Python310\lib\threading.py", line 946, in run self._target(*self._args, **self._kwargs) File "C:\Users\danya\OneDrive\Documents\kburns-slideshow-master\gui\app.py", line 1191, in startVideoCreation progressPopup = ProgressFrame(self) File "C:\Users\danya\OneDrive\Documents\kburns-slideshow-master\gui\ProgressFrame.py", line 11, in init tk.Toplevel.init(self, parent, options) File "C:\Program Files\Python310\lib\tkinter__init.py", line 2650, in init BaseWidget.init(self, master, 'toplevel', cnf, {}, extra) File "C:\Program Files\Python310\lib\tkinter__init.py", line 2595, in init__ BaseWidget._setup(self, master, cnf) File "C:\Program Files\Python310\lib\tkinter\init__.py", line 2564, in _setup self.tk = master.tk AttributeError: 'dict' object has no attribute 'tk'

any fixes or recommendations ?

Trekky12 commented 2 years ago

Hey @danya-gharbieh,

thank you for the bug report. I've fixed it in the development branch. Could you test the development branch and give a short feedback?

danya-gharbieh commented 2 years ago

thanks a lot it's fixed ,

but I faced another thing when I press create video the video is not generate I thought that this maybe because when the dialogue appears "save as type" filed is empty as shown in the attachment and below is my config file content,

Screenshot (9)

config file:

{ "ffmpeg": "C:\Users\name\Documents\ffmpeg-4.2.1-win64-static\bin\ffmpeg.exe", "ffprobe": "C:\Users\name\Documents\ffmpeg-4.2.1-win64-static\bin\ffprobe.exe", "aubio": "C:\Users\name\Documents\aubio-0.4.6-win64-ffmpeg\bin\aubioonset.exe",

"IMAGE_EXTENSIONS": ["jpg", "jpeg", "png"],
"VIDEO_EXTENSIONS": ["mp4", "mpg", "avi"],
"AUDIO_EXTENSIONS": ["mp3", "ogg", "flac"],

"output_width": 1280,
"output_height": 800,
"output_codec": "libx264",
"output_parameters": "-preset ultrafast -tune stillimage",
"slide_duration": 4,
"slide_duration_min": 1,
"fade_duration": 1,
"transition": "random",
"transition_bars_count": 10,
"transition_cell_size": 100,
"fps": 60,
"zoom_rate": 0.1,
"zoom_direction_x": "random",
"zoom_direction_y": "random",
"zoom_direction_z": "random",
"scale_mode": "auto",
"loopable": false,
"overwrite": false,
"generate_temp": false,
"delete_temp": false,
"temp_file_folder": "temp",
"temp_file_prefix": "temp-kburns-",
"sync_to_audio": false,
"sync_titles_to_slides": false,
"save": false,
"test": false

}

Trekky12 commented 2 years ago

Did you enter a filename for the output, e.g. video.mp4?

Otherwise could you paste the content of the logfile kburns-slideshow-gui.log?

danya-gharbieh commented 2 years ago

yes i entered "video_name.mp4"

attached is the file kburns-slideshow-gui.log

Trekky12 commented 2 years ago

Unfortunately I can't see a specific error message. FFmpeg errors must be suppressed to get the progress bar. So could you please execute the FFmpeg command from the logfile manually and tell when there are errors?

C:\Users\danya\OneDrive\Documents\ffmpeg-4.2.1-win64-static\bin\ffmpeg.exe -hide_banner -stats -y -i "C:/Users/danya/OneDrive/Desktop/1.JPG"  -i "C:/Users/danya/OneDrive/Desktop/2.jpg"  -i "C:/Users/danya/OneDrive/Desktop/3.jpg"  -i "C:/Users/danya/OneDrive/Desktop/4.jpg"  -i "C:/Users/danya/OneDrive/Desktop/22.jpg"  -i "C:/Users/danya/Downloads/music.mp3"   -filter_complex_script "C:\Users\danya\OneDrive\Documents\kburns-slideshow-master\temp\temp-kburns-video-script.txt" -t 16.0 -map [out]:v -c:v libx264 -preset ultrafast -tune stillimage -map [aout]:a -c:a aac -b:a 160k   "C:/Users/danya/OneDrive/Desktop/Video.mp4"

and could you save the slideshow as json and paste the slideshow file and the temp-kburns-video-script.txt here?

danya-gharbieh commented 2 years ago

temp-kburns-video-script.txt

example.json:

{ "config": { "output_width": 1920, "output_height": 1080, "slide_duration": 3, "slide_duration_min": 1, "fade_duration": 1.0, "transition": "random", "transition_bars_count": 10, "transition_cell_size": 100, "fps": 60, "zoom_rate": 0.1, "zoom_direction_x": "random", "zoom_direction_y": "random", "zoom_direction_z": "random", "scale_mode": "auto", "loopable": false, "overwrite": false, "generate_temp": false, "delete_temp": false, "sync_to_audio": false, "sync_titles_to_slides": false, "is_synced_to_audio": false }, "slides": [

    {
        "file": "C:\\Users\\danya\\OneDrive\\Desktop\\1.jpg",
        "slide_duration": 5,
        "overlay_text":{
            "title": "Title 1",
            "font": "Bauhaus 93",
            "font_size": 200,
            "duration": 2,
            "transition_x": "left-to-center",
            "transition_y": "center",
            "offset": 0
        },
        "overlay_color":{
            "color": "black",
            "opacity": 0.8,
            "duration": 2,
            "offset": 0
        }
    },

    {
        "file": "C:\\Users\\danya\\OneDrive\\Desktop\\2.jpg",
        "title": "subtitle"
    },
    {
        "file": "C:\\Users\\danya\\OneDrive\\Desktop\\3.jpg",
        "overlay_text":{
            "title": "Title 2",
            "font": "Bauhaus 93",
            "font_size": 200,
            "duration": 2,
            "transition_x": "center",
            "transition_y": "bottom-to-top",
            "offset": 0
        },
        "overlay_color":{
            "color": "black",
            "opacity": 0.8,
            "duration": 2,
            "offset": 0
        }
    }
],
"audio": [
    "C:\\Users\\danya\\Downloads\\music.mp3"
]

}

and the error:

Fontconfig error: Cannot load default config file [Parsed_drawtext_6 @ 000001cfb77f2780] Using "C:/WINDOWS/fonts/mingliub.ttc" Fontconfig error: Cannot load default config file [Parsed_drawtext_41 @ 000001cfb7878a80] Using "C:/WINDOWS/fonts/mingliub.ttc" [subtitles @ 000001cfb7881f80] Unable to parse option value "UsersdanyaOneDriveDocumentskburns-slideshow-developmenttemptemp-kburns-subs.srt" as image size Last message repeated 1 times [subtitles @ 000001cfb7881f80] Error setting option original_size to value UsersdanyaOneDriveDocumentskburns-slideshow-developmenttemptemp-kburns-subs.srt. [Parsed_subtitles_55 @ 000001cfb7877d80] Error applying options to the filter. [AVFilterGraph @ 000001cfb784c040] Error initializing filter 'subtitles' with args 'C:UsersdanyaOneDriveDocumentskburns-slideshow-developmenttemptemp-kburns-subs.srt' Error initializing complex filters. Invalid argument

Trekky12 commented 2 years ago

Thank you for your bug report. Apparently in the FFmpeg version the libfontconfig is not enabled (see. So you need to specify the full path to the font instead of the name of the font. Additionally there is an error with subtitles which is now fixed in the latest commit on the development branch.

Could you adjust your slideshow and remove the parameter font: "font": "Bauhaus 93", and add the font file: "font_file": "C:/Windows/Fonts/BAUHS93.TTF",

After updating your local version with the development branch your slideshow should work. Could you get me a short update?

danya-gharbieh commented 2 years ago

thanks a lot finally it works from both GUI and CLI