Video Edit

calesthio/OpenMontage/.agents/skills/video-edit

作者 calesthio9327439db69021ab4b0e2776729bf3b58fdb5a87无许可证65K 个星标收录于 2026年10月9日更新于 2026年10月9日仓库5天前更新

Edit videos locally using ffmpeg. Trim, concat, resize, speed, overlay, extract audio, compress, and convert. Use when: (1) Trimming or cutting video segments, (2) Concatenating multiple clips, (3) Resizing video for social platforms, (4) Extracting or replacing audio, (5) Compressing video, (6) Converting video formats, (7) Getting video info.

仅含说明Design & Creative
AI 生成的概览

使用 ffmpeg 命令在本地编辑视频,支持裁剪、拼接、缩放、音频与格式转换。

功能
该技能提供 ffmpeg 与 ffprobe 的本地视频编辑命令配方。涵盖查看视频元数据、裁剪片段、拼接多个片段、按平台预设缩放与加边、调整播放速度、提取或替换音频、压缩、转换格式以及添加图片叠加层。它会产出编辑后的视频或音频文件,并附带一份包含更详细配方与参数说明的参考文档。
适用场景
当你需要裁剪或拼接视频片段、为社交平台调整视频尺寸、提取或替换音轨、压缩或转换视频格式,或读取视频信息时使用。它适用于本地命令行视频编辑任务,前提是已安装 ffmpeg。
运行要求
需要在本地安装 ffmpeg 与 ffprobe(例如通过 Homebrew 或 apt 安装)。该技能不附带包装脚本,仅包含说明文档与一份参考文档。

Video Edit

Edit videos locally by running ffmpeg/ffprobe directly. No wrapper scripts needed.

Prerequisites

Install ffmpeg (includes ffprobe):

bash
# macOSbrew install ffmpeg
# Ubuntu/Debiansudo apt update && sudo apt install -y ffmpeg
# Verifyffmpeg -version && ffprobe -version

Quick Reference

Get video info

bash
ffprobe -v quiet -print_format json -show_format -show_streams video.mp4

Trim

bash
ffmpeg -y -ss 00:00:30 -to 00:01:45 -i video.mp4 -c copy trimmed.mp4

Concatenate clips

bash
# 1. Create a file listprintf "file '%s'\n" clip1.mp4 clip2.mp4 clip3.mp4 > list.txt
# 2. Concat with stream copyffmpeg -y -f concat -safe 0 -i list.txt -c copy joined.mp4

Resize for platform

bash
ffmpeg -y -i video.mp4 \  -vf "scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2:black" \  -c:a copy tiktok.mp4

Change speed

bash
# 2x fasterffmpeg -y -i video.mp4 -filter:v "setpts=0.5*PTS" -filter:a "atempo=2.0" fast.mp4
# 0.5x (slow motion)ffmpeg -y -i video.mp4 -filter:v "setpts=2.0*PTS" -filter:a "atempo=0.5" slow.mp4

Extract audio

bash
ffmpeg -y -i video.mp4 -vn -acodec libmp3lame audio.mp3

Replace audio

bash
ffmpeg -y -i video.mp4 -i audio.mp3 -c:v copy -map 0:v:0 -map 1:a:0 -shortest output.mp4

Compress

bash
ffmpeg -y -i video.mp4 -crf 23 -preset medium -c:a copy compressed.mp4

Convert format

bash
ffmpeg -y -i video.mov output.mp4

Add image overlay

bash
# Logo in top-right cornerffmpeg -y -i video.mp4 -i logo.png \  -filter_complex "overlay=W-w-10:10" -c:a copy watermarked.mp4

Platform Presets

PlatformResolutionScale + pad filter
TikTok1080 x 1920scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2:black
YouTube1920 x 1080scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2:black
Instagram1080 x 1350scale=1080:1350:force_original_aspect_ratio=decrease,pad=1080:1350:(ow-iw)/2:(oh-ih)/2:black
Square1080 x 1080scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2:black
Twitter/X1920 x 1080scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2:black

Use the filter with: ffmpeg -y -i input.mp4 -vf "<filter>" -c:a copy output.mp4

Tips

  • Always use -y to overwrite output without prompting.
  • Use -c copy when you only need to cut/join (no re-encoding, very fast).
  • Lower CRF = better quality, larger file. Range 18-28 is typical; 23 is the default.
  • For detailed recipes and flag explanations, see references/operations.md.

来源与署名

来源:calesthio/OpenMontage位于.agents/skills/video-edit提交9327439

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架