official MakeMKV port multimedia/makemkv

zirias@

Developer
MakeMKV has been on the WantedPorts list for a very long time. I see there's some attempt linked which hasn't seen a commit for 7 years. That one just builds the GUI, which is IMHO the wrong approach, because the GUI can't do anything without the closed source binary.

Starting from my own HOWTO, which I had to update and make it more and more complex, I created my own port. This one doesn't support GUI at all, because I can't get the closed source binary ( makemkvcon) to work correctly in the "guiserver" mode on FreeBSD, which is needed for the GUI. But console-only usage is still better than nothing ...

Now it might be worthwile to improve that port so it could be adopted in the official ports tree? So, I'm looking for review/input here.

Some issues I already think about are:
  • libmakemkv.so must be built for Linux, so makemkvcon can use it, and depends on libavcodec. I'm not aware of any linux-c6 or linux-c7 port providing this, so my current solution is to build fdk-aac and ffmpeg in the "pre-configure" target and install static libraries in a temporary directory, these are later used to build libmakemkv.so. Do you think this is a good approach? An alternative would be to create separate "linux-fdk-aac" and "linux-ffmpeg" ports that install in /compat/linux, but I don't think that is a good idea, as all the files there should come from repackaged centos packages?
  • In general, the linux-c6 / linux-c7 ports do not provide any headers. Right now, I use the system's headers for zlib and expat together with the libs in /compat/linux while for OpenSSL, I let the port download the exact source version matching the Linux library and use the headers from the source tree when building. Any thoughts on this?
  • The port's PREFIX is ${LOCALBASE}, but it still installs binaries and libs in /opt/makemkv. This allows to clearly separate the makemkv libs and also to provide some fake sysfs entries below /opt/makemkv needed for makemkvcon to find the drive (created by a bundled script). Is this a viable approach?
  • makemkvcon always segfaults after doing its work. Should we provide a wrapper that disables core dumping here?
Please share any thoughts and improvements on the port, thank you!

 
Anyone tried it? Did it work for you? Any comment on the "unusual" building process, do you think this might be acceptable for FreeBSD ports?

BTW, for getting the GUI to work as well, I asked on the MakeMKV forums for help with no luck so far. Looks like noone over there is interested in having their software work on FreeBSD :(
 
There are some minor updates to the port, it now also includes a (very incomplete) manpage for makemkvcon.

Without any suggestions what to improve so far, I decided to submit this current state, so we will see what ports committers think of it :) Of course I'm still open to feedback here.
 
Port has been updated to new upstream version 1.14.4 -- still waiting for feedback on inclusion in the official ports tree.
 
Recent changes in Mk/Uses/linux.mk broke the build. An updated version is available in my repository as well as in the PR trying to get this in the tree (but so far, only concerns were raised about the unusual build, that I don't see a way to address, so it might never end up in the tree unless there's a native FreeBSD version some day...).

I didn't update the port revision as it isn't official anyways.
 
New upstream version 1.14.5 is in my repo.

Also fixed the build with linux-c6 after receiving a report of build failure.
 
  • Thanks
Reactions: a6h
It seems there is no GUI, I could be wrong on that, if so where are the commands for cli? I haven't used MakeMKV without GUI.
 
Is there an easy way to install the not-yet-official port? I'm eager to try your makemkv port but not familiar with poudriere; from the documentation it seems pretty complicated.
 
Just download the port and put everything in a directory. You don't need poudriere to build a port (new or old). See ports(7).
 
UPDATE: makemkv 1.15.0 is now available in my Git repository, and also in the FreeBSD PR

