5 ms·
Where FFMPEG really shines is stabilising video. Unfortunately not all versions have "vidstab". ffmpeg -i "$1" -vf vidstabdetect=shakiness=5:show=1 dummy.avi
by timonoko 2y ago
Where 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 https://youtu.be/4pM0VeH4NE0?si=H2qTJfcvis3QmFlj
- timonoko 2y agoIf you really wish to install all the available options, you can run: brew install homebrew-ffmpeg/ffmpeg/ffmpeg $(brew options homebrew-ffmpeg/ffmpeg/ffmpeg --compact)
- dheera 2y agoHow about $ 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) < 2: print("Usage: ffmpeg-english <task_description>", 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()
- tempaccount420 2y agoI love when my commands are not reproducible even in the same shell session.
- bilekas 2y agoHonestly, ffmpeg is awesome enough being able to do what it can with a one-liner.. And all without python dependency, or even internet access.
- deleted 2y ago[deleted]
- neves 2y agoI took some side photos of my pregnant wife, hoping to make a time-lapse, but I never got around to it. The photos aren’t perfectly aligned since her position changes a bit in each one. Can ffmpeg fix that?
- deleted 2y ago[deleted]
- timonoko 2y agoYes. That is how you make lively picture show. Sometimes it tries to align unrelated objects, but that is just funny.
- 38 2y agoAvi? What is this 2002?
- timonoko 2y agoDummy.avi is useless map of perceived jerkiness.