HUB
Sign inSign up
ffmpeg-dnn logo

ffmpeglab/ffmpeg-dnn

By ffmpeglab

•Updated 7 days ago

https://github.com/ffmpeglab/docker-ffmpeg

Image
Machine learning & AI
0

203

ffmpeglab/ffmpeg-dnn repository overview

⁠OpenVINO (DNN inference, x86_64 only)

FFmpeg is built with --enable-libopenvino, so the dnn_processing, dnn_classify and dnn_detect filters can run models on the OpenVINO backend. Models must be in OpenVINO IR format (.xml + .bin) or ONNX. Bind mount your models directory into the container (read-only is fine).

docker run --rm -it \
  -v $(pwd):/config \
  -v /path/to/models:/models:ro \
  ffmpeglab/ffmpeg-dnn \
  -i /config/input.mkv \
  -vf "dnn_processing=dnn_backend=openvino:model=/models/espcn.xml:input=x:output=y:backend_configs=device=CPU" \
  -c:v libx264 \
  -c:a copy \
  /config/output.mkv

input and output must match the tensor names in the model (for example x and y for the ESPCN super-resolution model).

⁠Selecting an adapter

The inference device is set with device= inside backend_configs. Multiple options are separated with &.

DeviceDescriptionExtra docker args
CPUDefault. Runs on any x86-64 CPU.none
GPUIntel iGPU/dGPU (gen9+, Arc). Use GPU.0, GPU.1 to pick a specific card.--device=/dev/dri:/dev/dri
AUTOLets OpenVINO choose the best available device and fall back.--device=/dev/dri:/dev/dri to allow GPU use

Intel GPU example:

docker run --rm -it \
  --device=/dev/dri:/dev/dri \
  -v $(pwd):/config \
  -v /path/to/models:/models:ro \
  ffmpeglab/ffmpeg-dnn \
  -i /config/input.mkv \
  -vf "dnn_processing=dnn_backend=openvino:model=/models/espcn.xml:input=x:output=y:backend_configs=device=GPU&nireq=4" \
  -c:v libx264 \
  /config/output.mkv

Object detection with dnn_detect (bounding boxes are attached to frames as side data, so this example just benchmarks it):

docker run --rm -it \
  --device=/dev/dri:/dev/dri \
  -v $(pwd):/config \
  -v /path/to/models:/models:ro \
  ffmpeglab/ffmpeg-dnn \
  -i /config/input.mkv \
  -vf "dnn_detect=dnn_backend=openvino:model=/models/face-detection.xml:input=data:output=detection_out:confidence=0.6:backend_configs=device=AUTO" \
  -f null - -benchmark

Useful backend_configs options: device, nireq (parallel inference requests), batch_size, input_resizable, layout, scale and mean.

Tag summary
Recent tags
Content type
Image
Digest
sha256:e641d5fb2…
Size
303.9 MB
Last updated
8 days ago
docker pull ffmpeglab/ffmpeg-dnn:latest