Showing posts with label denoise. Show all posts
Showing posts with label denoise. Show all posts

Monday, July 14, 2014

VidProk: Preview ffmpeg filters

VidProk lets you preview ffmpeg filters (no more test encodes, yey!).  Additionally, it includes a VF cheat sheet which lets you conveniently copy/paste filters.



Some of the video filters include:  Add noise, color curves, deinterlace, denoise (hqdn3d), deshake, draw box, draw grid, fade in, flip horizontal, flip vertical, gamma, geq - emboss, grayscale, histogram, hue and saturation, mplayer: gamma, brightness, contrast (experimental), negate, pp - deblocking, deringing, auto brightness & contrast, sepia, smartblur, unsharp, vignette, and YUV420P.

The VF cheat sheet is by no means a substitute for ffmpeg's documentation --- so, if the default values do not satisfy you, read the ffmpeg manual.

Here are some screen shots...

'play both (horizontal)':
filters used: gamma, curves, saturation, unsharp, denoise, deblock, yuv420p






'play both (vertical)':



And finally, 'play both @ pos 0x0':  Both source and processed windows are placed on the top left corner (one window obscures the other).  Clicking 'toggle' alternates between the source and processed windows.  This lets you easily see the differences, especially small differences, between the processed and the source windows.

 I know that ffmpeg is a no-joy in the instant gratification department, but I hope you'll like using this tool.

Youtube demo:
http://youtu.be/zgXiGfZlTVo

VidProk is included in 'VidProkEnMasse', it is absolutely free, and you can download it here:
http://vidprokenmasse.blogspot.com/2014/07/vidprokenmasse.html


Batch denoising JPEG files with ffmpeg

I love PhotoScape! If your photoshop skills are not up to par, then you will like this program too. Its 'film effect' filters are amazing, but what I really like about this program is its Noise Reduction (clear skin) feature - your woman will love you for using it, especially on close-ups (less visible blemishes/pores/lines). However, this functionality is not available in batch editor mode (last time I checked). *sigh*

Fortunately, ffmpeg offers the next best thing, and it's called High Quality 3D Denoise.

Just create an empty text file, rename it to, like, "Denoise_JPEG_files_in_this_folder.bat", copy/paste the code below, set the appropriate ffmpeg path, tweak to taste, copy/paste the batch file into a folder full of jpeg files, and you're ready to go!

BTW, set the value for "AdditionalVideoFilters" to blank if you don't want the set filter.

<code starts after this line>

@echo off

: _______________________________________________

: This batch file will apply ffmpeg's High Quality 3D Denoise filter on all found image files in the current folder (subfolders included) and open the output folder. Don't forget to set ffmpeg's full path.

: _______________________________________________


: enter required/desired settings

: set ffmpeg path (required). use double quotes.
set ffmpeg="C:\~ En Masse\third party bin\ffmpeg-20131222-git-9b195dd-win32-static\bin\ffmpeg.exe"

: set LumaSpatial. practical range for a 640x480 image is 4-12. no quotes.
set LumaSpatial=12

: set image file types to search/process. note that all files will be converted to the set outputfile extension. no quotes.
set FileTypes=*.jpg, *.jpeg, *.bmp, *.png, *.tif, *.tiff

: output folder (subfolder). no quotes/spaces.
set OutputFolder=~Denoised

: output file name suffix. no quotes.
set Suffix=_Denoised

: output file extension (jpg, png, bmp, etc). no quotes.
set OutputExtension=jpg

: additional video filter (optional). this is for demonstration purposes only. precede each filter with a comma ','. you can set the value to blank if you don't want this feature. no double quotes at both ends.
set AdditionalVideoFilters=, curves=master='0.05/0.045 0.06/0.06 0.5/0.6'

: _______________________________________________

title %~n0

: create the output folder
md %OutputFolder%

: open the created output folder
start explorer.exe %OutputFolder%

: search and process
FOR /F "delims=" %%A IN ('dir /a:-d /b /o:n /s %FileTypes%') DO (
echo %%A
%ffmpeg% -threads 1 -y -f image2 -i "%%A" -f image2 -qscale:v 1 -vf "hqdn3d=luma_spatial=%LumaSpatial%: chroma_spatial=1: luma_tmp=1: chroma_tmp=1 %AdditionalVideoFilters%" "%OutputFolder%\%%~nA%Suffix%.%OutputExtension%"
)

exit