Skip to content

Commit

Permalink
Zero frame fix
Browse files Browse the repository at this point in the history
Zero frame of a sequence is now properly detected
  • Loading branch information
keerah committed Feb 16, 2023
1 parent b95aa7d commit 89d27ff
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ This is a set of Windows **batch** scripts for effortless video transcoding usin

![send_to_ffmpeg](https://user-images.githubusercontent.com/9025818/155185990-32fec47d-e557-4a2f-a412-49f2f9a57f3d.jpg "SendTo_FFmpeg presets in the Windows Explorer's Send To menu")

# Installation

First click **Code** -> **Donwload ZIP** on this page or downlad from the [releases page](https://github.com/keerah/SendTo_FFmpeg/releases) to get all the scripts, its free forever. Or get it from the [Releases page](https://github.com/keerah/SendTo_FFmpeg/releases).

Then you will need to [download the FFmpeg executables](https://ffmpeg.org/download.html#build-windows), it's free.
Expand Down Expand Up @@ -32,18 +34,18 @@ That's all. Now you can right click on any file, navigate to **Send To** and sel

Use it in CMD or Powershell as usual.

# More features
# User settings

## Compatibility
SendTo_FFmpeg has its global settings, that you can read more about in the sendtoffmpeg_settings.cmd file. They affect all presets at once. You can change them by simply editing **sendtoffmpeg_settings.cmd** in a text editor.

This works with Windows OS only.
## Global vs Local settings

## Other cool features
You can have very different settings for your current (and any other) folder by making a copy of **sendtoffmpeg_settings.cmd** in that folder. All parameters you change in it will affect only the files that are transcoded here. It can be the framerate setting, or descriptive naming flag or even the path to FFMpeg itself, so you can use different versions for different cases.

SendTo_FFmpeg has its global settings, that you can read more about in the sendtoffmpeg_settings.cmd file. They affect all presets at once. You can change them by simply editing **sendtoffmpeg_settings.cmd** in a text editor.
# Image sequence transcoding

But you can have very different settings for your current (and any other) folder by making a copy of **sendtoffmpeg_settings.cmd** in that folder. All parameters you change in it will affect only the files that are transcoded here. It can be the framerate setting, or descriptive naming flag or even the path to FFMpeg itself, so you can use different versions for different cases.
Available since **Release 3.0**. To transcode an image sequence you need to select the first frame of the sequence. It will be the starting point of the output video. Be cautious when transcoding images that are part of a detectable sequence(s), it may end up with a bunch of similar sequences on your hands :) If required you can supress the sequence detection by changing the **imgset** (Consider image sequences) to 0 in the settings file. Do not forget you can do it for just one particular folder by copying the settings itno it.

## Image sequence transcoding
# Compatibility

Available since Release 3.0. To transcode an image sequence you need to select the first file of the sequence. There's a limitation for now, it cant be frame with number 0 (or 0000). This frame will be the starting point of the output video. Be cautious when transcoding images that are part of a detectable sequence, you may end up with a bunch of sequences on your hands :)
SendTo works with Windows OS only.
14 changes: 12 additions & 2 deletions sendtoffmpeg_encoder01.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ REM This is one of the SenTo FFmpeg modular transcoders, keep it with the rest o
ECHO [----------------------------------------------------------------------------------------]
ECHO [ %argCount% files queued to encode

SET "zer="
FOR /L %%I IN (1,1,%frcounter%) DO SET "zer=!zer!0"

FOR /L %%i IN (1,1,%argCount%) DO (

ECHO [----------------------------------------------------------------------------------------]
Expand All @@ -19,8 +22,14 @@ FOR /L %%i IN (1,1,%argCount%) DO (
REM detecting the counter in the end of the filename
SET "basename=!argFile[%%i].trname:~0,-%frcounter%!"
SET "countername=!argFile[%%i].trname:~-%frcounter%!"
FOR /F "tokens=* delims=0" %%N IN ("!countername!") DO SET /A frnumber=%%N
IF !frnumber! GTR 0 (
SET /A frnumber=-1
IF !countername!==%zer% (
REM Zero frame
SET /A frnumber=0
) ELSE (
FOR /F "tokens=* delims=0" %%N IN ("!countername!") DO SET /A frnumber=%%N
)
IF !frnumber! GTR -1 (
SET "argFile[%%i].name=!argFile[%%i].path!!basename!%%0!frcounter!d!argFile[%%i].ext!"
ECHO [ Image sequence detected ]
ECHO [ Basename: "!basename!" Start frame: !frnumber! Pattern: "!basename!%%0!frcounter!d"
Expand All @@ -35,6 +44,7 @@ FOR /L %%i IN (1,1,%argCount%) DO (
) ELSE (
REM detecting the counter after first found dot
REM No implementation yet
SET "wset.audiocomp="
)
) ELSE (
SET "wset.seqfr="
Expand Down

0 comments on commit 89d27ff

Please sign in to comment.