Jul 28, 2018

SendTo FFmpeg batches updated with Cuda presets

Transcode now even faster.
I've just added 2 new presets to encode into h264 using Cuda, for me on GTX1080 it's up to 10 times faster than on CPU. I've also added a small text description file to the archive so it'd be easier for you to use them. You need an Nvidia card for this to work of course, and it must be Pascal or newer. There's also some restrictions on input video parameters which won't let you use Cuda encoding (over 4K resolutions and some kinky pixel formats for instance).

The example batch for Cuda enabled encoding looks like this
@ECHO OFF
ECHO [----------------------------------------------------------------]
ECHO [---  SendTo FFmpeg encoder v1.01 by Keerah.com               ---]
ECHO [---  MP4 h264 module has been invoked                        ---]
ECHO [---  Preset: CUDA 444, Slow, bitrate 20Mbit, Audio Copy      ---]
IF %1.==. (
ECHO [----------------------------------------------------------------]
ECHO [     NO FILE SPECIFIED                                          ]
) ELSE (
ECHO [----------------------------------------------------------------]
ECHO [     Transcoding...                                             ]
"c:\Program Files\ffmpeg\bin\ffmpeg.exe" -vsync 0 -hwaccel cuvid -i %1 -c:v h264_nvenc -preset slow -b:v 20M -pix_fmt yuv444p -c:a copy -y %1_422_20Mbit_slow_cuda.mp4
)
ECHO [----------------------------------------------------------------]
ECHO [     SERVED                                                     ]
ECHO [----------------------------------------------------------------]
PAUSE
As you can see it uses a separate Nvidia codec h264_nvenc. For more information on the codec and its parameters refer to Nvidia's application note. Just one hint from me on -b:v 20M argument, which defines the bitrate for the output.

Jul 10, 2018

How to add comment field to any windows Folder

I think it can be really useful in your workflow to have a comment field for your folders.
So I searched for simple way of adding a comment without using any additional software.


1. Right-click the folder and select Properties.

2. From the Properties dialog box, select the Customise tab, and then click the Change Icon button.

3. In the Change Icon dialog box, select an icon from the selections and click OK. Click OK to close the Properties dialog box. If you'd like to keep the normal folder icon, you can simply choose it from the selection when changing the icon, it is the exact same.

4. Open the folder, locate the Desktop.ini file, and double-click it (its a hidden file, you need to enable its visibility in explorer or enter its name directly). Add new line InfoTip= under the [.ShellClassInfo] section and type your detailed description immediately after the = sign. Go to File -> Save and close Notepad.

You'll see your detailed pop-up description the next time you hover the mouse over that specific folder or when you enable Comment field displayed in your explorer windows.

Updated version of GIF batch with multiple file support

