From 89d27ffc2297cd6c10488f726a3aeb2321abca42 Mon Sep 17 00:00:00 2001 From: keerah <9025818+keerah@users.noreply.github.com> Date: Thu, 16 Feb 2023 03:51:28 -0500 Subject: [PATCH] Zero frame fix Zero frame of a sequence is now properly detected --- README.md | 18 ++++++++++-------- sendtoffmpeg_encoder01.cmd | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a78375b..c689bc0 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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. \ No newline at end of file diff --git a/sendtoffmpeg_encoder01.cmd b/sendtoffmpeg_encoder01.cmd index 6dddec3..24f05af 100644 --- a/sendtoffmpeg_encoder01.cmd +++ b/sendtoffmpeg_encoder01.cmd @@ -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 [----------------------------------------------------------------------------------------] @@ -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" @@ -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="