Setting mpv as default Tracker video player

Before I open a bug report for this, if it is a bug, I thought I’d check on here that I’m doing this the right way first.

I want to use mpv as my default video player under Haiku. Currently, when I click on a mp4 file it gets played with MediaPlayer.

What tried doing:

Right click .mp4 file → Add-ons → FileType

Now in the File type box I have video/mp4 which looks correct to me so next I click on Select in the Preferred application pane, I select the Haiku disk from the file selector drop down menu → System → bin → mpv then click on Open and I get the error:

Could not retrieve application signature

Is it not possible to use mpv as the default Tracker video player? I installed mpv from the HaikuDepot. mpv works fine when run from the terminal.

hrev56976 amd64

This is because mpv doesn’t have an app signature. If feel that it’s a bug open an issue at Haikuports tracker. IMHO, in this regard, mpv suffers from same problem than it’s ancestor mplayer. They are both powerful tools but without a proper configuration file, they are needing options on command line. That’s why they are most of time used with front-ends and therefore no app signature was added. You will find some of these (like SMplayer or QMPlay2) in HaikuDepot.

1 Like

Thanks Starcrasher!

I have opened a haikuports ticket for this:

There is a nice video player named Haruna, that uses mpv as backend. It’s a KDE application, so should be fairly easy to port.

1 Like

Under Linux I just use mpv under MATE (caja), GNOME (nautilus/ Files) etc without a GUI. I don’t have any need for a GUI for mpv and I doubt any GUI would let me configure it how I want it anyway, I just copy my mpv config file into place and I’m done.

Gave this one a try (while also updating mpv to version 0.35.1).

Sadly, there seems to be a longstanding issue with Haiku not handling this situation correctly, where the system fails to properly pass the arguments to “non be apps” with B_ARGV_ONLY set (https://dev.haiku-os.org/ticket/11893).

Making mpv work with Open with will either require patching mpv (beyond my skills or even will), or fixing that mentioned ticket. (the latter would be preferable, of course, to avoid having to patch individual apps in the future).

In short… no luck for now :frowning:

1 Like

that flag isn’t ment for gui apps.

mpv already uses sdl2, so assuming they properly support it just not using that flag and adding an app signature should work just fine.

1 Like

Tried removing B_ARGV_ONLY: same result (just a spike of CPU usage when mpv gets called, and immediately exits (same with open application/x-vnd.mpv.io-mpv /boot/home/test.mp4). :frowning:


EDIT:

For those wondering why (like me :smiley:), I’ll quote @nephele’s comment on that #11893 ticket:

1 Like

try adding idle=once to your mpv config

1 Like

Still nothing when using “Open with” (using open the only difference with that setting is that mpv doesn’t outputs the usage help text).

1 Like

The app should not exit anymore if you use that option, does it stay open waiting for a file? that is what i’d expect.

1 Like

Ah, yes… now I notice I had three “zombie” mpv threads. It indeed keeps open, but can’t see how you’re supposed to interact with it (no mpv window/prompt to interact with).

1 Like

That sounds wierd.
Can you also add

terminal=no
force-window=yes

and then see if it stays open with a window?

edit: and if it does can you drag and drop a file in?

1 Like

With those settings, an empty (black) mpv window remains open with both Tracker’s “Open with” and by using open.

Drag-and-dropping doesn’t works. By using open we at least get why:

BHandler w>No file - mpv: MessageReceived() couldn't understand the message:
BMessage('DATA') {
        src_window = (type = 'PNTR')(size = 8)
        click_pt = BPoint(x:165, y:128)
        TrackerViewToken = (type = 'MSNG')(size = 24)
        refs = entry_ref(device=3, directory=1573056, name="test.mp4", path="/boot/home/test.mp4")
        buttons = int32(0x1 or 1)
        _drop_point_ = BPoint(x:867, y:433)
        _drop_offset_ = BPoint(x:158, y:7)
}

1 Like

Have you had a chance to look into this error yet @nephele ?

I’m honestly not sure what triggers this, I’ve tried to implement the drag and drop support in mpv bit the error remained, so not sure where to check.

1 Like

Thanks!

Do we have a ticket open for this? Is it a probem with BHandler?

A ticket? no, it’s a problem with a ported app. I’ve no idea if it is related to BHandler

I realise mpv isn’t a part of Haiku but mpv works fine from the Haiku terminal but not via Tracker so I’d say this sounds like a bug in Tracker or Haiku somewhere because using mpv like this works on every Linux/BSD distro and desktop that I’ve tried.

No, it’s definetely a problem with the port of mpv, not with Haiku.