Git Product home page Git Product logo

videoshrink's Introduction

Introduction

Video Shrinker is a small project is to provide the user with a quick and convenient video compression workflow in Windows and macOS environments. With these scripts, all you have to do is select a video, specify the size you'd like it to be and it'll be resized.

See DISCLAIMER.

Table of Contents

Installing ffmpeg

This installation guide is written for folks who are not familiar with the command-line environment and environment variables. You may skip these instructions if you are familiar with those.

Before you can use these scripts, you will need to install ffmpeg - a suite of command-line tools for video and audio processing. If you know you already have ffmpeg installed, you do not need to install it again and may skip this installation step. If you're not sure if you've installed ffmpeg before, it should be safe to follow this installation guide anyhow.

ffmpeg: Windows

Installing ffmpeg on Windows with Chocolatey (easiest)

Chocolatey is a package manager for Windows that can make the installation process more convenient by allowing us to install ffmpeg with only a few commands.

  1. Install Chocolatey: If you already have Chocolatey installed, skip this step. Open a PowerShell window with Administrative Privileges by hitting Win + X, then hitting a. Copy and paste the below code into the PowerShell window and then hit Enter:

    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

    If you don't see any errors in the installation output, Chocolatey should now be installed.

  2. Install ffmpeg: In a PowerShell window with Administrative Privileges, type (or copy and paste) the command choco install ffmpeg -y and hit Enter. If there are no errors, ffmpeg is now installed.

Installing ffmpeg on Windows manually (harder)

If you cannot (or don't want to) install Chocolatey, you may also install ffmpeg manually. Do note that ffmpeg does not come with an installer, so we can only install it manually. It is very easy to mess up this installation โ€” follow these instructions down to the letter and double-check your spellings.

  1. Download ffmpeg: Go to https://github.com/BtbN/FFmpeg-Builds/releases. Upon opening the page, you will see a long list of items. Click on the item named ffmpeg-master-latest-win64-gpl.zip to download the ffmpeg archive. The download location does not matter, but choose a place where you will have easy access to, like for example, your Downloads folder. Once the download is complete, extract the archive.

  2. Put the ffmpeg files in a convenient place: Go to the C:\ directory and create a folder named ffmpeg. Copy the contents of the bin folder in the archive you extracted and paste them inside the "ffmpeg" folder you created in C:\. You should now have the files "ffmpeg.exe", "ffprobe.exe", and "ffplay.exe" in a folder called "ffmpeg" in the C:\ drive.

  3. Open the Environment Variables editor: Open "Run" dialog by hitting Win + R. In the dialog box that pops up, type or copy and paste the following command and hit Enter:

    rundll32 sysdm.cpl,EditEnvironmentVariables
    

    You should now see a window titled "Environment Variables", with two boxes labeled "User variables" and "System variables".

  4. Update the Path variable: In the "User Variables" box, double-click the row that says "Path" in the "Variable" column. A window titled "Edit environment variable" should appear. Press the "New" button, type C:\ffmpeg\ in the text field that appears and press Enter to finish typing. Press OK to close the "Edit environment variables" window. Press OK again to close the "Environment variables" window.

  5. Testing installation: Hit Win + R to open the "Run" dialog again. In the text box, write ffmpeg and hit Enter. If ffmpeg was installed correctly, you should see a black window (a command prompt window) open up for a second and then close itself. Congratulations - ffmpeg is now installed and you are now ready to run these scripts.

    If ffmpeg was installed incorrectly, you will see a window that says "Windows cannot find 'ffmpeg'. Make sure you typed the name correctly, and then try again." Start over from step 1 and make sure you didn't miss anything. If you haven't already, consider using the Chocolatey installation method.

ffmpeg: macOS

Installing ffmpeg on macOS with Homebrew

Homebrew is a package manager for Windows that can make the installation process more convenient by allowing us to install ffmpeg with only a few commands.

  1. Install Homebrew: Open the Terminal and copy and paste the following command and hit Enter.

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

    If there were no errors during installaton, homebrew should now be installed.

  2. Install ffmpeg: In the terminal, run brew install ffmpeg. If there were no errors during installation, ffmpeg should now be installed.

Usage

Windows

  1. Download the script. Download shrink.bat (the script) from this repository.
  2. Choose a video. Drag and drop any video you'd like to shrink onto the script.
  3. Enter desired size. You will be prompted for how big you'd like your video, in megabytes. Due to Windows batch script limitations, only whole, positive numbers are supported.
  4. Done! The shrunk video will be created in the save folder as the original video.

macOS

  1. Download the Automator workflow. Download the "Shrink Video.workflow".
  2. Install the workflow. Double-click it to install.
  3. Choose a video. Right click any video and click "Shrink video".
  4. Enter desired size. You will be prompted for how big you'd like your video, in megabytes.
  5. Done! The shrunk video will be created in the save folder as the original video.

DISCLAIMER

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

videoshrink's People

Contributors

strfox avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.