Last time I've posted a batch for encoding your files into high quality GIFs, fast and free using FFmpeg. Although you can send multiple files one by one to parallel batch processes, some peeps don't want those clicks and asked me to make a version with multiple file support. Here it is. You can submit a ton of files with 1 click and go eat your pizza while it's being encoded.
@ECHO OFF
setlocal enabledelayedexpansion
set argCount=0
for %%x in (%*) do (
   set /A argCount+=1
   set "argVec[!argCount!]=%%~x"
)
ECHO [----------------------------------------------------------------]
ECHO [---  SendTo FFmpeg encoder v1.1 by Keerah.com                ---]
ECHO [---  Multi GIF module has been invoked                       ---]
IF %argCount% == 0 (
ECHO [----------------------------------------------------------------]
ECHO [     NO FILE SPECIFIED                                          ]
GOTO End
)
IF %argCount% GTR 1 (
ECHO [----------------------------------------------------------------]
ECHO [     %argCount% files queued to encode
)
FOR /L %%i IN (1,1,%argCount%) DO (
ECHO [----------------------------------------------------------------]
ECHO [     Encoding file %%i of %argCount%
ECHO [     STAGE 1: Generating a palette                              ]
"c:\Program Files\ffmpeg\bin\ffmpeg.exe" -v warning -i !argVec[%%i]! -vf fps=15,scale=320:-1:flags=lanczos,palettegen -y !argVec[%%i]!_palette.png
ECHO [----------------------------------------------------------------]
ECHO [     Encoding file %%i of %argCount%
ECHO [     STAGE 2: Encoding to Gif using the generatied palette      ]
"c:\Program Files\ffmpeg\bin\ffmpeg.exe" -v warning -i !argVec[%%i]! -i !argVec[%%i]!_palette.png -filter_complex "fps=15,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" -y !argVec[%%i]!_hqgif.gif
IF EXIST !argVec[%%i]!_palette.png DEL /s !argVec[%%i]!_palette.png > nul
)
:End
ECHO [----------------------------------------------------------------]
ECHO [     SERVED                                                     ]
ECHO [----------------------------------------------------------------]
PAUSE

To make your work even more easier I share my own presets.
The archive contains a few presets and .lnk files (which you need to modify in case you use them). I will be continuously updating them. For now just this version supports multiple files encoding, I'll fix it soon for other batches.

And by the way, you don't really have to use it with SendTo menu as I described before, you can just drag and drop your video files over the .bat file icon. Any way convenient to you.

Cheers

Jul 8, 2018

Free 1-click conversion to HQ GIFs using FFmpeg

This batch has an update supporting multiple file encoding

Okay, if you remember my huge FFmpeg automation for windows post. I have a new very useful ready-to-roll addition to it.

To achieve the best possible Gif quality this script works in 2 stages (2 pass encoding). First one scans the source and creates a colour palette of it to minimise your Gif size. And the second pass creates the Gif itself. The output file will be saved to the same folder your source comes from.

Save it as Bat file and place into C:\Users\*USERNAME*\AppData\Roaming\Microsoft\Windows\SendTo folder. Or use an .lnk file instead if you want to customise the icon and name of the new Send To menu item.
@ECHO OFF
IF %1.==. (
   ECHO [-------------- SendTo FFmpeg converter ---------------]
   ECHO [ NO FILE SPECIFIED ]
   ECHO [------------------------------------------------------]
) ELSE (
   ECHO [-------------- SendTo FFmpeg converter ---------------]
   ECHO [ STAGE 1 ]
   ECHO [ Generating a palette ]
   ECHO [------------------------------------------------------]
   "c:\Program Files\ffmpeg\bin\ffmpeg.exe" -v warning -i %1 -vf fps=15,scale=320:-1:flags=lanczos,palettegen -y %1_palette.png
   ECHO [-------------- SendTo FFmpeg converter ---------------]
   ECHO [ STAGE 2 ]
   ECHO [ Converting to Gif using the generatied palette ]
   ECHO [------------------------------------------------------]
   "c:\Program Files\ffmpeg\bin\ffmpeg.exe" -v warning -i %1 -i %1_palette.png -filter_complex "fps=15,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" -y %1_hqgif.gif
   IF EXIST %1_palette.png DEL /s %1_palette.png
ECHO [-------------- SendTo FFmpeg converter ---------------]
ECHO [ SERVED ]
ECHO [------------------------------------------------------]
)
PAUSE

Do not forget to replace the path to FFmpeg if its installed into a different folder in your system.

You can remove PAUSE in the end to avoid the batch command window staying opened, but in this case it may blink too fast to be read.

This script is almost quiet that's why I added the echo comments to be typed during the conversion. If you need more info then change verbose level -v command from -v warning to -v info.

If you need to encode just a piece of your source video, you can add to command parameters something like -ss 12:23 -t 35 where -ss is start time and -t is duration

If you noticed the fps=15 value is set to 15, you change it of course to your preference, just do it in both FFmpeg command lines. You can also make a few versions of this script for various Gif settings.

Have fun!