Add comprehensive existing file handling documentation to Create-Clip.md, Create-PillarBox.md, Create-Turnaround.md and Get-LastFrame.md explaining ffmpeg -y replacement behavior and WhatIf safety recommendations, expand SKILL.md prerequisites section to clarify Windows 11-only platform support with pwsh.exe requirement and reorganize core vs optional tools with task-specific check guidance, update conventions section to add Frames/Frame syntax tables and .skip marker behavior details, replace safety
This commit is contained in:
1 parent
2290672d5b
commit
cf41fb0ce5
5 files changed
+110
-54
No files matched your search
@@ -151,6 +151,13 @@ This applies to every accepted container (`.mp4`, `.webm`, `.mkv`), matching is
|
||||
# Creates: P01-Clip.skip.mp4 scaled to 480p
|
||||
```
|
||||
|
||||
## Existing Files
|
||||
|
||||
An existing derived clip is **replaced** without a prompt. The clip is created by [Clone-Video.ps1](Clone-Video.md), which runs ffmpeg with `-y` and overwrites its target.
|
||||
|
||||
- The `.skip` marker stays last in the name that is replaced. For `P01.skip.mp4` the file replaced is `P01-Clip.skip.mp4`, or `P01-Clip<suffix>.skip.mp4` with `-Suffix`.
|
||||
- Use `-WhatIf` first, or use a different `-Suffix`.
|
||||
|
||||
## Safe Execution
|
||||
|
||||
This script supports `-WhatIf` and `-Confirm` for safe execution (forwarded to `Clone-Video.ps1`):
|
||||
|
||||
@@ -218,6 +218,13 @@ The same logic applies to a transposed 9:16 frame:
|
||||
# CRF 18 instead of default CRF 8 / source bitrate
|
||||
```
|
||||
|
||||
## Existing Files
|
||||
|
||||
An existing `-Target` video is **replaced** without a prompt. ffmpeg runs with `-y`.
|
||||
|
||||
- If ffmpeg fails, the target file is removed and the script stops with an error. This also removes a target that existed before the run, so the old file is lost. A partial file is not left behind.
|
||||
- Use `-WhatIf` first, or write to a new name.
|
||||
|
||||
## Safe Execution
|
||||
|
||||
This script supports `-WhatIf` and `-Confirm` for safe execution:
|
||||
|
||||
@@ -240,6 +240,13 @@ cd C:\renders\CharacterA
|
||||
.\Create-Turnaround.ps1 -Source .\renders -Target turnaround.webp -Quality 1 -Compression 6
|
||||
```
|
||||
|
||||
## Existing Files
|
||||
|
||||
An existing `-Target` image is **replaced** without a prompt. ffmpeg runs with `-y`.
|
||||
|
||||
- The folder that contains `-Target` must already exist. The script stops with an error instead of creating it.
|
||||
- Use `-WhatIf` first, or write to a new name.
|
||||
|
||||
## Safe Execution
|
||||
|
||||
This script supports `-WhatIf` and `-Confirm` for safe execution:
|
||||
|
||||
@@ -104,6 +104,14 @@ Frame saved to: frame_0099.png
|
||||
# Creates: f_7.png
|
||||
```
|
||||
|
||||
## Existing Files
|
||||
|
||||
An existing output PNG is **replaced** without a prompt. ffmpeg runs with `-y`.
|
||||
|
||||
- When `-Image` contains a numbering token such as `%04d`, the file replaced is the **resolved** name, not the pattern. For example, `-Image f_%04d.png -Frame 3` writes and replaces `f_0003.png`.
|
||||
- If the output folder does not exist, it is created. With `-WhatIf` it is only reported.
|
||||
- Use `-WhatIf` first, or write to a new name.
|
||||
|
||||
## Safe Execution
|
||||
|
||||
This script supports `-WhatIf` and `-Confirm` for safe execution:
|
||||
|
||||
+81
-54
@@ -5,15 +5,18 @@ description: Operates a collection of PowerShell 7 scripts that process video an
|
||||
|
||||
# Video Processing PowerShell Scripts
|
||||
|
||||
A collection of PowerShell 7 scripts that wrap ffmpeg and ffprobe for video and image processing. Some scripts also call rife-ncnn-vulkan (frame interpolation) and upscayl-bin (AI upscaling). Each script has its own page in this documentation, linked from the catalog below.
|
||||
A collection of PowerShell 7 scripts that wrap ffmpeg and ffprobe for video and image processing. Some scripts also call rife-ncnn-vulkan (frame interpolation) and upscayl-bin (AI upscaling).
|
||||
|
||||
The per-script pages sit in the same folder as this file. Load a page only when you need its details, using the links in the catalog below.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- **Platform**: Windows 11 only. The scripts are tested on Windows 11 and nowhere else. Do not run them on Linux or WSL, because those platforms are not supported.
|
||||
- **Platform**: Windows 11 only. The scripts are tested on Windows 11 and nowhere else. Linux and WSL are not supported. Run them with Windows PowerShell 7 (`pwsh.exe`).
|
||||
- **PowerShell 7+** (`pwsh`). Required by every script.
|
||||
- **ffmpeg** and **ffprobe** on `PATH`. Most scripts need both. [Stitch-InBetween.ps1](Stitch-InBetween.md) needs only ffmpeg. [Get-FramesCount.ps1](Get-FramesCount.md), [Get-VideoInfo.ps1](Get-VideoInfo.md) and [Create-FullSubtitle.ps1](Create-FullSubtitle.md) need only ffprobe.
|
||||
- **rife-ncnn-vulkan** on `PATH`, with `RIFE_HOME` set. Required by [Stitch-InBetween.ps1](Stitch-InBetween.md). See [RIFE installation guide](RIFE.md).
|
||||
- **upscayl-bin** on `PATH`, with `UPSCAYL_HOME` set. Required by [Clone-Image.ps1](Clone-Image.md) when `-Upscale` is used. See [Upscalers installation guide](Upscalers.md).
|
||||
- **Core tools**: **ffmpeg** and **ffprobe** on `PATH`. Most scripts need both. [Stitch-InBetween.ps1](Stitch-InBetween.md) needs only ffmpeg. [Get-FramesCount.ps1](Get-FramesCount.md), [Get-VideoInfo.ps1](Get-VideoInfo.md) and [Create-FullSubtitle.ps1](Create-FullSubtitle.md) need only ffprobe.
|
||||
- **Optional tools**, needed only by specific scripts:
|
||||
- **rife-ncnn-vulkan** on `PATH`, with `RIFE_HOME` set. Required by [Stitch-InBetween.ps1](Stitch-InBetween.md). See the [RIFE installation guide](RIFE.md).
|
||||
- **upscayl-bin** on `PATH`, with `UPSCAYL_HOME` set. Required by [Clone-Image.ps1](Clone-Image.md) when `-Upscale` is used. See the [Upscalers installation guide](Upscalers.md).
|
||||
|
||||
## Environment Variables
|
||||
|
||||
@@ -27,20 +30,20 @@ These must be persistent user or system variables. An agent shell may not inheri
|
||||
|
||||
## Check the Environment
|
||||
|
||||
Run these once before the first use in a session:
|
||||
Run the core checks once before the first use in a session:
|
||||
|
||||
```powershell
|
||||
pwsh --version
|
||||
ffmpeg -version
|
||||
ffprobe -version
|
||||
Get-Command rife-ncnn-vulkan
|
||||
Get-Command upscayl-bin
|
||||
"RIFE_HOME=$env:RIFE_HOME"
|
||||
"UPSCAYL_HOME=$env:UPSCAYL_HOME"
|
||||
"NCNN_GPU_ID=$env:NCNN_GPU_ID"
|
||||
```
|
||||
|
||||
If anything is missing or empty, **stop**. Tell the user exactly what is missing and point to [index.md](index.md) (prerequisites), [RIFE.md](RIFE.md) or [Upscalers.md](Upscalers.md). Do not install software or change environment variables without the user's approval.
|
||||
Run the task-specific checks only when the task uses the script that needs them:
|
||||
|
||||
- Stitch-InBetween.ps1: `Get-Command rife-ncnn-vulkan`, `$env:RIFE_HOME` and `$env:NCNN_GPU_ID`.
|
||||
- Clone-Image.ps1 with `-Upscale`: `Get-Command upscayl-bin`, `$env:UPSCAYL_HOME` and `$env:NCNN_GPU_ID`.
|
||||
|
||||
If a core check fails, or a check needed by the current task fails, **stop**. Tell the user exactly what is missing and point to [index.md](index.md) (prerequisites), [RIFE.md](RIFE.md) or [Upscalers.md](Upscalers.md). Do not install software or change environment variables without the user's approval. A missing optional tool must not block unrelated tasks such as clipping.
|
||||
|
||||
## Installation and Location
|
||||
|
||||
@@ -51,7 +54,8 @@ If anything is missing or empty, **stop**. Tell the user exactly what is missing
|
||||
|
||||
## How to Run the Scripts
|
||||
|
||||
- Always call a script as `pwsh -NoProfile -File <script>.ps1 <parameters>`.
|
||||
- Always call a script as `pwsh -NoProfile -File <full path to script>.ps1 <parameters>`. `pwsh -File` does not search `PATH`, so a bare name fails from any other folder. Find the script folder once with `Split-Path (Get-Command Create-Clip.ps1).Source`.
|
||||
- In the examples below, `.\` means the script folder. From any other folder, replace `.\` with the full script path.
|
||||
- The `.cmd` wrappers are Windows-only convenience files. Do not use them in agent commands.
|
||||
- Quote every path that contains spaces.
|
||||
- Paths can be absolute or relative to the current directory.
|
||||
@@ -63,58 +67,81 @@ pwsh -NoProfile -File .\Create-Clip.ps1 -Video "My Video.mp4" -Frames "100-200"
|
||||
## Conventions
|
||||
|
||||
- Frame indices are **0-based**: the first frame is `0`.
|
||||
- If the extension is omitted, `.mp4`, `.webm` and `.mkv` are tried in that order (for example [Create-Clip.ps1](Create-Clip.md), [Create-Scenes.ps1](Create-Scenes.md)).
|
||||
- Files ending in `.skip.mp4` (for example `P01.skip.mp4`) are excluded from batch processing. Batch scripts also skip `.bak.mp4` backups.
|
||||
- A `.skip` marker stays last in derived output names: `P01.skip.mp4` gives `P01-Clip.skip.mp4` ([Create-Clip.ps1](Create-Clip.md)) and `P01-Scene-01.skip.mp4` ([Create-Scenes.ps1](Create-Scenes.md)).
|
||||
- **`-Frames` syntax** for [Clone-Video.ps1](Clone-Video.md), [Create-Clip.ps1](Create-Clip.md) and [Get-FramesRange.ps1](Get-FramesRange.md):
|
||||
|
||||
| Form | Meaning |
|
||||
| --- | --- |
|
||||
| `start-end` | Frames from `start` to `end`, e.g. `100-200` |
|
||||
| `N` | Frames 0 to `N`, not only frame `N` |
|
||||
| `-N` | The last `N` frames |
|
||||
| `%` | The last frame index, alone or in a range, e.g. `10-%` |
|
||||
| `all` | All frames, same as `0-%` |
|
||||
|
||||
- **`-Frame` syntax** for [Get-Frame.ps1](Get-Frame.md) and [Get-LastFrame.ps1](Get-LastFrame.md): a single frame index. Negative values count from the end (`-1` is the last frame). Out-of-range values are clamped.
|
||||
- If the extension is omitted, `.mp4`, `.webm` and `.mkv` are tried in that order by [Clone-Video.ps1](Clone-Video.md), [Create-Clip.ps1](Create-Clip.md) and [Create-Scenes.ps1](Create-Scenes.md).
|
||||
- **`.skip` marker**: a file named `<name>.skip.<ext>` is excluded from batch processing, and the marker stays last in derived names.
|
||||
- [Create-Clip.ps1](Create-Clip.md) accepts `.mp4`, `.webm` and `.mkv`, case-insensitive. `P01.skip.mp4` gives `P01-Clip.skip.mp4`.
|
||||
- [Crop-Clips.ps1](Crop-Clips.md) processes only `.mp4` files and skips `*.skip.mp4` and `*.bak.mp4`.
|
||||
- [Create-Scenes.ps1](Create-Scenes.md) gives `P01-Scene-01.skip.mp4` for `P01.skip.mp4`.
|
||||
- Batch operations skip `.bak.mp4` backup files.
|
||||
- Scripts exit with `0` on success and `1` on failure. Check `$LASTEXITCODE` after each call.
|
||||
- **Forwarded parameters**: [Create-Clip.ps1](Create-Clip.md) and [Create-Scenes.ps1](Create-Scenes.md) accept the extra parameters of [Clone-Video.ps1](Clone-Video.md) and forward them, for example `-Size`, `-FPS`, `-NoAudio`, `-Audio`, `-CRF`, `-Metadata`, `-Reverse` and `-LTX`. Each reserves `-Video`, `-Frames`, `-Suffix` and `-Target` for itself, so do not repeat them in the extra parameters.
|
||||
|
||||
## Safety Rules
|
||||
|
||||
- **Never pass `-Confirm`.** Scripts run without interaction. Only `-Confirm` makes them prompt. No script sets a `ConfirmImpact` of `High`, so none prompts by default. `Create-Scenes.ps1` sets `Medium`.
|
||||
- **Never pass `-Confirm`.** Scripts run without interaction. Only `-Confirm` makes them prompt. No script sets a `ConfirmImpact` of `High`, so none prompts by default. [Create-Scenes.ps1](Create-Scenes.md) sets `Medium`.
|
||||
- Before any script that creates, overwrites or deletes files, run it with **`-WhatIf`**. Show the user the result, then run it for real only if the user agrees.
|
||||
- Never run a script on files the user has not designated. Never delete source videos.
|
||||
- Overwrite and delete behavior of every script, as stated on its page:
|
||||
|
||||
Scripts that replace or delete existing files:
|
||||
|
||||
| Script | Behavior |
|
||||
| Script | Behavior, as documented |
|
||||
| --- | --- |
|
||||
| [Clone-Video.ps1](Clone-Video.md) | Overwrites the `-Target` file (ffmpeg `-y`). |
|
||||
| [Create-Clip.ps1](Create-Clip.md) | Overwrites the derived clip, through Clone-Video. |
|
||||
| [Create-Scenes.ps1](Create-Scenes.md) | Deletes earlier clips of the same source in the source folder, then overwrites them. |
|
||||
| [Clone-Image.ps1](Clone-Image.md) | Overwrites the `-Target` image (ffmpeg `-y`). |
|
||||
| [Compare-Videos.ps1](Compare-Videos.md) | Overwrites the `-Output` file (ffmpeg `-y`). |
|
||||
| [Create-PillarBox.ps1](Create-PillarBox.md) | Removes an existing target before writing it. |
|
||||
| [Create-Turnaround.ps1](Create-Turnaround.md) | Overwrites the `-Target` image. |
|
||||
| [Crop-Clips.ps1](Crop-Clips.md) | In-place when source and target are the same folder, which is the default when both are omitted: writes a `.bak.mp4` backup, then removes the original after a successful crop. A separate target folder replaces same-named files. |
|
||||
| [Create-FullSubtitle.ps1](Create-FullSubtitle.md) | Overwrites the `-Output` subtitle file without a prompt. |
|
||||
| [Clone-Image.ps1](Clone-Image.md) | An existing `-Target` or `-Keep` file is replaced. Both folders must exist. |
|
||||
| [Clone-Video.ps1](Clone-Video.md) | An existing `-Target` is replaced without a prompt. The folder of `-Target` must exist. |
|
||||
| [Compare-Videos.ps1](Compare-Videos.md) | An existing `-Output` is replaced. Its folder must exist. |
|
||||
| [Create-Clip.ps1](Create-Clip.md) | An existing derived clip is replaced without a prompt. The clip is written by Clone-Video.ps1, with the `.skip` marker kept last in the name. |
|
||||
| [Create-FullSubtitle.ps1](Create-FullSubtitle.md) | Overwrites `-Output` without a prompt. |
|
||||
| [Create-PillarBox.ps1](Create-PillarBox.md) | An existing `-Target` video is replaced without a prompt. If ffmpeg fails, the target is removed, including a file that existed before the run. |
|
||||
| [Create-Scenes.ps1](Create-Scenes.md) | Only when `-List` is not given. Deletes earlier clips of the same source in the source folder, then creates the new ones, which replace the old ones. |
|
||||
| [Create-ShortClip.ps1](Create-ShortClip.md) | Overwrites the output video. With the default `-Images` and without `-Render`, clears the `Frames` folder. With explicit `-Images`, deletes only matching frames. Removes its temporary folders, and the `Frames` folder unless `-Keep` is given. |
|
||||
| [Get-FramesRange.ps1](Get-FramesRange.md) | Overwrites existing PNG frames with the same name (ffmpeg `-y`). |
|
||||
| [Get-LastFrame.ps1](Get-LastFrame.md) | Overwrites the output PNG (ffmpeg `-y`). [Get-Frame.ps1](Get-Frame.md) uses it. |
|
||||
| [Get-VideoAudio.ps1](Get-VideoAudio.md) | Overwrites the output audio file. |
|
||||
| [Stitch-InBetween.ps1](Stitch-InBetween.md) | Deletes an existing `-Video` output before generating. Deletes everything inside an existing `-TempDir`. Deletes intermediate PNG frames. |
|
||||
| [Create-Turnaround.ps1](Create-Turnaround.md) | An existing `-Target` image is replaced without a prompt. The folder of `-Target` must exist. |
|
||||
| [Crop-Clips.ps1](Crop-Clips.md) | Works in place when `-Source` and `-Target` are omitted or equal. See the in-place rule below. |
|
||||
| [Get-Frame.ps1](Get-Frame.md) | An existing PNG with the same name is replaced. |
|
||||
| [Get-FramesCount.ps1](Get-FramesCount.md) | Reads only. Creates and deletes nothing. |
|
||||
| [Get-FramesRange.ps1](Get-FramesRange.md) | An existing PNG frame with the same name is replaced. |
|
||||
| [Get-LastFrame.ps1](Get-LastFrame.md) | An existing output PNG is replaced without a prompt. With a numbering token in `-Image`, the resolved name is replaced, not the pattern. |
|
||||
| [Get-VideoAudio.ps1](Get-VideoAudio.md) | The output file, default or from `-Output`, is replaced. |
|
||||
| [Get-VideoInfo.ps1](Get-VideoInfo.md) | Reads only. Creates and deletes nothing. |
|
||||
| [Stitch-InBetween.ps1](Stitch-InBetween.md) | Deletes an existing `-Video` before generating. Deletes everything inside an existing `-TempDir`. |
|
||||
|
||||
Run `-WhatIf` first on every script in this table, and check the output paths before running it for real.
|
||||
- **Crop-Clips in-place rule.** Crop-Clips works on the current folder when `-Source` and `-Target` are omitted, and it backs up each file it crops to `<name>.bak.mp4`, replacing any existing backup without a prompt. Skipped files are not backed up and keep their backup. A re-run with a different `-Size` crops the already cropped files again, so the backup then holds the previous cropped output and the true original is lost. So:
|
||||
- Always pass explicit `-Source` and `-Target`, and prefer a separate `-Target` folder.
|
||||
- Use in-place mode only when the user asks for it.
|
||||
- Warn the user before re-running in place with a different `-Size` on files that already have a `.bak.mp4`.
|
||||
- Never delete `.bak.mp4` files yourself unless the user asks.
|
||||
- **Stitch-InBetween `-TempDir` rule.** The script deletes everything inside an existing `-TempDir`. Never pass an existing folder. Omit `-TempDir` unless the user designates a dedicated empty folder.
|
||||
|
||||
## Script Catalog
|
||||
|
||||
| Script | Purpose | Typical use |
|
||||
| --- | --- | --- |
|
||||
| [Clone-Image.ps1](Clone-Image.md) | Resize, convert and optionally AI-upscale images | `-Source small.jpg -Target big_4k.png -Upscale 4 -Size 4K` |
|
||||
| [Clone-Video.ps1](Clone-Video.md) | Re-encode a video with frame range, size, FPS, audio and CRF options | `-Source in.mp4 -Target out.mp4 -Frames "0-100"` |
|
||||
| [Compare-Videos.ps1](Compare-Videos.md) | Side-by-side or grid comparison of 2 to 4 videos at 1080p or 4K | `-S1 a.mp4 -S2 b.mp4 -Output cmp.mp4` |
|
||||
| [Create-Clip.ps1](Create-Clip.md) | Clip a frame range; output name is the source name plus `-Suffix` (default `-Clip`) | `-Video P01.mp4 -Frames "100-200"` |
|
||||
| [Create-FullSubtitle.ps1](Create-FullSubtitle.md) | Merge two SRT files into one with adjusted timing | `-Video v.mp4 -Subtitle1 a.srt -Subtitle2 b.srt -Output out.srt` |
|
||||
| [Create-PillarBox.ps1](Create-PillarBox.md) | Wrap a video in a 16:9 frame with side-bar effects | `-Video v.mp4 -Effect black` |
|
||||
| [Create-Scenes.ps1](Create-Scenes.md) | Detect scene changes and create one clip per scene | `-Video P01.mp4 -Scene 0.3 -List` |
|
||||
| [Create-ShortClip.ps1](Create-ShortClip.md) | Build a vertical short clip from an INI plan | `-Video v.mp4 -Plan plan.ini` |
|
||||
| [Create-Turnaround.ps1](Create-Turnaround.md) | Arrange same-named images into a turnaround sheet | `-Source "C:\renders\CharacterA" -Target sheet.png` |
|
||||
| [Crop-Clips.ps1](Crop-Clips.md) | Batch crop LTX-2, Kling and Wan videos to standard sizes | `-Source in_dir -Target out_dir` |
|
||||
| [Get-Frame.ps1](Get-Frame.md) | Extract one frame to PNG with an automatic name | `-Video P01.mp4 -Frame 10` |
|
||||
| [Clone-Image.ps1](Clone-Image.md) | Resize (cover-scale then crop), convert formats, set quality and compression, copy metadata, AI-upscale with `-Upscale` and optionally keep the upscaled image with `-Keep`, use LTX-2 sizes with `-LTX` | `-Source small.jpg -Target big_4k.png -Upscale 4 -Size 4K` |
|
||||
| [Clone-Video.ps1](Clone-Video.md) | Re-encode or convert video (`.mp4`, `.webm`, `.mkv`) with frame range, size, FPS, audio, CRF, `-Crop`, `-Reverse`, `-LTX` and metadata options. Also builds a video from one image plus `-Audio`, builds a video from a folder of PNG files, and extracts one frame to PNG with `-Sequence` | `-Source in.mp4 -Target out.mp4 -Frames "0-100"` |
|
||||
| [Compare-Videos.ps1](Compare-Videos.md) | Side-by-side or grid comparison of 2 to 4 videos at 1080p or 4K, with `-Clip`, `-Sideways` and `-NoAudio` | `-S1 a.mp4 -S2 b.mp4 -Output cmp.mp4` |
|
||||
| [Create-Clip.ps1](Create-Clip.md) | Clip a frame range. The output name is the source name plus `-Suffix` (default `-Clip`). Forwards extra parameters to Clone-Video.ps1 | `-Video P01.mp4 -Frames "100-200"` |
|
||||
| [Create-FullSubtitle.ps1](Create-FullSubtitle.md) | Merge two SRT files into one, with timing taken from the video duration | `-Video v.mp4 -Subtitle1 a.srt -Subtitle2 b.srt -Output out.srt` |
|
||||
| [Create-PillarBox.ps1](Create-PillarBox.md) | Wrap a video in a 16:9 frame with side-bar effects (solid colours, or blurred backgrounds from the video). `-Vertical` gives a 9:16 frame for square sources | `-Video v.mp4 -Effect black` |
|
||||
| [Create-Scenes.ps1](Create-Scenes.md) | Detect scene changes and create one clip per scene. `-List` only shows the scenes. Forwards extra parameters to Create-Clip.ps1 and Clone-Video.ps1 | `-Video P01.mp4 -Scene 0.3 -List` |
|
||||
| [Create-ShortClip.ps1](Create-ShortClip.md) | Build a vertical short clip from an INI plan, with optional overlay, colour, smoothing and speed. `-Render` builds the video from existing frames | `-Video v.mp4 -Plan plan.ini` |
|
||||
| [Create-Turnaround.ps1](Create-Turnaround.md) | Arrange same-sized images into a row or grid turnaround sheet, with padding colour, quality and compression options | `-Source "C:\renders\CharacterA" -Target sheet.png` |
|
||||
| [Crop-Clips.ps1](Crop-Clips.md) | Batch crop LTX-2, Kling and Wan videos to standard sizes. `-Size` fits every video to a chosen size. Square videos become 1080x1080 | `-Source in_dir -Target out_dir` |
|
||||
| [Get-Frame.ps1](Get-Frame.md) | Extract one frame to PNG with an automatic name (`<video>-<frame>.png`). Negative indices count from the end | `-Video P01.mp4 -Frame 10` |
|
||||
| [Get-FramesCount.ps1](Get-FramesCount.md) | Print the total frame count of a video | `-Video P01.mp4` |
|
||||
| [Get-FramesRange.ps1](Get-FramesRange.md) | Extract a range of frames to PNG files | `-Video P01.mp4 -Frames "0-50"` |
|
||||
| [Get-LastFrame.ps1](Get-LastFrame.md) | Extract one frame (default: the last) to a chosen PNG name | `-Video P01.mp4 -Image last.png` |
|
||||
| [Get-VideoAudio.ps1](Get-VideoAudio.md) | Extract audio as WAV (default) or MP3 | `-Video P01.mp4 -MP3` |
|
||||
| [Get-VideoInfo.ps1](Get-VideoInfo.md) | Show metadata stored in video comment tags | `-Video *.mp4` |
|
||||
| [Stitch-InBetween.ps1](Stitch-InBetween.md) | Generate in-between frames with RIFE and encode them to video | `-First a.png -Last b.png -Frames 30 -Video out.mp4` |
|
||||
| [Get-FramesRange.ps1](Get-FramesRange.md) | Extract a frame range to PNG files, with a custom name pattern through `-Images` | `-Video P01.mp4 -Frames "0-50"` |
|
||||
| [Get-LastFrame.ps1](Get-LastFrame.md) | Extract one frame (default: the last) to a chosen PNG name. `-Image` can include a numbering token | `-Video P01.mp4 -Image last.png` |
|
||||
| [Get-VideoAudio.ps1](Get-VideoAudio.md) | Extract audio as WAV (default) or MP3 (`-MP3`) | `-Video P01.mp4 -MP3` |
|
||||
| [Get-VideoInfo.ps1](Get-VideoInfo.md) | Show metadata stored in video comment tags. Accepts wildcards. `-Full` adds JSON output | `-Video *.mp4` |
|
||||
| [Stitch-InBetween.ps1](Stitch-InBetween.md) | Generate in-between frames between two images with RIFE, then encode them to video | `-First a.png -Last b.png -Frames 30 -Video out.mp4` |
|
||||
|
||||
## Common Workflows
|
||||
|
||||
@@ -126,12 +153,12 @@ pwsh -NoProfile -File .\Create-Clip.ps1 -Video P01.mp4 -Frames "100-200" -WhatIf
|
||||
pwsh -NoProfile -File .\Create-Clip.ps1 -Video P01.mp4 -Frames "100-200"
|
||||
```
|
||||
|
||||
**Split a video into scenes** (list first, then create clips):
|
||||
**Split a video into scenes, with forwarded parameters** (list first, then create clips scaled to 720p without audio):
|
||||
|
||||
```powershell
|
||||
pwsh -NoProfile -File .\Create-Scenes.ps1 -Video P01.mp4 -Scene 0.3 -List
|
||||
pwsh -NoProfile -File .\Create-Scenes.ps1 -Video P01.mp4 -Scene 0.3 -WhatIf
|
||||
pwsh -NoProfile -File .\Create-Scenes.ps1 -Video P01.mp4 -Scene 0.3
|
||||
pwsh -NoProfile -File .\Create-Scenes.ps1 -Video P01.mp4 -Scene 0.3 -Size 720p -NoAudio -WhatIf
|
||||
pwsh -NoProfile -File .\Create-Scenes.ps1 -Video P01.mp4 -Scene 0.3 -Size 720p -NoAudio
|
||||
```
|
||||
|
||||
**Extract the last frame to a named PNG:**
|
||||
@@ -146,7 +173,7 @@ pwsh -NoProfile -File .\Get-LastFrame.ps1 -Video P01.mp4 -Image last.png
|
||||
pwsh -NoProfile -File .\Clone-Image.ps1 -Source small.jpg -Target big_4k.png -Upscale 4 -Size 4K
|
||||
```
|
||||
|
||||
**Interpolate between two images with RIFE:**
|
||||
**Interpolate between two images with RIFE** (needs `RIFE_HOME` and `NCNN_GPU_ID`):
|
||||
|
||||
```powershell
|
||||
pwsh -NoProfile -File .\Stitch-InBetween.ps1 -First frame1.png -Last frame2.png -Frames 30 -Video output.mp4 -FPS 24 -WhatIf
|
||||
|
||||
Reference in new issue
Block a user