AlexxIT/go2rtc · error

ffmpeg: unsupported version:

Error message

ffmpeg: unsupported version: 

What it means

go2rtc checks the bundled/linked FFmpeg version by parsing ffmpeg -version, comparing the libavformat version against the minimum supported (ffmpeg.Version50). If libavformat is older than 5.0, ffmpeg.NewProducer cannot work with it and Version returns this error naming the reported ffmpeg version string.

Solutions

  1. Upgrade FFmpeg to >= 5.0 (or a build with libavformat >= 59)
  2. Install FFmpeg from a newer repo (e.g. jrottenberg/ffmpeg image, distro backports, static builds from BtbN/FFmpeg-Builds)
  3. Point the ffmpeg module at a newer binary path in config
  4. If upgrade is impossible, use a different source type (e.g. exec/rtsp) instead of the ffmpeg producer

Example fix

// before
apt install -y ffmpeg   # v4.x on Ubuntu 20.04
// after
# install FFmpeg 6.x static build
wget https://github.com/BtbN/FFmpeg-Builds/releases/latest/download/ffmpeg-master-latest-linux64-gpl.tar.xz
Defensive patterns

Strategy: validation

Validate before calling

out, _ := exec.Command("ffmpeg", "-version").Output()
if strings.Contains(string(out), "ffmpeg version 4") { return errors.New("ffmpeg >= 5.0 required") }

Try / catch

ver, err := ffmpeg.Version(); if err != nil && strings.Contains(err.Error(), "unsupported version") { /* switch to exec/rtsp source or upgrade ffmpeg */ }

Prevention

When it happens

Trigger: Using a system FFmpeg older than 5.0 (libavformat < 58.x/59 boundary per Version50) with the ffmpeg module; distro ships FFmpeg 4.x.

Common situations: Ubuntu 20.04/Debian 11 with FFmpeg 4.x; minimal Docker images pinning old FFmpeg; nightly/master builds reporting odd version strings but old libavformat.

Related errors


AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07). Data as JSON: /api/errors/a853ba9ae927b158. Report an issue: GitHub.

Appendix: source

Thrown at internal/ffmpeg/version.go:40

	}

	cmd := exec.Command(defaults["bin"], "-version")
	b, err := cmd.Output()
	if err != nil {
		verFF = "-"
		verErr = err
		return verFF, verErr
	}

	verFF, verAV = ffmpeg.ParseVersion(b)

	if verFF == "" {
		verFF = "?"
	}

	// better to compare libavformat, because nightly/master builds
	if verAV != "" && verAV < ffmpeg.Version50 {
		verErr = errors.New("ffmpeg: unsupported version: " + verFF)
	}

	log.Debug().Str("version", verFF).Str("libavformat", verAV).Msgf("[ffmpeg] bin")

	return verFF, verErr
}

View on GitHub (pinned to c245815e75)