DEV Community

Katsuhisa Kitano
Katsuhisa Kitano

Posted on

GitHub Actions for FFmpeg

I wanted to use FFmpeg to create gif files to attach to GitHub, but I didn't want to install FFmpeg on my local machine. So I made it possible to run FFmpeg on GitHub Actions.

GitHub

https://github.com/katsuhisa91/just-ffmpeg-actions

How to use

1. clone this repository & put your movie file in origin folder

2. update env about video file names

CAUTION: Overwrite an exist video file if same AFTER_PROCESSING_FILE name is exists.

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      BEFORE_PROCESSING_FILE: shortcut-to-github1s.mov
      AFTER_PROCESSING_FILE: shortcut-to-github1s.gif
Enter fullscreen mode Exit fullscreen mode

3. update FFmpeg options if you need

      - name: Execute ffmpeg
        run: ffmpeg -y -i origin/${{ env.BEFORE_PROCESSING_FILE }} -vf scale=800:-1 -r 10 processed/${{ env.AFTER_PROCESSING_FILE }}
Enter fullscreen mode Exit fullscreen mode

By the way, the default option is optimized for converting to gifs from .mov extensions.

4. commit & push

5. GitHub Actions bot commit a processed video file into processed folder

Top comments (0)