79 lines
3.1 KiB
Markdown
79 lines
3.1 KiB
Markdown
# Video Processing PowerShell Scripts
|
|
|
|
A collection of PowerShell scripts for video processing tasks using ffmpeg and ffprobe.
|
|
|
|
## Prerequisites
|
|
|
|
- **PowerShell 7+** (pwsh.exe)
|
|
- **ffmpeg** - Must be in system PATH
|
|
- **ffprobe** - Must be in system PATH
|
|
- **rife-ncnn-vulkan** - Must be in system PATH
|
|
|
|
## ffmpeg
|
|
|
|
To install ffmpeg on Windows, download it from [ffmpeg.org](https://ffmpeg.org/download.html) and add it to your system PATH.
|
|
|
|
## rife-ncnn-vulkan
|
|
|
|
To install rife-ncnn-vulkan on Windows, download it from [rife-ncnn-vulkan](https://github.com/nihui/rife-ncnn-vulkan) and add it to your system PATH.
|
|
|
|
---
|
|
|
|
## Scripts Overview
|
|
|
|
| Script | Purpose |
|
|
| :--- | :--- |
|
|
| Clone-Video.ps1 | Clone/copy video files with optional frame range and sequence extraction |
|
|
| Compare-Videos.ps1 | Combine 2 to 4 video files into a single 1920x1080 side-by-side or grid comparison video |
|
|
| Create-FullSubtitle.ps1 | Creates a full subtitle file from a video file and two SRT subtitle files by combining them with adjusted timing and sequential numbering |
|
|
| Create-ShortClip.ps1 | Create short clips from videos with cropping and overlay options |
|
|
| Crop-Clips.ps1 | Batch crop videos generated by LTX-2 from 1920x1088 or 1280x704 resolution |
|
|
| Crop-ClipsKling.ps1 | Batch crop videos generated by Kling from 1920x1072 or 1928x1072 resolution |
|
|
| Crop-ClipsWan.ps1 | Batch crop videos generated by Wan from 1928x1076 resolution |
|
|
| Get-Frames.ps1 | Extract a range of frames to PNG images |
|
|
| Get-FramesCount.ps1 | Get total frame count of a video |
|
|
| Get-LastFrame.ps1 | Extract a specific frame or last frame to PNG |
|
|
| Get-VideoAudio.ps1 | Extracts audio in either WAV or MP3 format from a video file |
|
|
| Get-VideoInfo.ps1 | Extract and display video metadata from comment tags |
|
|
| Stich-InBetween.ps1 | Generate interpolated in-between frames between two images using RIFE and encode to video |
|
|
|
|
**Important**:
|
|
|
|
- All scripts require PowerShell 7+ (use `pwsh.exe`)
|
|
- Each script has its own Windows command file (`.cmd`) that calls the PowerShell script
|
|
|
|
## Scripts Installation
|
|
|
|
The scripts are available from **git.gurusushi.dyndns.org**, repository: **guru/Video-Processing-Scripts**.
|
|
|
|
Add the project folder to your PATH environment variable to access the scripts from any location.
|
|
|
|
---
|
|
|
|
## Notes
|
|
|
|
- All scripts require PowerShell 7+ (use `pwsh.exe`)
|
|
- File extensions (`.mp4`, `.png`) are automatically added if not provided
|
|
- Paths can be absolute or relative to current directory
|
|
- Use `.skip.mp4` extension to exclude files from batch processing
|
|
- Backup files (`.bak.mp4`) are automatically skipped in batch operations
|
|
|
|
## Troubleshooting
|
|
|
|
### Error: "Video file not found"
|
|
|
|
- Check that the file path is correct
|
|
- Ensure file exists at specified location
|
|
- Use absolute paths if relative paths aren't working
|
|
|
|
### Error: "ffmpeg failed" or "ffprobe failed"
|
|
|
|
- Verify ffmpeg and ffprobe are installed and in PATH
|
|
- Check that the video file is not corrupted
|
|
- Ensure sufficient disk space for output
|
|
|
|
### Error: "Frame index out of range"
|
|
|
|
- Use `Get-FramesCount.ps1` to check valid frame range
|
|
- Frame indices are 0-based (first frame is 0)
|