Difference between revisions of "MPV"
Doronbehar (talk | contribs) m (Remove unused headline at end) |
m (rollback unauthorized mass edits) Tag: Rollback |
||
(6 intermediate revisions by 5 users not shown) | |||
Line 2: | Line 2: | ||
* <code>mpv</code> | * <code>mpv</code> | ||
− | * <code>mpv- | + | * <code>mpv-unwrapped</code> |
− | {{ic|mpv | + | {{ic|mpv}} is a wrapper for the {{ic|mpv}} binary which adds {{ic|--script<nowiki>=</nowiki>}} arguments according to the scripts the wrapper was built with. |
− | If you'd like to add scripts to your {{ic|mpv}} wrapper, you'll need to | + | If you'd like to add scripts to your {{ic|mpv}} wrapper, you'll need to create an overlay in {{ic|~/.config/nixpkgs/config.nix}} or {{ic|/etc/nixos/configuration.nix}} (if you are using NixOS): |
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
− | + | nixpkgs.overlays = [ | |
− | + | (self: super: { | |
− | mpv | + | mpv = super.mpv.override { |
− | scripts = [ | + | scripts = [ self.mpvScripts.<your choice> ]; |
}; | }; | ||
− | }; | + | }) |
− | + | ]; | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | All of the scripts for MPV can be found under the {{ic|mpvScripts}} attribute. | + | All of the scripts for MPV can be found under the {{ic|mpvScripts}} attribute. You can search for them by running {{ic|nix search mpvScripts}}. The scripts are defined in the following Nixpkgs directory: |
[https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/video/mpv/scripts {{ic|pkgs/applications/video/mpv/scripts}}] | [https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/video/mpv/scripts {{ic|pkgs/applications/video/mpv/scripts}}] | ||
Line 26: | Line 26: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
{ | { | ||
− | + | nixpkgs.overlays = [ | |
− | + | (self: super: { | |
− | + | mpv = super.mpv.override { | |
− | } | + | scripts = [ self.mpvScripts.mpris ]; |
− | + | }; | |
+ | }) | ||
+ | ]; | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | <h2>Error, unknown format</h2> | ||
+ | |||
+ | If you get the following sort of error, note that mpv currently uses the small ffmpeg version (ffmpeg_5) instead of the full version (ffmpeg_5-full). | ||
+ | |||
+ | <syntaxhighlight lang="shell"> | ||
+ | $ mpv --log-file=foo.log av://v4l2:/dev/video5 | ||
+ | [lavf] Unknown lavf format v4l2 | ||
+ | Failed to recognize file format. | ||
+ | |||
+ | Exiting... (Errors when loading file) | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | To address this problem, you can use the following overlay in your <code>nixpkgs.overlays</code>: | ||
+ | |||
+ | <syntaxhighlight lang="nix"> | ||
+ | nixpkgs.overlays = with pkgs; [ | ||
+ | (self: super: { | ||
+ | mpv-unwrapped = super.mpv-unwrapped.override { | ||
+ | ffmpeg_5 = ffmpeg_5-full; | ||
+ | }; | ||
+ | }) | ||
+ | ]; | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | [[Category:Applications]] |
Latest revision as of 10:59, 6 April 2024
There are 2 packages that provide an mpv
executable:
mpv
mpv-unwrapped
mpv
is a wrapper for the mpv
binary which adds --script=
arguments according to the scripts the wrapper was built with.
If you'd like to add scripts to your mpv
wrapper, you'll need to create an overlay in ~/.config/nixpkgs/config.nix
or /etc/nixos/configuration.nix
(if you are using NixOS):
nixpkgs.overlays = [
(self: super: {
mpv = super.mpv.override {
scripts = [ self.mpvScripts.<your choice> ];
};
})
];
All of the scripts for MPV can be found under the mpvScripts
attribute. You can search for them by running nix search mpvScripts
. The scripts are defined in the following Nixpkgs directory:
pkgs/applications/video/mpv/scripts
So for example, for adding the MPRIS MPV script, use the following in your ~/.config/nixpkgs/config.nix
:
{
nixpkgs.overlays = [
(self: super: {
mpv = super.mpv.override {
scripts = [ self.mpvScripts.mpris ];
};
})
];
}
Error, unknown format
If you get the following sort of error, note that mpv currently uses the small ffmpeg version (ffmpeg_5) instead of the full version (ffmpeg_5-full).
$ mpv --log-file=foo.log av://v4l2:/dev/video5
[lavf] Unknown lavf format v4l2
Failed to recognize file format.
Exiting... (Errors when loading file)
To address this problem, you can use the following overlay in your nixpkgs.overlays
:
nixpkgs.overlays = with pkgs; [
(self: super: {
mpv-unwrapped = super.mpv-unwrapped.override {
ffmpeg_5 = ffmpeg_5-full;
};
})
];