Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

video-transcoding: init at 0.25.2 #69102

Closed
wants to merge 1 commit into from

Conversation

bdesham
Copy link
Contributor

@bdesham bdesham commented Sep 19, 2019

Motivation for this change

Adds video_transcoding, a set of Ruby scripts that provide a simplified interface to (and reasonable defaults for) handbrake-cli, ffmpeg, and other tools.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/83

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@geoffmacintosh
Copy link

I’m not the author of this commit, but I’d like to see it merged. I’ll see what I can do about mentioning a relevant maintainer.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@bdesham
Copy link
Contributor Author

bdesham commented Jun 1, 2020

The upstream package is now version 0.25.3. I’ll try to update this PR in the next day or two.

@geoffmacintosh
Copy link

Great! Is there anything I can do to help?

@bdesham
Copy link
Contributor Author

bdesham commented Jun 2, 2020

It looks like handbrake isn’t building on Darwin because it depends on numactl, which is not supported on Darwin. If you have a macOS system you could look into whether this is easy to get around. If not I can take a look.

@geoffmacintosh
Copy link

Crumbs. I remember handbrake having weird build issues a while ago, but I never really looked into it, but I just avoided the whole situation. I’ll give it a shot, but I’m certainly not sure I’ll figure anything out quickly.

@geoffmacintosh
Copy link

Is it possible to just remove the numactl requirement when building on macOS? As best I can tell, it's not needed on macOS. I've run through the build requirements and working on building Handbrake right now, and it's not listed in the build requirements, nor does it seem to (so far) actually be needed. The build requirements are

  • Xcode and friends
  • Python 3
  • autoconf 2.69 or later
  • automake 1.15 or later
  • cmake 3.1.0 or later
  • libtool 2.4.6 or later
  • meson 0.47.0 or later
  • nasm 2.13 or later
  • ninja 1.8.0 or later
  • pkg-config 0.29.0 or later

And searching through the GitHub repo uncovers such things as:

  # NUMA is linux only and only needed with x265
    options.enable_numa       = (IfHost(options.enable_numa, '*-*-linux*',
                                        none=False).value
                                 and options.enable_x265)
   option(ENABLE_LIBNUMA "Enable libnuma usage (Linux only)" ON)

Assuming it builds for me without numactl, I guess the next step would be to update the Handbrake build to avoid it on macOS?

@bdesham
Copy link
Contributor Author

bdesham commented Jun 4, 2020

Yeah, that should definitely be possible. Unfortunately, when I tried disabling the numactl dependency on macOS with

--- a/pkgs/applications/video/handbrake/default.nix
+++ b/pkgs/applications/video/handbrake/default.nix
@@ -10,7 +10,7 @@
 { stdenv, lib, fetchFromGitHub,
   # Main build tools
   pkgconfig, autoconf, automake, libtool, m4, lzma, python3,
-  numactl,
+  numactl ? null,
   # Processing, video codecs, containers
   ffmpeg-full, nv-codec-headers, libogg, x264, x265, libvpx, libtheora, dav1d,
   # Codecs, audio
@@ -48,6 +48,7 @@ assert stdenv.isDarwin -> AudioToolbox != null
        && Foundation != null
        && libobjc != null
        && VideoToolbox != null;
+assert !stdenv.isDarwin -> numactl != null;
 
 stdenv.mkDerivation rec {
   pname = "handbrake";
@@ -94,8 +95,9 @@ _EOF
     ffmpeg-full libogg libtheora x264 x265 libvpx dav1d
     libopus lame libvorbis a52dec speex libsamplerate
     libiconv fribidi fontconfig freetype libass jansson libxml2 harfbuzz
-    libdvdread libdvdnav libdvdcss libbluray lzma numactl
-  ] ++ lib.optionals useGtk [
+    libdvdread libdvdnav libdvdcss libbluray lzma
+  ] ++ lib.optional (!stdenv.isDarwin) numactl
+  ++ lib.optionals useGtk [
     glib gtk3 libappindicator-gtk3 libnotify
     gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus-glib udev
     libgudev hicolor-icon-theme

the build only reached the configure step:

find: xcodebuild...(fail) not found
  : name[0] = xcodebuild
ERROR: unable to continue; configure stop.

I don’t think Handbrake has always required Xcode to build. If it really does now—even if we only want to build the CLI version—then we may be able to use the same hack as the MacVim derivation, which basically just symlinks some parts of the Xcode toolchain so that they’re available during the Nix build. This is impure but I don’t know of any other way to invoke Xcode from Nix 😕

@bdesham
Copy link
Contributor Author

bdesham commented Jun 6, 2020

OK, I think I’ve got this figured out! I needed to tweak the derivations for both mkvtoolnix (#89584) and handbrake (#89674) but now video-transcoding itself builds and runs. Once those PRs have been merged I’ll update this one.

@geoffmacintosh
Copy link

Nice! I've been attempting to build handbrake without Xcode in Nix, but I'm far out of my depth here, so I've been very slow.

@stale
Copy link

stale bot commented Jun 7, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 7, 2021
@bdesham bdesham closed this Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants