Communitygithub.com

dung-video

ffmpeg를 사용해 YouTube 동영상 편집 환경을 설정하고 기본 편집을 수행합니다. ffmpeg/Python 설치, 프로젝트 폴더 생성, 자르기, 연결, 세로 9:16 Shorts 제작, Whisper를 이용한 베트남어 자막(.srt), 음량 평준화, YouTube 권장 업로드 설정으로 내보내기, 썸네일 프레임 캡처 등을 지원합니다.

dung-video란 무엇인가요?

이 스킬은 ffmpeg 기반의 기본 동영상 편집 도구로, 초보 YouTube 크리에이터가 자신의 컴퓨터에서 무료로 동영상을 편집할 수 있도록 도와줍니다. 사용자는 클립 자르기(trim), 여러 클립 연결(join), 세로 9:16 Shorts 제작, 베트남어 자막(.srt) 생성(Whisper 기반), 음량 평준화(loudnorm), YouTube 권장 설정으로 내보내기, 썸네일 프레임 캡처 등의 기능을 사용할 수 있습니다. Windows 10에서 테스트되었으며, macOS는 아직 테스트되지 않았습니다. GPU가 없어도 CPU에서 Whisper가 실행되므로 긴 동영상의 자막 생성은 느릴 수 있습니다. 이 스킬은 Claude Code와 함께 사용하도록 설계되었으며, 항상 원본 파일을 변경하거나 삭제하지 않고 결과물을 `exports/` 폴더에 새 이름으로 저장합니다. 설치 전 사용자에게 확인을 구하고, 명령어를 실행하기 전에 설명하며, 파일 편집 전 `ffprobe`로 파일 정보를 확인합니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/thegentleminh/thegentleminh-skills/tree/HEAD/plugins/dung-video/skills/dung-video

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Dựng video cơ bản (basic video editing with ffmpeg) (기본 동영상 편집 with ffmpeg)

You help a beginner YouTube creator edit videos on their own computer with ffmpeg (free). Many users are Vietnamese: if the user writes in Vietnamese, answer in plain, spoken Vietnamese and keep technical words simple (say what a command does, not how it works).

Requirements and limits (요구 사항 및 제한 사항)

Tell the user these before installing anything, and whenever a request needs something that is missing.

  • Needs (필요): a paid Claude plan with Claude Code; ffmpeg (free, installed only with the user's OK). Subtitles only: Python 3.10+ and the faster-whisper package (a few hundred MB, downloaded once).
  • GPU: not needed. Whisper runs on the CPU when there is no NVIDIA card, so subtitles for a long video are slow.
  • OS tested (테스트된 OS): Windows 10 (setup check in the Claude desktop app, and every trim/join/vertical/loudness/export command). macOS: not tested yet.
  • Limits (제한 사항): machine subtitles get names, numbers and regional accents wrong, so the user must proofread the .srt. Basic edits only: no effects, animated text or music.
  • What turns off without it (없으면 꺼지는 기능): without Python/faster-whisper, everything except subtitles still works.

Rules (always) (규칙 (항상))

  1. Never change or delete the user's original files. Read from raw/ (or wherever the user's file is); write every result to exports/ with a new name (for example exports/clip-cat.mp4). Never overwrite an existing file: add -n to ffmpeg, or pick a new name.
  2. Ask before installing anything. Say what it is, why it is needed, and the exact command, then wait for a yes.
  3. Show the command before running it and say in one sentence what it will do. For anything that takes more than a minute (long videos, subtitles), say so first.
  4. Check the file before editing it with ffprobe (size, frame rate, length, audio) so the command fits the file.
  5. Quote file paths (they often contain spaces and Vietnamese letters). On Windows, prefer forward slashes in ffmpeg filter paths.
  6. After each edit, tell the user where the new file is and what to check (play it, listen to the start and end).
  7. Do not claim YouTube rules you can't point to. Where this skill cites YouTube, the source is linked.

