# Assumes ffmpeg is installed on the system (apt install ffmpeg / brew install ffmpeg) load("@rules_cc//cc:cc_library.bzl", "cc_library") load("@rules_cc//cc:cc_test.bzl", "cc_test") cc_library( name = "ffmpeg", hdrs = ["ffmpeg.h"], srcs = ["ffmpeg_wrapper.c"], linkopts = select({ "@platforms//os:linux": [ "-lavcodec", "-lavformat", "-lavutil", "-lswscale", "-lswresample", ], "@platforms//os:macos": [ "-lavcodec", "-lavformat", "-lavutil", "-lswscale", "-lswresample", ], "//conditions:default": [], }), copts = select({ "@platforms//os:linux": ["-I/usr/include/ffmpeg"], "@platforms//os:macos": ["-I/opt/homebrew/include", "-I/usr/local/include"], "//conditions:default": [], }), visibility = ["//visibility:public"], ) # For projects that just need to shell out to ffmpeg CLI cc_library( name = "ffmpeg_cli", hdrs = ["ffmpeg_cli.h"], srcs = ["ffmpeg_cli.c"], visibility = ["//visibility:public"], )