Simplify creation of photo/video slideshows in Kdenlive with Ken-Burns effect (pan & zoom) and automatic synchronization of transitions to music beats.
You can watch a sample input project here: https://youtu.be/mox07jgtXmU
And the result after processing it in the slideshow editor is here: https://youtu.be/lvu-4r3QrZo
- Kdenlive video editor
- Kdenlive Slideshow Editor
- Python3 as a scripting glue
- PyQt5 for a user interface
- madmom for automatic beat detection in music
- OpenTimelineIO - pathed version of
OpenTimelineIO
for working with the kdenlive file format.
Create local python virtual environment and install packages:
sudo apt install python3-virtualenv
cd ~/python_env
virtualenv slideshow
cd slideshow
source bin/activate
# install packages required by application to run
pip install -r requirements.txt
# if you plan development work, you can install packages for application
# and packages for development with:
pip install -r requirements-dev.txt
git clone https://github.com/michalfapso/kdenlive_slideshow_editor.git
# To test-run the application:
cd kdenlive_slideshow_editor
python3 app.py
Super-fast tutorial:
- Create a simple slideshow in Kdenlive (without any transitions), just put there pictures, video clips and some music.
- Edit start and finish boxes of the Ken-Burns effect using this editor
- Render the exported project in Kdenlive
- To modify the slideshow, edit the Kdenlive file created in the step 1 and iterate this process until you're happy :)
Here are those steps described in more details:
Create a basic Kdenlive file with pictures, video clips and music track.
- Run Kdenlive
- You should have 3 tracks in your project:
- main_v: video track for pictures and video clips
- main_a: audio track for audio of your video clips
- music: audio track for music
- Put your photos and video clips to the main_v and main_a tracks.
- You can change the default duration of picture clips in
Main Menu -> Settings -> Configure Kdenlive -> Default Durations -> Image Clips
. The default of 5 seconds is quite slow. Try to use 3 seconds for more dynamic slideshows. The final duration of each clip will be altered by the beat detection of the music track
- Put your music to the music track.
- Save the project to e.g.
~/Videos/kdenlive_slideshow_test/slideshow_test.kdenlive
Here, we'll set start and finish boxes of picture clips and align them to match music beats.
- Open your terminal
- Load the python virtualenv:
source ~/python_env/slideshow/bin/activate
- Go to the Kdenlive project's folder and run the
app.py
from there:
cd ~/Videos/kdenlive_slideshow_test/
python3 ~/python_env/slideshow/kdenlive_slideshow_editor/app.py
- Click on the "Load .kdenlive or bboxes.json", select your Kdenlive project file there. You can now set start and finish boxes of the Ken-Burns effect for picture clips.
- The start box is green, finish box is red.
- Press the TAB key or click on "Switch In/Out Editor" to switch between them
- Use your mouse wheel to resize the active box
- Press spacebar or click on "Next Image" to go to the next image in the slideshow.
- The "Set Bbox Ratio Multiplier" is for modifying the ratio of start and finish boxes of all pictures in the slideshow. It may come handy when you find out that the Ken-Burns effect looks too fast or too slow.
- Click on the "Save bboxes.json" to save the info about start and finish boxes to a json file as a backup (e.g. to
slideshow_test_bboxes.json
)
- Next time, when you modify the Kdenlive project (adding more pictures, ...), load it again by clicking on the "Load .kdenlive or bboxes.json" button, but then click the button again to load the bboxes json file. All the boxes you set before are loaded in the editor and you can now specify just the boxes of the newly added pictures.
- Click on the "Save .kdenlive" and save it to another file, e.g.
slideshow_test_out.kdenlive
. Don't overwrite the original Kdenlive project.
- It runs the music beat detector for all audio files in your music track and stores the output to
.downbeats
file located in the same folder as the original music file. The beat detection may take a few minutes for the first time, but afterwards it will be instantly loaded from the.downbeats
file.
- Open the exported Kdenlive project (e.g.
slideshow_test_out.kdenlive
) - You can tweak the slideshow if you want and render it.
If you want to edit the slideshow (add/remove/rearrange pictures or video clips), do it on the original project file (e.g. slideshow_test.kdenlive
). Then:
- Run the
app.py
- Load the Kdenlive file in the editor
- Load the boxes json file
- Set start and finish boxes of newly added pictures (if any)
- The rest is the same as before.
This project is licensed under the MIT license.