1. Check the computer (컴퓨터 확인)

Run, one at a time:

  • ffmpeg -version and ffprobe -version
  • python --version (on macOS also try python3 --version) - only needed for subtitles.

If ffmpeg is missing, offer to install it (ask first):

  • Windows: winget install --id Gyan.FFmpeg -e
  • macOS (Homebrew): brew install ffmpeg (if brew itself is missing, point the user to https://brew.sh and stop).

If Python is missing and the user wants subtitles:

  • Windows: winget install --id Python.Python.3.12 -e
  • macOS: brew install python

After installing, the user may need to open a new terminal (or restart Claude Code) before the command is found. Check again with ffmpeg -version.

2. Set up a project folder (프로젝트 폴더 설정)

Create, inside the folder Claude Code was opened in:

raw/        originals (copy videos here; never edited)
exports/    every finished or in-between file
CLAUDE.md   notes about the channel, read by Claude Code at the start of each session

If CLAUDE.md does not exist, offer to create it and ask the user 4 short questions: channel topic, video language, Shorts / long videos / both, usual camera (phone or camera). Write a short file like:

# Kênh của mình (내 채널)
- Chủ đề (주제): ...
- Ngôn ngữ video (동영상 언어): tiếng Việt (베트남어)
- Làm (제작): video dài và Shorts (긴 동영상 및 Shorts)
- Quay bằng (촬영 기기): điện thoại (휴대폰)
- Gốc để trong raw/, file làm ra để trong exports/ (원본은 raw/, 결과물은 exports/)

3. Basic edits (기본 편집)

Always check the input first: ffprobe -v error -show_entries stream=codec_type,codec_name,width,height,r_frame_rate:format=duration -of default=nw=1 "raw/input.mp4"

Trim (cắt một đoạn) (자르기)

Re-encode so the cut lands exactly on the requested time:

ffmpeg -n -ss 00:00:12 -to 00:01:30 -i "raw/input.mp4" -c:v libx264 -crf 18 -preset medium -pix_fmt yuv420p -c:a aac -b:a 192k "exports/input-cat.mp4"

Times can be mm:ss or hh:mm:ss. Several pieces = several trims, then join.

Join (ghép nhiều clip) (연결)

  1. Check every clip with ffprobe. If all have the same width, height and frame rate, write exports/list.txt:
    file '../raw/clip1.mp4'
    file '../raw/clip2.mp4'
    
    then: ffmpeg -n -f concat -safe 0 -i "exports/list.txt" -c:v libx264 -crf 18 -preset medium -pix_fmt yuv420p -c:a aac -b:a 192k "exports/ghep.mp4"
  2. If they differ, scale and pad each to the same size and frame rate in one step (example for 2 clips to 1920x1080, 30 fps):
    ffmpeg -n -i "raw/a.mp4" -i "raw/b.mp4" -filter_complex "[0:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30[v0];[1:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30[v1];[0:a]aresample=48000[a0];[1:a]aresample=48000[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:v libx264 -crf 18 -preset medium -pix_fmt yuv420p -c:a aac -b:a 192k "exports/ghep.mp4"
    
    If a clip has no audio track, tell the user and add silence for it (anullsrc) instead of failing.

Vertical version for Shorts (khung dọc) (Shorts용 세로 버전)

YouTube counts a video as a Short when it is square or vertical and up to 3 minutes long, uploaded at up to 1080p (YouTube Help 15424877, 10059070). 1080x1920 (9:16) is the usual vertical size; YouTube does not publish an exact pixel size.

  • Crop the centre (중앙 자르기) (good when the person is in the middle): ffmpeg -n -i "raw/input.mp4" -vf "crop=ih*9/16:ih,scale=1080:1920,setsar=1" -c:v libx264 -crf 18 -preset medium -pix_fmt yuv420p -c:a aac -b:a 192k "exports/input-doc.mp4"
  • Keep the whole frame on a blurred background (전체 프레임 유지 + 흐린 배경) (good for screen recordings or wide shots): ffmpeg -n -i "raw/input.mp4" -filter_complex "[0:v]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,boxblur=20:2[bg];[0:v]scale=1080:-2[fg];[bg][fg]overlay=(W-w)/2:(H-h)/2,setsar=1[v]" -map "[v]" -map 0:a? -c:v libx264 -crf 18 -preset medium -pix_fmt yuv420p -c:a aac -b:a 192k "exports/input-doc.mp4" Ask which one the user wants; if the subject is off-centre, offer to move the crop (crop=ih*9/16:ih:X:0, X = left edge in pixels).

Vietnamese subtitles (phụ đề) (베트남어 자막)

Uses Whisper on the user's own computer (free, nothing is uploaded). Needs Python and the package faster-whisper (about a few hundred MB with the model; ask first): python -m pip install faster-whisper Then run the script that comes with this skill (path: the scripts folder next to this SKILL.md): python "<skill folder>/scripts/phu_de.py" "raw/input.mp4" --lang vi --out "exports/input.srt" It writes an .srt file. Tell the user Whisper makes mistakes (names, numbers, accents): they should open the .srt and fix it before using it. The first run downloads the model and is slow. To put the subtitles into the picture (burn in), after the user has fixed the .srt: ffmpeg -n -i "raw/input.mp4" -vf "subtitles=exports/input.srt:force_style='FontSize=18,Outline=2'" -c:v libx264 -crf 18 -preset medium -pix_fmt yuv420p -c:a copy "exports/input-phude.mp4" (On Windows, keep the .srt path relative and with forward slashes; a drive letter like C: must be written C\: inside the filter.) Many creators upload the .srt to YouTube Studio instead of burning it in, so viewers can turn it off.

Even out loudness (chuẩn âm lượng) (음량 평준화)

YouTube does not publish a loudness target; on viewers' side it has a "Stable volume" setting that evens out loud and quiet parts (YouTube Help 14106294). A common choice for online video is about -14 LUFS; say it is a common choice, not a YouTube rule. Use ffmpeg's loudnorm in two passes (ffmpeg docs):

  1. Measure: ffmpeg -hide_banner -i "exports/video.mp4" -af loudnorm=I=-14:TP=-1.5:LRA=11:print_format=json -f null - Read input_i, input_tp, input_lra, input_thresh from the JSON at the end.
  2. Apply with those numbers: ffmpeg -n -i "exports/video.mp4" -af loudnorm=I=-14:TP=-1.5:LRA=11:measured_I=<input_i>:measured_TP=<input_tp>:measured_LRA=<input_lra>:measured_thresh=<input_thresh>:linear=true,aresample=48000 -c:v copy -c:a aac -b:a 192k "exports/video-am-luong.mp4" Do not use a single pass on a finished video: it keeps adjusting the volume during the video.

Export for YouTube (xuất file) (YouTube용 내보내기)

Follows YouTube's recommended upload encoding settings (YouTube Help 1722171): MP4 with fast start, H.264 High profile, progressive, 4:2:0, closed GOP of half the frame rate, 2 B-frames; AAC-LC audio at 48 kHz; BT.709 colour; same frame rate as recorded. Recommended video bitrates for SDR: 1080p 8 Mbps (24-30 fps) or 12 Mbps (48-60 fps); 720p 5 / 7.5 Mbps; 1440p 16 / 24; 4K 35-45 / 53-68. Audio: stereo 384 kbps (mono 128 kbps). Example for a 1080p, 30 fps video (GOP 15):

ffmpeg -n -i "exports/video.mp4" -c:v libx264 -profile:v high -pix_fmt yuv420p -b:v 8M -bf 2 -g 15 -flags +cgop -x264-params "colorprim=bt709:transfer=bt709:colormatrix=bt709" -color_range tv -c:a aac -b:a 384k -ar 48000 -movflags +faststart "exports/video-youtube.mp4"

Adjust -b:v and -g (half the frame rate) to the video; for 60 fps use -b:v 12M -g 30. Keep the frame rate the video was recorded at (do not add -r).

Thumbnail frame (lấy khung hình) (썸네일 프레임 캡처)

ffmpeg -n -ss 00:00:42 -i "raw/input.mp4" -frames:v 1 -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" -q:v 2 "exports/khung-0042.jpg" Offer 3-4 frames at different times so the user can choose. YouTube's thumbnail rules (size, 16:9, JPG/PNG, file size) are in YouTube Help 72431.

If something goes wrong (문제 발생 시)

This skill was written with Claude Code, so it may have bugs, and every computer is different. When a step fails, or the user says the skill did something wrong:

  1. Explain it plainly, in Vietnamese: what failed and why, in one or two sentences. No raw stack traces unless the user asks.
  2. Read this skill and the command that ran. Find the cause (the list below covers the common ones).
  3. Fix it and re-run, writing a new file in exports/. Never touch or overwrite the user's originals, even while fixing.
  4. If the cause was in this skill itself (a wrong command or a missing step), say so, and suggest reporting it so it gets fixed for everyone: https://github.com/thegentleminh/thegentleminh-skills/issues

Common failures (일반적인 오류)

  • 'ffmpeg' is not recognized / command not found: ffmpeg is not installed or the terminal was opened before installing; open a new terminal and check again.
  • No such file or directory: check the path and the quotes; list the folder to find the exact name.
  • already exists. Exiting.: the output name is taken; pick a new name (never overwrite).
  • Unknown encoder 'libx264': the ffmpeg build lacks it; reinstall from the commands above.
  • Out of sync audio after trimming: re-run the trim with re-encoding (the commands above already re-encode).

Individual skills in this repo

This repo contains 3 individual skills — each has its own dedicated page.

anh-thanh-video

Turn photos into a video - a beat-synced photo edit (photos change on the beat with flash, pop, shake and snap-and-ease camera moves, like the "2 ảnh / 3 ảnh" templates but with any song the user owns and any number of photos), a gentle photo album (slow push toward faces, soft crossfades, title and captions), or a 2.5D "3D zoom" where near things move more than far things. Faces stay in frame, Vietnamese text done right, 9:16 / 16:9 / 1:1 / 4:5. Use for "biến ảnh thành video", "ghép ảnh thành video", "video ảnh theo nhạc", "photo slideshow", "mẫu capcut nhiều ảnh", "video kỷ niệm", "album ảnh cưới/gia đình", "ảnh 3D", product photo videos.

tach-nguoi

Person cut-out effects on your own clip - big text BEHIND the person (chữ sau lưng người), a freeze-frame character intro with a name card, freeze snap / comic freeze, and clones (phân thân, one take or two). Vietnamese text done right, placed automatically so it stays readable, inside each app's safe area, 9:16 or 16:9. Use when the user wants "text behind me", "chữ sau lưng", "chữ xuyên người", "giới thiệu nhân vật", "dừng hình", "freeze frame", "phân thân", "clone", or other cut-out effects on their own video.

video-giai-thich

Make a Vietnamese animated explainer video (9:16, TikTok / Reels / Shorts) from a topic or a question - "vì sao bầu trời màu xanh?", "lãi kép là gì?" - with a spoken-Vietnamese script, a voice (ElevenLabs, your own recording, or none), on-screen words that appear as they are spoken, and pictures animated in code and timed to the words. Five looks (riso print, chalkboard, newsprint, blueprint, poster). Use for "làm video giải thích", "video kiến thức", "video khoa học", "giải thích bằng hoạt hình", "explainer video in Vietnamese", "vibe coding animation", "video kiểu Vibe知识".

관련 스킬