Unfortunately, I expect the port to be finally rejected now. The reason is I now have to build a whole temporary GNU toolchain, just to get a newer libstdc++.so.6 I can bundle in the package, because the version installed by the linux-c7 ports is now too old for makemkv :( Of course, this makes the port huge, slow to build, and fragile. Unless makemkv provides FreeBSD binaries or the Linuxulator ports move to something newer, this is the only way to have makemkv working on FreeBSD.

Is there an easy way to install the not-yet-official port?
Also joplass -- Assuming you have a recent ports tree on your system in the standard location, all you have to do is get the port (e.g. by git cloning my repository at https://github.com/Zirias/zfbsd-ports or by just downloading the files of the port individually to the same directory) and then type make install clean in this directory.

I recommend installing these packages beforehand to avoid building all of them as dependencies:

linux_base-c7
linux-c7-openssl
linux-c7-expat
gcc9
pkgconfig
perl5
nasm
expat
gawk
gsed
patchelf

In order to use makemkv, you need a linux-compatible sg device that's disabled in the GENERIC kernel configuration, so you have to compile your own kernel. This is pretty simple as well. I called my kernel "DESKTOP" and as I'm on amd64, added the following config file as /usr/src/sys/amd64/conf/DESKTOP:
Code:
include GENERIC
ident DESKTOP

device          sg
Then just follow the instructions in the handbook
 
Well, I worked a good 2 days to get this update running with a temporary GNU toolchain -- porting linux-c8 (that's a LOT of ports) would probably take much longer :) But it's sure the way forward to stay compatible with more recent Linux software...
 
And more good news: Finally we have a package, thanks to Mike Chen allowing me to distribute a binary slightly patched for FreeBSD :) Users of the "latest" pkg repository should be able to install it.
There's still no GUI and still the need for building a kernel with "device sg" (this won't change unless there's a native FreeBSD version), but this should be much easier/faster than compiling the port locally :)
 
I got this return. Is there something I shall do prior?

Code:
root@luna:~ # cd /usr/ports/multimedia/makemkv/ && make install clean
/usr/ports/multimedia/makemkv/: No such file or directory.
 
Update your ports tree? Or, if you use packages, just do pkg install makemkv.
But remember, you still need a kernel with "device sg" for it to work.
 
Yes, it means just that. FreeBSD has support for Linux-style "sg" devices, but they aren't in the GENERIC kernel configuration.

For the general procedure, refer to https://www.freebsd.org/doc/handbook/kernelconfig-config.html and https://www.freebsd.org/doc/handbook/kernelconfig-building.html

To include "sg", all you need is a config file like this:
Code:
include GENERIC
ident MYKERNEL

device sg
Use whatever you like instead of MYKERNEL and call the file the same (I personally use DESKTOP for my kernel config including sg).
 
It should be simple indeed, you just need to have the source matching your running system installed, and make sure to read the linked chaptes of the handbook :)

I forgot to mention, if you're using packages, the package is not yet in the quarterly repo, so you have to use "latest". If you're compiling yourself, your ports tree should follow "head".
In the long run, using makemkv with "quarterly" will probably be a bit troublesome as "outdated" versions stop working pretty soon.
 
Hi,

Sorry to wake up an older thread, but I was trying this out. I rebuilt my kernel and ran the update-makemkv-drives with my blu-ray attached (it's an ASUS USB blu-ray drive).

My camcontrol lists it as:
... <ASUS SBW-06D2X-U D501> at scbus6 target 0 lun 0 (pass3,cd0,sg0) ...
The script seemed to find this:
ls -al /compat/linux/etc/makemkv/drivers/sr total 2 drwxr-xr-x 2 root wheel 3 Jul 18 10:26 ./ drwxr-xr-x 3 root wheel 3 Jul 18 10:26 ../ lrwxr-xr-x 1 root wheel 21 Jul 18 10:26 6:0:0:0@ -> ../../devices/6:0:0:0
It never seems to work correctly for me. I put a blu-ray into the drive and then try to run makemkvcon, it can't seem to find anything:
makemkvcon info disc:0 MakeMKV v1.15.1 linux(x64-release) started The program can't find any usable optical drives. Failed to open disc Total 0 titles zsh: segmentation fault makemkvcon info disc:0
Is there something that I am missing? Must this be run as root or is it OK to run it as a regular user?
 
Is there something that I am missing? Must this be run as root or is it OK to run it as a regular user?
It's all looking correct. The segmentation fault can be ignored, it always happens on exit. Whether you need to run it as root should only depend on the permissions of your sg device, e.g. /dev/sg0.

Did you try running as root?
Did you check this drive works with makemkv running on linux (e.g. using a live USB stick?)
 
Thanks for getting back to me, Zirias!

Yes, I tried to run it as root, I get the same result.

I haven't tried the drive on Linux yet, but I'll give it a shot. I have run this previously on MacOS with MakeMKV and it worked fine. It also just attached just fine on FreeBSD, so I thought it might just work. :)

I was wondering simply if maybe it's not disc 0? There seems to be a lot of numbers involved, so I was just wondering if maybe I should try a different argument (e.g. dev?)
 
Back
Top