bazel-central-registry icon indicating copy to clipboard operation
bazel-central-registry copied to clipboard

wanted: FFmpeg/FFmpeg

Open dieortin opened this issue 2 years ago • 6 comments
trafficstars

Module location

https://github.com/FFmpeg/FFmpeg

Link to bzlmod issue in the module's repository

No response

Any other context to provide?

No response

Fund our work

  • [ ] Sponsor our community's open source work by donating a feature bounty

dieortin avatar Nov 14 '23 23:11 dieortin

I would love this too!

AttilaTheFun avatar Jan 02 '24 19:01 AttilaTheFun

ffmpeg builds relatively easily with rules_foreign_cc, I've gotten something like the following to work:

configure_make(
    name = "ffmpeg",
    args = ["-j16"],
    configure_options = [
        "--disable-shared",
        "--enable-static",
        "--disable-doc",
        "--x86asmexe=$$EXT_BUILD_DEPS/nasm/bin/nasm",
    ],
    install_prefix = "build",
    lib_source = "@experimental_ffmpeg_6_1_1",
    out_binaries = [
        "ffmpeg",
        "ffprobe",
    ],
    out_static_libs = [
        "libavcodec.a",
        "libavdevice.a",
        "libavfilter.a",
        "libavformat.a",
        "libavutil.a",
        "libswresample.a",
        "libswscale.a",
    ],
    visibility = ["//visibility:public"],
    deps = [
        ":nasm",
    ],
)

configure_make(
    name = "nasm",
    configure_in_place = True,
    configure_prefix = "CFLAGS=\"\" LDFLAGS=\"\"",
    install_prefix = "build",
    lib_source = "@experimental_nasm",
    out_binaries = ["nasm"],
)

FFmpeg can be built with a very large number of potential dependencies, it should be possible to build most/all of them in a similar way and then add them to deps.

voxeljorge avatar Mar 28 '24 21:03 voxeljorge