Agent skill

FFmpeg Video Editing

Cut, trim, concatenate, and split video files - basic video editing operations

Stars 897
Forks 232

Install this agent skill to your Project

npx add-skill https://github.com/benchflow-ai/skillsbench/tree/main/tasks-no-skills/multilingual-video-dubbing/environment/skills/ffmpeg-video-editing

SKILL.md

FFmpeg Video Editing Skill

Basic video editing operations: cutting, trimming, concatenating, and splitting videos.

When to Use

  • Cut segments from video
  • Trim video length
  • Concatenate multiple videos
  • Split video into parts
  • Extract specific time ranges

Cutting and Trimming

bash
# Cut from 10s to 30s (using -ss and -to)
ffmpeg -ss 00:00:10 -to 00:00:30 -i input.mp4 -c copy output.mp4

# Cut from 10s for 20 seconds duration
ffmpeg -ss 00:00:10 -t 20 -i input.mp4 -c copy output.mp4

# First 60 seconds
ffmpeg -t 60 -i input.mp4 -c copy output.mp4

# Last 30 seconds (need duration first)
ffmpeg -sseof -30 -i input.mp4 -c copy output.mp4

Precise Cutting

bash
# With re-encoding (more precise)
ffmpeg -ss 00:00:10 -i input.mp4 -t 20 -c:v libx264 -c:a aac output.mp4

# Keyframe-accurate (faster, may be less precise)
ffmpeg -ss 00:00:10 -i input.mp4 -t 20 -c copy output.mp4

Concatenation

Method 1: File List (Recommended)

bash
# Create list.txt file:
# file 'video1.mp4'
# file 'video2.mp4'
# file 'video3.mp4'

ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp4

Method 2: Same Codec Files

bash
# If all videos have same codec/format
ffmpeg -i "concat:video1.mp4|video2.mp4|video3.mp4" -c copy output.mp4

Method 3: Re-encode (Different Codecs)

bash
# Re-encode for compatibility
ffmpeg -f concat -safe 0 -i list.txt -c:v libx264 -c:a aac output.mp4

Splitting Video

bash
# Split into 60-second segments
ffmpeg -i input.mp4 -c copy -f segment -segment_time 60 \
  -reset_timestamps 1 output_%03d.mp4

# Split at specific timestamps
ffmpeg -i input.mp4 -ss 00:00:00 -t 00:01:00 -c copy part1.mp4
ffmpeg -i input.mp4 -ss 00:01:00 -t 00:01:00 -c copy part2.mp4

Extract Segment with Re-encoding

bash
# When you need to change quality/codec
ffmpeg -ss 00:00:10 -i input.mp4 -t 20 \
  -c:v libx264 -crf 23 -c:a aac -b:a 192k output.mp4

Multiple Segments

bash
# Extract multiple segments
ffmpeg -i input.mp4 \
  -ss 00:00:10 -t 00:00:05 -c copy segment1.mp4 \
  -ss 00:01:00 -t 00:00:10 -c copy segment2.mp4

Notes

  • Use -c copy for speed (no re-encoding)
  • -ss before -i is faster but less precise
  • -ss after -i is more precise but slower
  • Concatenation requires same codec/format for -c copy
  • Use file list method for best concatenation results

Expand your agent's capabilities with these related and highly-rated skills.

benchflow-ai/skillsbench

csv-processing

Use this skill when reading sensor data from CSV files, writing simulation results to CSV, processing time-series data with pandas, or handling missing values in datasets.

897 232
Explore
benchflow-ai/skillsbench

pid-controller

Use this skill when implementing PID control loops for adaptive cruise control, vehicle speed regulation, throttle/brake management, or any feedback control system requiring proportional-integral-derivative control.

897 232
Explore
benchflow-ai/skillsbench

yaml-config

Use this skill when reading or writing YAML configuration files, loading vehicle parameters, or handling config file parsing with proper error handling.

897 232
Explore
benchflow-ai/skillsbench

simulation-metrics

Use this skill when calculating control system performance metrics such as rise time, overshoot percentage, steady-state error, or settling time for evaluating simulation results.

897 232
Explore
benchflow-ai/skillsbench

vehicle-dynamics

Use this skill when simulating vehicle motion, calculating safe following distances, time-to-collision, speed/position updates, or implementing vehicle state machines for cruise control modes.

897 232
Explore
benchflow-ai/skillsbench

web-interface-guidelines

Vercel's comprehensive UI guidelines for building accessible, performant web interfaces. Use this skill when reviewing or building UI components for compliance with best practices around accessibility, performance, animations, and visual stability.

897 232
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results