Been making timelapses with ffmpeg since forever, such a great tool. I try to always have a cam pointed at the sky and upload a snapshot every minute. A telegram command triggers the creation of a timelapse with a similar cli command like the OP. https://www.youtube.com/watch?v=5GvaFBzOu2c
Nice! What equipment do you use to capture? And does it push to some server... running RTSP?
Make timelapses easily using FFmpeg
41–50 of 80 posts
Re: Make timelapses easily using FFmpeg
#42Is there a variant that encodes ProRes lossless? I usually open them up in a new project just to create a lossless input video to work with in After Effects, and use that (if I use image sequence directly, DaVinci Resolve acts in weird ways). ffmpeg might ease that AE part.
Ffmpeg can encode into ProRes, but it’s technically an unofficial implementation.
What issues do you run into with image sequences?
Re: Make timelapses easily using FFmpeg
#43Nice, thanks! I tried using ffmpeg for a minor video editing task I had a few months ago - just a cut, crop, rescale, and volume adjust. I've tried a few of the mainstream GUI video editing tools, and IMO, they all have incomprehensible UIs, are way too bloated, and usually far too expensive for what I'm trying to do. FFmpeg may not be dead simple, but I find it much easier to skim the command line flag list to figur…
Worth a try!
Re: Make timelapses easily using FFmpeg
#44Earlier quoted context omitted.
Nice! What equipment do you use to capture? And does it push to some server... running RTSP?
I use an old Android phone with a long deprecated app called MobileWebCam (still available on certain sites) I removed the battery and connected the charger directly. It uploads a picture every minute, a Node.js backend creates the timelapse with ffmpeg. Currently experimenting with a TP-Link C520 cam and a Raspberry Pi. You can point the camera to different positions using ONVIF, use ffmpeg to grab the stream and ta…
Re: Make timelapses easily using FFmpeg
#45Been making timelapses with ffmpeg since forever, such a great tool. I try to always have a cam pointed at the sky and upload a snapshot every minute. A telegram command triggers the creation of a timelapse with a similar cli command like the OP. https://www.youtube.com/watch?v=5GvaFBzOu2c
Nice! What equipment do you use to capture? And does it push to some server... running RTSP?
I'm also working on a new one that uses an ASI533 Pro and a 4mm lens from a mirrorless camera to get better quality images.
Re: Make timelapses easily using FFmpeg
#46Somewhat unrelated, but a beautiful tool for extracting screenshots from video: MoviePrint https://www.movieprint.org/ & https://github.com/fakob/MoviePrint_v004/
I press shift-s to take a snapshot, not sure if that's a default hotkey or I set it to that a long time ago.
In the preferences you choose where it will save to and what format.
Re: Make timelapses easily using FFmpeg
#47Where FFMPEG really shines is stabilising video. Unfortunately not all versions have "vidstab". ffmpeg -i "$1" -vf vidstabdetect=shakiness=5:show=1 dummy.avi ffmpeg -i "$1" -vf yadif, format=yuv420p, vidstabtransform=zoom=2:optzoom=0:crop=black -c:v libx264 -b:a 32k stabilized264.mp4 Yesterweek's shaky video shot from a kayak: https://youtu.be/4pM0VeH4NE0?si=H2qTJfcvis3QmFlj
$ ffmpeg-english "capture video from the camera every 1 second and write it to jpg files"
$ ffmpeg-english "take all of the images ending with .jpg in this directory and make a 30fps timelapse of it"
Sound awesome? Here's the code for ffmpeg-english: #!/usr/bin/env python3
import openai
import sys
import os
import time
# Ensure you have set your OpenAI API key as an environment variable
openai.api_key = os.getenv("OPENAI_API_KEY")
client = openai.OpenAI()
def get_ffmpeg_command(task_description):
# Call the OpenAI API with the task description
response = client.chat.completions.create(
model="gpt-4",
messages=[
{"role":"system", "content":"You are an expert in FFmpeg commands. Given the following English description of a task, you respond with the correct FFmpeg command. Do not include any other information in your response except for the command only."},
{"role":"user", "content":task_description},
],
max_tokens=150,
temperature=0.5
)
command = response.choices[0].message.content.strip()
return command
def main():
if len(sys.argv) ", file=sys.stderr)
sys.exit(1)
task_description = " ".join(sys.argv[1:])
ffmpeg_command = get_ffmpeg_command(task_description)
# some basic guardrails
assert(ffmpeg_command.startswith("ffmpeg"))
assert(";" not in ffmpeg_command)
assert("|" not in ffmpeg_command)
print(f"Executing command: {ffmpeg_command} in 2 seconds (^C to cancel)")
time.sleep(2)
os.system(ffmpeg_command)
if __name__ == "__main__":
main()Re: Make timelapses easily using FFmpeg
#48I'd recommend Da Vinci Resolve for making timelapses. It performs really well and let's you scrub through before rendering anything which lets you clip just the part that you need. Plus you get the benefit of high export quality which can be fiddly with ffmpeg.
Resolve is insanely heavyweight for such a simple task. Those video editor UIs are incredibly hard to understand for people not using them every day.
Re: Make timelapses easily using FFmpeg
#49Bash script running on a cron job every hour with:
DATE=$(date +"%Y%m%d%H%M")
raspistill -o /home/pi/timelapse/$DATE.jpg -awb off -awbg 1.8,1.6
Then another bash script running once a week: DATE=$(date +"%Y%m%d%H%M")
ffmpeg -framerate 12 -pattern_type glob -i '*.jpg' -c:v libx264 -pix_fmt yuv420p -vf 'scale=1920:-2,crop=1920:1080:0:(in_h-1000)' 'timelapse-$DATE.mp4'
scp timelapse-$DATE.mp4 username@my.server:/home/user/
(Edited/simplified, I do a few other things in the scripts like compile the timelapse with pre-made timelapses and share via nginx on the Pi itself)