Oct 24, 2018

Moved my tools to Github

I moved my set of SendTo_FFmpeg batches to a Github repoSo if you have issues, ideas, request, you can post them there.
There's also new AEExprTool I develop for myself. It's After Effects script for adding/removing error handling code to AE expressions in bulk. It's already a huge time saver for me. Would love to have some feedback cause I plan to make it a reliable full featured tool one day.

Aug 27, 2018

C4D, Redshift, Relighting and the Normals

Recently met the task of relighting in post and had a range of troubles trying to make it in After Effects. I do not recommend anyone doing it in AE :).
The free Normality plugin is barely compatible with the modern CC versions and produces crazy burnt highlight values and dirty edges (at least that was my experience of using it with AE CC2017). There's a better and payed alternative like Pixel Cloud now although dealing with all the required passes is not an easy task for starters.
Oh, the main reason for this post was actually just leaving a memo for any one who cares including myself. It's about C4D's standard renderers' normal pass specs that I've managed to match during the work/tests. Since I am a dedicated Redshift user I was able to identify that C4D's normal pass is a Camera space normals of unsigned values of 0 .. 1. Redshift by default operates on signed -1..1 values. So to get the equal normal pass from the Redshift you need something like this

With the RS State node set to Camera transform space.

Aug 24, 2018

Golden Ratio preset for Affinity Designer


A useful asset for Affinity Designer I made for myself.
Get it here



Aug 1, 2018

SendTo FFMpeg batches updated with encoding using external audio file

