soimort/you-get · error · EnvironmentError

No ffmpeg found

Error message

No ffmpeg found

What it means

Raised in ffmpeg_concat_mp4 (src/you_get/processor/ffmpeg.py:300) when merging downloaded segments requires ffmpeg but neither ffmpeg nor avconv was detected at import time (module-level probe get_usable_ffmpeg sets FFMPEG=None). The you-get project only ships a downloader; multi-segment merge and format conversion are delegated to an external ffmpeg binary, so its absence makes the operation impossible rather than degraded.

Source

Thrown at src/you_get/processor/ffmpeg.py:300

    return True


def ffmpeg_concat_audio_and_video(files, output, ext):
    print('Merging video and audio parts... ', end="", flush=True)
    if has_ffmpeg_installed:
        params = [FFMPEG] + LOGLEVEL
        params.extend(['-f', 'concat'])
        params.extend(['-safe', '0'])  # https://stackoverflow.com/questions/38996925/ffmpeg-concat-unsafe-file-name
        for file in files:
            if os.path.isfile(file):
                params.extend(['-i', file])
        params.extend(['-c:v', 'copy'])
        params.extend(['-c:a', 'aac'])
        params.extend(['-strict', 'experimental'])
        params.extend(['--', output + "." + ext])
        return subprocess.call(params, stdin=STDIN)
    else:
        raise EnvironmentError('No ffmpeg found')


def ffprobe_get_media_duration(file):
    print('Getting {} duration'.format(file))
    params = [FFPROBE]
    params.extend(['-i', file])
    params.extend(['-show_entries', 'format=duration'])
    params.extend(['-v', 'quiet'])
    params.extend(['-of', 'csv=p=0'])
    return subprocess.check_output(params, stdin=STDIN, stderr=subprocess.STDOUT).decode().strip()

View on GitHub (pinned to 049548f3f3)

Solutions

  1. Install ffmpeg: apt-get install -y ffmpeg (Debian/Ubuntu), apk add ffmpeg (Alpine), brew install ffmpeg (macOS), or winget/choco install ffmpeg (Windows), then re-run — the module re-probes on next start.
  2. Ensure the ffmpeg binary is on PATH for the process that runs you-get (print os.environ['PATH']; for GUI apps set PATH explicitly or use an absolute path).
  3. If ffmpeg is installed but still not detected, run `ffmpeg -version` manually; the first line must start with 'ffmpeg version <nonzero>' or 'avconv' (get_usable_ffmpeg asserts this).
  4. As a workaround, pass merge=False / info_only=True to skip merging, keeping the raw segments.
  5. Guard in code with has_ffmpeg_installed() from you_get.processor.ffmpeg before starting a multi-segment download.

Example fix

# before
from you_get.extractors import some_extractor
some_extractor(url)  # raises EnvironmentError('No ffmpeg found') at merge step

# after
from you_get.processor.ffmpeg import has_ffmpeg_installed, FFMPEG

if not has_ffmpeg_installed():
    raise SystemExit('ffmpeg is required for merging — install it first')
some_extractor(url)
Defensive patterns

Strategy: validation

Validate before calling

from you_get.processor.ffmpeg import has_usable_ffmpeg

if not has_usable_ffmpeg():
    raise SystemExit('ffmpeg is required for segment merging — install it or pass merge=False')

Type guard

null

Try / catch

try:
    download_urls(urls, title, ext, size, merge=True)
except EnvironmentError as e:
    if 'No ffmpeg found' in str(e):
        # keep raw segments instead of aborting
        download_urls(urls, title, ext, size, merge=False)
    else:
        raise

Prevention

When it happens

Trigger: Downloading any stream delivered as multiple segments (e.g. HLS) with merge=True: after download, ffmpeg_concat_av/ffmpeg_concat_mp4 is called, has_usable_ffmpeg() is False, and the else branch raises EnvironmentError('No ffmpeg found'). Also fires when ffmpeg is on PATH but is a broken/renamed build whose '-version' output fails the assert in get_usable_ffmpeg (line 24).

Common situations: Fresh minimal container (alpine/slim Docker images) or CI runner with no ffmpeg package; ffmpeg not on PATH in a GUI-launched app or Windows without PATH entry; an ffmpeg build that prints a different banner (version parse fails the assert); avconv-only systems (old Debian/Ubuntu) where avconv is also missing.


AI-assisted analysis of soimort/you-get@049548f3f3 (2026-08-15). Data as JSON: /api/errors/10b036d33f5b66c6. Report an issue: GitHub.