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

mpv: build with ffmpeg-full #289984

Closed
wants to merge 1 commit into from
Closed

mpv: build with ffmpeg-full #289984

wants to merge 1 commit into from

Conversation

K900
Copy link
Contributor

@K900 K900 commented Feb 19, 2024

This enables support for smb (and possibly other protocols) that mpv advertises native support for, which kio takes it up on.

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

This enables support for smb (and possibly other protocols)
that mpv advertises native support for, which kio takes it up on.
@jopejoe1
Copy link
Member

We are at the moment trying to remove the dependens of ffmpeg-full, the features that mpv needs should be added to the regular ffmpeg variant. Unless there is a compeling reason that feature should not be in the regular version.

For more info please see #271863

cc @Atemu

@K900
Copy link
Contributor Author

K900 commented Feb 19, 2024

The primary feature that's missing is Samba support. I'm not sure if enabling it in ffmpeg(-not-full) will work because Samba is GPLv3 poison.

@jopejoe1
Copy link
Member

Currently all ffmpeg variants that we have are build with GPLv3 enabled.

@K900
Copy link
Contributor Author

K900 commented Feb 19, 2024

Should I change this to enabling Samba on ffmpeg-not-full then?

@jopejoe1
Copy link
Member

Should check by how much the closure size increases by enabling samba and if that is not to large, enable it for the small variant of ffmpeg

@K900
Copy link
Contributor Author

K900 commented Feb 19, 2024

❯ nix store diff-closures ./before ./after                                                           ffmpeg: +9.8 KiB
jansson: ∅ → 2.14, +112.7 KiB
ldb: ∅ → 2.8.0, +852.1 KiB
libarchive: ∅ → 3.7.2, +883.6 KiB
libbsd-unstable: ∅ → 2023-04-29, +100.0 KiB
libmd: ∅ → 1.1.0, +125.7 KiB
liburing: ∅ → 2.5, +154.8 KiB
libxcrypt: +230.2 KiB
popt: ∅ → 1.19, +186.9 KiB
python3: +118413.4 KiB
python3.11-dnspython: ∅ → 2.4.2, +3581.2 KiB
python3.11-markdown: ∅ → 3.5.1, +1065.0 KiB
samba: ∅ → 4.19.4, +77907.0 KiB
talloc: ∅ → 2.4.2, +325.4 KiB
tdb: ∅ → 1.4.10, +276.9 KiB
tevent: ∅ → 0.16.0, +243.6 KiB

oof

@Atemu
Copy link
Member

Atemu commented Feb 19, 2024

Python3 isn't too bad because that'll be in the closure of most users anyways.

I don't know about samba though. Would it be in a typical desktop closure? (i.e. GNOME ISO). If so, that'd probably be fine.

@Atemu
Copy link
Member

Atemu commented Feb 19, 2024

As for this PR's goal: MPV has a wrapper anyways right? Would it not be possible to build in a mechanism to supply your desired ffmpeg there? If someone needed smb support in MPV for some odd reason, they'd be able to just select ffmpeg-full themselves.

@K900
Copy link
Contributor Author

K900 commented Feb 19, 2024

For Plasma, yes. For GNOME, can't really say.

@K900
Copy link
Contributor Author

K900 commented Feb 19, 2024

As for this PR's goal: MPV has a wrapper anyways right? Would it not be possible to build in a mechanism to supply your desired ffmpeg there? If someone needed smb support in MPV for some odd reason, they'd be able to just select ffmpeg-full themselves.

No, it uses ffmpeg as a library. We could have an mpvFull though.

@Atemu
Copy link
Member

Atemu commented Feb 19, 2024

As a user of MPV myself, I really wouldn't want mpv to depend on ffmpeg-full by default.

As a maintainer of ffmpeg, I'm wary of closure size increases for niche features. I checked Arch's ffmpeg and it also doesn't include samba support. Given its niche, I don't think it's reasonable to have in the small variant.

I'd rather see this solution or adding smb support in default ffmpeg as last resorts if other (more appropriate) solutions aren't workable:

  1. Would it be possible to achieve this using overrides instead?
  2. It's a little hacky but the wrapper could also (ab)use LD_LIBRARY_PATH to inject a custom version of ffmpeg into MPV.
  3. mpvFull sounds like an okay compromise but I'd rather have 1. or 2.

@K900
Copy link
Contributor Author

K900 commented Feb 19, 2024

Another option would be to just patch the .desktop file to make it not claim smb support.

@K900
Copy link
Contributor Author

K900 commented Feb 19, 2024

That way, kio will run the file through a FUSE filesystem instead of passing a direct smb:// URL to mpv, which will be slower, but hopefully not by much?

@K900
Copy link
Contributor Author

K900 commented Feb 19, 2024

Done that: #290009

@K900 K900 closed this Feb 19, 2024
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.

3 participants