Skip to content

imgly/blog-ffmpeg-gcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FFmpeg on Google Cloud Platform (GCP)

Run FFmpeg on Google Cloud Platform to process video and audio files efficiently at scale. This repository provides step-by-step guides, example commands, and ready-to-use scripts to help you set up a Google Cloud project, launch a VM, install FFmpeg, and process media files in the cloud. For a more detailed guide, see FFmpeg on GCP: Step-by-Step for Beginners article.

🚀 Overview

FFmpeg is a powerful open-source command-line tool for converting, compressing, and processing media. While you can run FFmpeg locally, larger files and workloads can be slow and resource-intensive. Running FFmpeg on GCP allows you to:

  • Use scalable infrastructure and faster machines
  • Store input/output files in Google Cloud Storage
  • Automate video/audio conversions at scale
  • Pay only for the compute time you use

This repo walks you through the process with documentation and scripts.


📂 Project Structure

ffmpeg-gcp-demo/
├── README.md               # Main project guide
├── docs/                   # Step-by-step tutorials
│   ├── 01-setup-project.md
│   ├── 02-compute-engine-vm.md
│   ├── 03-install-ffmpeg.md
│   ├── 04-sample-commands.md
│   ├── 05-process-video.md
│   ├── 06-other-options.md
│   └── 07-conclusion.md
├── scripts/                # Automation scripts
│   ├── install_ffmpeg.sh
│   ├── test_ffmpeg.sh
│   ├── download_from_gcs.sh
│   ├── convert_video.sh
│   └── upload_to_gcs.sh
├── examples/               # Example FFmpeg workflows
│   ├── testsrc_demo.sh
│   ├── mp4_to_webm.sh
│   └── resize_video.sh
├── gcp-config/             # Notes on VM & Storage config
│   ├── vm-instance-config.md
│   ├── storage-setup.md
│   └── access-scopes.md
└── .gitignore

🛠️ Prerequisites

  • A Google Cloud account (new users get free credits)
  • Billing enabled for your project
  • Basic command-line knowledge (Linux shell)

📖 Quick Start

  1. Clone this repo

    git clone https://github.com/your-username/ffmpeg-gcp-demo.git
    cd ffmpeg-gcp-demo
  2. Create a Google Cloud project See docs/01-setup-project.md

  3. Launch a Compute Engine VM Follow docs/02-compute-engine-vm.md

  4. Install FFmpeg

    To make the files executable, run these commandas first:

    cd scripts
    chmod +x *.sh
    cd ..

    Run the provided script:

    ./scripts/install_ffmpeg.sh

    To see what the script does, see here.

  5. Test FFmpeg

    ./scripts/test_ffmpeg.sh

    To see what the script does, see here.

  6. Process a video (download → convert → upload)

    ./scripts/download_from_gcs.sh
    ./scripts/convert_video.sh
    ./scripts/upload_to_gcs.sh

    To see what the scripts do, see here.


🎬 Examples


⚡ Advanced Options

  • Cloud Run: Package FFmpeg in a container for serverless jobs
  • Transcoder API: Use Google’s managed video processing service
  • Kubernetes (GKE): Scale out FFmpeg across many parallel jobs

🔒 Security Notes

  • Never commit service account keys or credentials to GitHub.
  • Use IAM roles and Access Scopes to control bucket read/write access.
  • Always add credentials.json and other sensitive files to .gitignore.

📚 Resources


📜 License

This project is licensed under the MIT License – see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages