Running FFMPEG Binary From within Bazel

286 views
Skip to first unread message

Alexander N

unread,
Jun 13, 2020, 12:39:36 AM6/13/20
to bazel-discuss
Hello,

I am currently working on a nodejs project that is using eleventy to compile a bunch of static sites together.  I have figured out to configure bazel to call eleventy directly through an npm_bin but the project I am converting to bazel calls ffmpeg directly (I believe through some dependency).  Is there a way to have ffmpeg called through bazel?  I have ffmpeg installed on my machine but it is not finding the command within bazel.  Any advice is much appreciated!

Thanks!

Alexandre Rostovtsev

unread,
Jun 13, 2020, 11:22:39 AM6/13/20
to Alexander N, bazel-discuss
The simplest solution would be a genrule to call ffmpeg. See https://docs.bazel.build/versions/master/be/general.html#genrule

Note that if you are using an ffmpeg package provided by your distro, your build might not be perfectly reproducible because that package can get auto-updated, and the new ffmpeg version's output might be slightly different.

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/0d9deefb-35cf-4387-aed1-d0d6d01d2e59o%40googlegroups.com.

Alexander N

unread,
Jun 15, 2020, 10:58:49 AM6/15/20
to bazel-discuss
Unfortunately, FFMPEG is required in one of the NPM modules. I was hoping to use the system FFMPEG but the bazel command for modules.  Otherwise, i think I may be rewriting the nodejs_buildrules myself.

On Saturday, June 13, 2020 at 8:22:39 AM UTC-7, Alexandre Rostovtsev wrote:
The simplest solution would be a genrule to call ffmpeg. See https://docs.bazel.build/versions/master/be/general.html#genrule

Note that if you are using an ffmpeg package provided by your distro, your build might not be perfectly reproducible because that package can get auto-updated, and the new ffmpeg version's output might be slightly different.

On Sat, Jun 13, 2020 at 12:39 AM Alexander N <alex....@gmail.com> wrote:
Hello,

I am currently working on a nodejs project that is using eleventy to compile a bunch of static sites together.  I have figured out to configure bazel to call eleventy directly through an npm_bin but the project I am converting to bazel calls ffmpeg directly (I believe through some dependency).  Is there a way to have ffmpeg called through bazel?  I have ffmpeg installed on my machine but it is not finding the command within bazel.  Any advice is much appreciated!

Thanks!

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-...@googlegroups.com.

Kyle Cordes

unread,
Jun 15, 2020, 11:23:11 AM6/15/20
to bazel-discuss
(Caveat, I am definitely not sure of this:)

If you package up the ffmpeg binary as a NPM package, and declare dependency on it, that binary may be available to other NPM packages. This would be a smaller step off the mainline path, compared to a fork of nodejs_buildrules


Reply all
Reply to author
Forward
0 new messages