chenxiaolong / jellyfin-ffmpeg-fedora

Unofficial Fedora packaging scripts for jellyfin-ffmpeg
10 stars 0 forks source link

Problem with nvenc/notes on docs #1

Closed JASKevinWhite closed 1 year ago

JASKevinWhite commented 1 year ago

Thank you for this! So happy to have a place to start: I was attempting to "fork" the .spec file in rpmfusion, which is much more complicated than the .spec file you created.

I had a couple of issues.

  1. README.md has several references to jellyfin-ffmpeg5.spec. I could put a pull-request together to fix those if that would help.
  2. I have a fairly vanilla Fedora 38 instance I'm using to try to do the build. It might be useful to include a step to set up rpmfusion-free first (which is where mock-rpmfusion-free comes from):
    sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
  3. I had trouble with spectool. I can't find just "spectool". I've never used that tool before (I like it!), not sure if I found a different version or what. I found "rpmspectool", which is called like this:
    dnf install rpmspectool
    rpmspectool get jellyfin-ffmpeg.spec
  4. This is the big one: the build failed with: ERROR: nvenc requested but not found The only way I got around that was to edit the spec file and remove "--enable-nvenc", which is obviously not ideal. I'm not sure where nvenc should be coming from. I attempted a build using rpmfusion-nonfree, but that didn't fix it. I also tried adding "BuildRequires: pkgconfig(nvidia-vaapi-driver)" to the .spec, but that didn't help. I also tried adding "BuildRequires: nv-codec-headers " to the .spec, but that also didn't solve the problem. I looked at "dnf search nvidia"/"dnf search nvenc"/"dnf whatprovides '*/nvenc'" to try to find it, with no luck. I'm not an nvidia user, and haven't ever tried to compile something using nvenc, so I'm out of ideas as to how to solve this.
chenxiaolong commented 1 year ago

README.md has several references to jellyfin-ffmpeg5.spec. I could put a pull-request together to fix those if that would help.

Thanks! I overlooked that and pushed a fix in bf3b91ed0956f40100b8fd3d4348cc5a91f24a81. I removed the version suffix after the upgrade to version 6 to better match rpmfusion's naming of the regular ffmpeg package.

I had trouble with spectool. I can't find just "spectool". I've never used that tool before (I like it!), not sure if I found a different version or what.

spectool is included in the rpmdevtools package. I've added it to the README in 5f14894d77ca6124ede72f7f333e75bd36f6c3f0.

This is the big one: the build failed with: ERROR: nvenc requested but not found

Any chance you could post the full build command and output that led to this? I can't seem to reproduce the problem and, in theory, nothing on the host should affect how things are built within mock.

EDIT: To answer your question directly, the --enable-nvenc option should only require ffnvcodec (https://github.com/jellyfin/jellyfin-ffmpeg/blob/627f1c8c3edae2d33cfc83df382afe832d7b22a1/configure#L3154) which should be covered by pkgconfig(ffnvcodec) in the spec file's build dependencies.

JASKevinWhite commented 1 year ago

Thanks!

I just ran a screen session and attached the log. I started my removing the rpmfusion packages and checking out the git repo. All I did then was paste the commands right out of the README.md (easy now, thanks for the update).

I'm using Fedora 38. I don't do much on this instance but other build stuff (although one of the build tasks is OpenWRT, so there is a fair amount of stuff installed in the local filesystem, rather than in mock).

screenlog.0.txt

chenxiaolong commented 1 year ago

Thanks for the log! I'm able to reproduce it on Fedora 38 (I was testing against 39 earlier).

My last successful build with Fedora 38 was on 2023-10-17, so something must have changed recently with the nvidia dependency. I'll look into it today and see if I can work around whatever the issue is.

chenxiaolong commented 1 year ago

It looks like the problem is caused by the nv-codec-headers 12.1 update, which landed in Fedora 38, but not in Fedora 39 yet (probably due to the temporary freeze on updates for the upcoming release).

I've updated the spec file in 008264f6bb81d2e957d5ae21d770165e9fa3dfaf to pull in two patches from upstream ffmpeg (https://github.com/FFmpeg/FFmpeg/commit/03823ac0c6a38bd6ba972539e3203a592579792f and https://github.com/FFmpeg/FFmpeg/commit/d2b46c1ef768bc31ba9180f6d469d5b8be677500) that add support for version 12.1 of Nvidia's SDK.

JASKevinWhite commented 1 year ago

Great!

I hadn't thought to test this on Fedora 39. I am using it for a couple of things internally, but haven't yet set my build workstation up for it.

Thanks for looking into it!