142 lines
4.8 KiB
Org Mode
142 lines
4.8 KiB
Org Mode
#+TITLE: Timelapse Tuner
|
|
|
|
Timelapse Tuner is a Bash script that automates the process of creating timelapse videos with randomly selected background music. It merges a timelapse video file with a randomly chosen audio file from the current directory, applying fade-in and fade-out effects to the audio for a polished result.
|
|
|
|
* Video Demo
|
|
:PROPERTIES:
|
|
:ID: 79d45ea3-780f-4cb7-adff-847580153cc6
|
|
:END:
|
|
|
|
[[https://www.youtube.com/watch?v=_zmkQXfcmow][Check out this quick demo of what Timelapse Tuner can do]] (Youtube)
|
|
|
|
* Features
|
|
:PROPERTIES:
|
|
:ID: ed705d67-d8db-4a99-aeca-8ac19bd69041
|
|
:END:
|
|
|
|
- Merges a specified timelapse video file with a randomly selected MP3 audio file
|
|
- Applies fade-in and fade-out effects to the audio for smooth transitions
|
|
- Randomly selects a start point in the audio file to add variety
|
|
- Supports custom input timelapse video and output file specification
|
|
- Allows customization of fade duration
|
|
- Provides detailed logging of the merging process
|
|
|
|
* Prerequisites
|
|
:PROPERTIES:
|
|
:ID: 81e96c1f-1850-4542-a427-dab68da4be73
|
|
:END:
|
|
|
|
This script requires the following tools to be installed and available in your system PATH:
|
|
|
|
- Bash (version 4.0 or later)
|
|
- FFmpeg
|
|
- FFprobe (usually comes with FFmpeg)
|
|
- bc (Basic Calculator)
|
|
|
|
You will also need to provide your own MP3 files for background music. If you need royalty-free music, you can find a great selection at [[https://pixabay.com/music/][Pixabay Music]].
|
|
|
|
* Installation
|
|
:PROPERTIES:
|
|
:ID: 1bd35147-fde9-4cff-b18c-7e6127ee0662
|
|
:END:
|
|
|
|
1. Clone this repository or download the script file:
|
|
|
|
#+BEGIN_SRC sh
|
|
git clone https://gitlab.com/rogs/timelape_tuner.git
|
|
cd timelapse_tuner
|
|
#+END_SRC
|
|
|
|
2. Make the script executable:
|
|
|
|
#+BEGIN_SRC sh
|
|
chmod +x tt
|
|
#+END_SRC
|
|
|
|
* Usage
|
|
:PROPERTIES:
|
|
:ID: a914277b-f210-417c-b687-b55e0539eb69
|
|
:END:
|
|
|
|
Run the script with the following command:
|
|
|
|
#+BEGIN_SRC sh
|
|
./tt --video <input_timelapse_video> --output <output_file> [--fade <fade_duration>]
|
|
#+END_SRC
|
|
|
|
** Options:
|
|
:PROPERTIES:
|
|
:ID: 3538bb4d-e7bd-4871-80a5-25b802aa15d1
|
|
:END:
|
|
|
|
- =--video=: Specify the input timelapse video file (required)
|
|
- =--output=: Specify the output MP4 file name (optional, default: output_video.mp4)
|
|
- =--fade=: Specify the fade duration in seconds (optional, default: 2)
|
|
|
|
** Example:
|
|
:PROPERTIES:
|
|
:ID: 34ab92af-9a7e-42d8-8559-82bd877a442f
|
|
:END:
|
|
|
|
#+BEGIN_SRC sh
|
|
./tt --video my_timelapse.mp4 --output final_timelapse.mp4 --fade 3
|
|
#+END_SRC
|
|
|
|
* How It Works
|
|
:PROPERTIES:
|
|
:ID: 4cba4005-9974-4a7a-837f-ab3f4fcdf2e7
|
|
:END:
|
|
|
|
1. The script checks for the required dependencies (FFmpeg, FFprobe, bc).
|
|
2. It verifies the input timelapse video file exists.
|
|
3. A random MP3 file is selected from the current directory to serve as background music.
|
|
4. The lengths of both the timelapse video and audio files are calculated.
|
|
5. Fade-in and fade-out durations are set (default 2 seconds, customizable with --fade) for smooth audio transitions.
|
|
6. A random start point in the audio file is selected to ensure variety in the background music.
|
|
7. FFmpeg is used to merge the timelapse video with the selected portion of the audio, applying fade effects.
|
|
8. The final timelapse video with background music is saved as an MP4 file.
|
|
|
|
* Providing Background Music
|
|
:PROPERTIES:
|
|
:ID: 0d01337a-c391-4f24-b6f7-07e644d8d101
|
|
:END:
|
|
|
|
Timelapse Tuner requires MP3 files in the same directory as the script to use as background music. Before running the script, make sure to add your desired MP3 files to the project directory.
|
|
|
|
For royalty-free music options, we recommend visiting [[https://pixabay.com/music/][Pixabay Music]]. They offer a wide variety of high-quality, free-to-use tracks that can enhance your timelapse videos.
|
|
|
|
* Logging
|
|
:PROPERTIES:
|
|
:ID: cfb9f3e9-581b-440e-a703-232fc7fc3a4b
|
|
:END:
|
|
|
|
The script provides detailed logging of each step in the process. Logs are printed to the console with timestamps, allowing you to follow the progress of your timelapse creation.
|
|
|
|
* Troubleshooting
|
|
:PROPERTIES:
|
|
:ID: 3181d824-595b-4222-b25f-b6db028e0bcc
|
|
:END:
|
|
|
|
If you encounter any issues:
|
|
|
|
1. Ensure all prerequisites are installed and up to date.
|
|
2. Check that you have read/write permissions in the current directory.
|
|
3. Verify that there are MP3 files in the same directory as the script for background music.
|
|
4. If FFmpeg fails, check the error message for details on what went wrong.
|
|
|
|
* Contributing
|
|
:PROPERTIES:
|
|
:ID: bfb3160f-6b64-4743-9db9-23ce1b0ea748
|
|
:END:
|
|
|
|
Contributions to improve Timelapse Tuner are welcome. Please feel free to submit a Merge Request with your enhancements.
|
|
|
|
* Acknowledgments
|
|
:PROPERTIES:
|
|
:ID: 58e07a75-cd65-4c1a-9f86-86c50eba9760
|
|
:END:
|
|
|
|
- FFmpeg project for providing powerful multimedia processing tools.
|
|
- The timelapse photography community for inspiration.
|
|
- Pixabay for providing a great source of royalty-free music.
|