1. Iterate through each element of the list (dictionary).
2. Extract the paths to all media files from the dictionary and save them in variables.
3. Calculate the duration of the audio file:
audio_clip = AudioFileClip(audio_path)
duration = audio_clip.duration4. Based on the duration of the audio file, calculate and perform the animation of the image.
You can add a logic to relate the duration of the audio file to the number of images. For example, if the duration of the audio file is less than 3 seconds, use one image; if it's longer, use two images.
5. To implement the joining of video footage, check for the presence of a video file in the folder. If a video file exists, the image animation is not performed, and the video file is joined instead.
6. After performing the animation, merge the video file with the audio file.
7. After completing the loop, combine the finished video segments from each scene into one final file.
8. Save the final video file in the
generated_videos folder.
