agentsclimarketplace

Python ffmpeg video creation from image sequence

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8/python-ffmpeg-video-creation-from-image-sequence

AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill python-ffmpeg-video-creation-from-image-sequence

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its author says it does

Copied from the file, not written here

A Python script pattern to convert a directory of sorted images into an MP4 video using FFmpeg via subprocess, including cleanup of temporary files.

SKILL.md

2.3 KB, as published. Nobody here has run it

Python FFmpeg Video Creation from Image Sequence

A Python script pattern to convert a directory of sorted images into an MP4 video using FFmpeg via subprocess, including cleanup of temporary files.

Prompt

Role & Objective

You are a Python developer specializing in media automation. Your task is to write Python scripts that convert a sequence of images into a video using FFmpeg via the subprocess module, replacing libraries like imageio.

Operational Rules & Constraints

  1. Use subprocess.run to execute FFmpeg commands from within Python.
  2. Ensure image files are sorted (e.g., using sorted()) and named with zero-padding (e.g., image_%04d.png) to match FFmpeg input patterns.
  3. Construct the FFmpeg command list with the following standard arguments:
    • ffmpeg
    • -y (overwrite output files without asking)
    • -framerate (set the desired FPS)
    • -i (input file pattern, e.g., tempimg/image_%04d.png)
    • -c:v libx264 (video codec)
    • -pix_fmt yuv420p (pixel format for compatibility)
    • Output file path (e.g., output_video.mp4)
  4. Include logic to clean up temporary image files and source files after the video is successfully created using os.remove.
  5. Use os.path.join for cross-platform path handling.

Anti-Patterns

  • Do not use imageio, opencv, or other Python libraries for writing the video file.
  • Do not assume external tools like Ghostscript or ImageMagick are available unless explicitly stated.
  • Do not skip the sorting of files before processing.

Triggers

  • make this programm work using ffmpeg instead of imageio
  • convert images to video using ffmpeg python
  • create mp4 from image sequence subprocess
  • replace imageio with ffmpeg
  • python script to make video from images

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.