limbergarcia/gotemberg

By limbergarcia

Updated 3 months ago

Docker image based on Python 3.11-slim with FFmpeg support for video processing tasks.

Image
Languages & frameworks
Integration & delivery
API management
0

70

limbergarcia/gotemberg repository overview

Gotemberg: Video Processing API

Gotemberg is a lightweight Dockerized Flask API that performs video processing operations using ffmpeg.
It supports:

✔ Extracting a frame from a video
✔ Splitting a video into multiple time-based segments

Designed for developers and media-processing pipelines.


✨ Features

  • Extract a single frame at a specific timestamp
  • Split videos into equal segments (minutes)
  • Uses ffmpeg internally
  • Lightweight (python:3.11-slim)
  • Fast streaming-based processing
  • Temporary files auto-cleanup
  • Simple REST API interface

📡 API Port

The API listens on port 5000.

Run the container:

docker run -p 5000:5000 limbergarcia/gotemberg:video-v2

📸 Endpoint: Extract a Frame

POST /frame

Extracts a single video frame at the specified timestamp.

Form-data parameters
KeyTypeRequiredDescription
videoFileYesMP4 video to process
timeStringNoTimestamp in HH:MM:SS (default: 00:00:01)
Example curl
curl -X POST http://localhost:5000/frame \
  -F "video=@sample.mp4" \
  -F "time=00:00:03" \
  --output frame.jpg

🎬 Endpoint: Split Video by Duration

POST /split_duration

Splits a video into multiple MP4 files of equal duration (in minutes).
Returns a ZIP file containing all generated segments.

Form-data parameters
KeyTypeRequiredDescription
videoFileYesMP4 video file to split
segment_minutesIntegerYesDuration (in minutes) for each output segment
Output

A ZIP file containing:

part_000.mp4
part_001.mp4
part_002.mp4
...
Example curl
curl -X POST http://localhost:5000/split_duration \
  -F "video=@sample.mp4" \
  -F "segment_minutes=20" \
  -o segments.zip

⚙️ Internal Behavior

  • Uses ffmpeg segment mode:
    ffmpeg -i input.mp4 -c copy -map 0 \
      -f segment -segment_time <seconds> part_%03d.mp4
    
  • No re-encoding (-c copy) → extremely fast
  • Output maintains original quality
  • Creates temp directories per request
  • Cleans all temp files after finishing

🧹 Auto-Cleanup

After sending the response, the API automatically removes:

  • Temporary uploaded videos
  • Generated segment files
  • Frames
  • ZIP files

🚀 Run the API

docker run -p 5000:5000 limbergarcia/gotemberg:video-v2

Tag summary

Content type

Image

Digest

sha256:f60869c1a

Size

211.6 MB

Last updated

3 months ago

docker pull limbergarcia/gotemberg:video-v2