Microsoft Bob

Just a short, simple blog for Bob to share some tips and tricks.

Be sure to check out my non-technical blog at www.bobsbasement.net.

Month List

Fixing Underwater Videos with FFMPEG

I ran into an interesting predicament: I couldn't get the right color adjustment settings to work in my video editor to correct some underwater videos from a scuba diving trip. After much trial and error, I came up with an alternative method: I have been able to successfully edit underwater photos to restore their color, so I used FFMPEG to export all of the frames from the source video as individual images, then I used a script to automate my photo editor to batch process all of the images, then I used FFMPEG to reassemble the finished results into a new MP4 file.

The following video of a Goliath Triggerfish in Bora Bora shows a before and after of what that looks like. Overall, I think the results are promising, albeit via a weird and somewhat time-consuming hack.

Exporting Videos as Images with FFMPEG

Here is the basic syntax for automating FFMPEG to export the individual frames:

ffmpeg.exe -i "input.mp4" -r 60 -s hd1080 "C:\path\%6d.png"

Where the following items are defined:

-i "input.mp4" specifies the source MP4 file
-r 60 specifies the frame rate for the video at 60fps
-s hd1080 specifies 1920x1080 resolution (there are others)
"C:\path\%6d.png" specifies the directory for storing the images, and specifies PNG images with file names which are numerically sequenced with a width of 6 digits (e.g. 000000.png to 999999.png)

Combining Images as a Video with FFMPEG

Here is the basic syntax for automating FFMPEG to combine the individual frames back into an MP4 file:

ffmpeg.exe -framerate 60 -i "C:\path\%6d.png" -c:v libx264 -f mp4 -pix_fmt yuv420p "output.mp4"

Where the following items are defined:

-framerate 60 specifies the frame rate for the output video at 60fps (note that specifying a different framerate than you used for exporting could be used to alter the playback speed of the final video)
-i "C:\path\%6d.png" specifies the directory where the images are stored, and specifies PNG images with file names which are numerically sequenced with a width of 6 digits (e.g. 000000.png to 999999.png)
-c:v libx264 specifies the H.264 codec
-f mp4 specifies an MP4 file
-pix_fmt yuv420p specifies the pixel format, which could also specify "rgb24" instead of "yuv420p"
"output.mp4" specifies the final MP4 file
Posted: Sep 23 2016, 02:45 by Bob | Comments (0)
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

How to Add the Nik Collection to Corel's PaintShop Pro

Following Google's acquisition of Nik Software, Google has decided to make it's suite of plugins available for free. With that in mind, I thought that I  would post a simple "How-To" guide for using the Nik plugins for anyone who is using Corel's PaintShop Pro instead of Adobe's hideously-priced Photoshop software. (Note that Photoshop is really cool, of course - it's just priced and/or licensed badly.)

In any event, here are the steps to use the Nik Collection plugins with Corel's PaintShop Pro on a Windows computer:

  1. Download the Nik Collection from https://www.google.com/nikcollection/
  2. Install the collection into the default folder; this should be something like the following path:

    "%ProgramFiles%\Google\Nik Collection"

  3. Open a Windows command prompt
  4. Change directory to the plugins folder for the version of PaintShop which you have installed; for example:

    cd /d "%ProgramFiles%\Corel\Corel PaintShop Pro X8 (64-bit)\PlugIns\EN"

  5. Create a directory junction to the Nik Collection:

    mklink /j "Nik Collection" "%ProgramFiles%\Google\Nik Collection"

  6. When you next open PaintShop, the Nik Collection will show up under Effects->Plugins:

    Nik-Plugins-For-Corel-PaintShop-Pro

That's all it takes. Have fun!

Posted: Mar 24 2016, 16:48 by Bob | Comments (0)
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Photography
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us