Heres a new batch in my collection
@ECHO OFF
ECHO [----------------------------------------------------------------]
ECHO [---  SendTo FFmpeg encoder v1.01 by Keerah.com               ---]
ECHO [---  MP4 h264 module has been invoked                        ---]
ECHO [---  Preset: CUDA 420, Slow, 40Mbit, External Audio to AAC   ---]
ECHO [---  Using external audio source file: %~n1.wav
IF %1.==. (
ECHO [----------------------------------------------------------------]
ECHO [     NO FILE SPECIFIED                                          ]
) ELSE (
IF not EXIST %~n1.wav (
ECHO [----------------------------------------------------------------]
ECHO [     Couldn't find the external audio file: %~n1.wav
GOTO End
)
ECHO [----------------------------------------------------------------]
ECHO [     Transcoding...                                             ]
"c:\Program Files\ffmpeg\bin\ffmpeg.exe" -vsync 0 -hwaccel cuvid -i %1 -i %~n1.wav -c:a aac -b:a 256k -shortest -c:v h264_nvenc -preset slow -b:v 40M -pix_fmt yuv420p -force_key_frames 0:00:02 -y %1_cuda420_40Mbit_slow_ext.mp4
)
:End
ECHO [----------------------------------------------------------------]
ECHO [     SERVED                                                     ]
ECHO [----------------------------------------------------------------]
PAUSE
This one uses your Cuda card for encoding (to yuv420 40Mbit mp4) but also looks for a .wav file with the same name as your source video has and places it instead of whatever audio was in your source video. If the streams are different in length the arg -shortest tells FFmpeg to cut the output to the shortest of audio or video. New audio will be recompressed into 256kbps AAC, FFmpeg is clever and takes in account all the source audio channels.

Your source video and audio files must have exact names (except the extension of course). The script checks if there's appropriate .wav file found and stops in case it wasn't.

All presets are now yuv420 (12bit per pixel) to achieve better compression, use -pix_fmt yuv444p  for higher quality you444 (24 bit per pixel) output.

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!

Feb 1, 2018

Using ffmpeg presets in two clicks with windows Send To menu

The first part of FFMPEG lifehack for all video pros. Here you'll find a trick to get ffmpeg into your everyday workflow and to integrate it right into Windows Send To menu in this manner:

It's really easy and efficient way of transcoding your files which offers you better quality and better control of you output videos. You can have pretty many presets and do your conversions it 2 clicks (unfortunately Send To does not support sub menus, I've checked it)

1. You need to download FFMPEG itself from here, it's free. Install it, usually it's path to c:\Program Files\ffmpeg

2. Create a new text file with this text
@echo off
"c:\Program Files\ffmpeg\bin\ffmpeg.exe" -i %1 -c:v libx264 -preset slow -crf 18 -c:a copy %1_output.mp4
pause
Save it, give it a desired name, and give it the extension .bat

3. Put this file to any convenient location for your presets. Create the shortcut for this file (drag + Alt) and place this shortcut file into %userprofile%/SendTo
You can rename it to get rid of Shortcut in the name, just do not change the .lnk extension. You can also change the icon of this shortcut in its file properties, this icon will be used in the Send To menu. If you can not find SendTo folder try search or look into ...\AppData\Roaming\Microsoft\Windows\SendTo

4. So basically you just did it. Now you can right click on any file and navigate to Send To item. You'll find your new preset item there. This .bat file will run ffmpeg to convert whatever you clicked to mp4 h264 video and it will place it into same folder with _output added to your filename.

This particular bat preset creates video of h264 high 4:2:2 L3.1, yuv422p and copies the source audio track into the new file as is. You can keep these presets in your cloud, and your shortcuts can refer to them so if you change your presets the changes are always in sync. You'll probably need to refer to ffmpeg docs to make more presets, but here I'll give you some very basic hints:

1. The bitrate is set by -crf parameter, values are from 0 (lossless) up to 53 (and up to 63 for 10-bit colour), the scale is exponential.
2.  -preset paramter also affects the bitrate
3. -c parameter defines the codec, -c:v for video, -c:a for audio (refer to encoders doc)

There're actually many GUIs for ffmpeg, but unfortunately I wasn't satisfied by any of those and many of them are not free. Using ffmpeg also makes you in charge of keeping your files compatible with your video players and any hardware you're going to use. To avoid such problems use -profile parameter in your presets, the profiles are codec-specific, so you'll definitely have to refer to the codecs docs here (video encoders, audio encoders). Here I'll give a few more .bat file presets I usually use:

h264 mp4 420p constrained to level 3.0 standard (compatible with most software), lower bitrate
@ECHO OFF
IF %1.==. (
ECHO [-------------- SendTo FFmpeg converter ---------------]
ECHO [     NO FILE SPECIFIED                                ]
ECHO [------------------------------------------------------]
) ELSE (
"c:\Program Files\ffmpeg\bin\ffmpeg.exe" -v warning -i %1 -c:v libx264 -profile:v baseline -level 3.0 -pix_fmt yuv420p -preset slow -crf 24 -c:a aac -b:a 128k -y %1_420_constrL3.mp4
ECHO [-------------- SendTo FFmpeg converter ---------------]
ECHO [     SERVED                                           ]
ECHO [------------------------------------------------------]
)
PAUSE
h264 mp4 422p medium quality, slower better compression algo, less compatible
@ECHO OFF
IF %1.==. (
ECHO [-------------- SendTo FFmpeg converter ---------------]
ECHO [     NO FILE SPECIFIED                                ]
ECHO [------------------------------------------------------]
) ELSE (
"c:\Program Files\ffmpeg\bin\ffmpeg.exe" -v warning -i %1 -c:v libx264 -preset slower -crf 16 -pix_fmt yuv422p -c:a copy -y %1_422_medium_slower.mp4
ECHO [-------------- SendTo FFmpeg converter ---------------]
ECHO [     SERVED                                           ]
ECHO [------------------------------------------------------]
)
PAUSE
h264 mp4 422p high quality and better compression algo, less compatible too
@ECHO OFF
IF %1.==. (
ECHO [-------------- SendTo FFmpeg converter ---------------]
ECHO [     NO FILE SPECIFIED                                ]
ECHO [------------------------------------------------------]
) ELSE (
"c:\Program Files\ffmpeg\bin\ffmpeg.exe" -v warning -i %1 -c:v libx264 -preset slower -crf 8 -pix_fmt yuv422p -c:a copy -y %1_422_highest_slower.mp4
ECHO [-------------- SendTo FFmpeg converter ---------------]
ECHO [     SERVED                                           ]
ECHO [------------------------------------------------------]
)
PAUSE

Jan 13, 2018

for older ASUS mobo owners for whom AI Suite II stopped working

Since the new Windows 10 kernel update killed AI Suite II and ASUS doesn't give a fuck about it for all of you who lost control of your mobo fans here's a way. I've got managed to set up SpeedFan to control the fan speeds. It's nice, free, and lightweight utility but quite tricky to setup. It also gives you compound triggers (combined data from different sensors) to control your fans. It detected my both GPUs sensors as well, so I can use their data to control chassis fan for example. So... even better than the shitty Suite II. Give it a try. To give you a quick start begin with setting these to manual mode.




It's also easy to switch to manual control, just uncheck the Automatic mode button. The only problem I had was that SpeedFan reported my CPU temperature as -60, but cores temps are good, so I made that compound advanced feature to control the CPU fan.


I had tried SpeedFan before but with no luck, before I've know the first trick. Hope it'll work for you.