# this will be the ffmpeg executable directory: # change this to -Format MM-yyy for once a month, $Host.UI.RawUI.CursorPosition = New-Object .Coordinates 0, 4 Write-Host -Fore Magenta "Updating FFMPEG" $Host.UI.RawUI.CursorPosition = New-Object .Coordinates 0, 3 You knew that, didn’t you? function msg($msg) Since it’s powershell, you have to save it as a “.ps1” file. You could change this to every month if your connection speed is slow, or hour if you’re crazy, by editing the date format string on the second line. The script checks to see if it has been run today, and only checks for new builds if it hasn’t. If you add this folder to your PATH environment variable you can call ffmpeg from the Powershell prompt without having to specify the path to it every time. This script checks for new builds, downloads them, unzips them, and makes a hardlink to the executables - ffmpeg, ffprobe, ffplay - in C:\Program Files\ffmpeg. So I was downloading and linking the latest update and making sure it all went into the right place and got to thinking that checking for updates is the kind of task best left to a machine, and given that I’ve been gaining in PowerShell powers for a while I thought it might be a job I could tackle.So below is a function called updateFFMPEG. Aren’t humans the best people? Machines will do our work for us… Fortunately there’s someone who does it for you, for nothing - the wonderful Zeranoe. That’s a whole pile of tedium that you don’t need. Just making sure you’ve got the build environment working properly is a full time job, and if you’re paid to be a video nerd you don’t want to be mucking around with minGW and Cygwin and so on. And building it on windows is a royal pain. The down side is that since ffmpeg is distributed as source code you need to build it. The up side is that you get to learn the command line. For those who came in late, ffmpeg is the best reason for a video nerd to learn the command line.įor every question: “is it possible to automatically do x to some video?”, or “ I have 10,000 video files in format y, I want to convert them to format z, is that possible in my lifetime?”, the answer is usually: yes, you can do it with ffmpeg.
0 Comments
Leave a Reply. |