# Need help installing handbrake via pkg or ports



## BSDPeta (Nov 23, 2018)

Hello,

first of all - I have only very rudimentary Linux/Unix knowledge and already helped me with some tutorials via web search. After already be a user of OPNsense and XigmaNAS, I installed FreeBSD and added Xorg/Gnome3 running on an ESXi VM to learn more about the common basis FreeBSD…



I have a problem with installing handbrake, both over ports and per pkg. No matter if I install handbrake 

via ports `# usr/ports/multimedia/handbrake/make install clean`

or via pkg with `# pkg install handbrake`

the installation including 6-8 (?) dependencies will be installed, but handbrake cannot be started under Gnome3. Handbrake also does not have the "typical" program icon.

According to freshports.org and FreeBSD Ports Search, handbrake has many dependencies. Why aren't these installed automatically as I described above? Do I have to install them all manually? Where is my fault? 

Cheers…


----------



## Sevendogsbsd (Nov 23, 2018)

The multimedia/handbrake executable is not named "handbrake", if that is what the issue is. The executable is named `ghb` and is located /usr/local/bin/ghb. That threw me off as well. I can't speak to your icon issue because I use a tiling WM and icons are irrelevant to my use case. 

In all likelihood, the application is installed.


----------



## Maccraft123 (Nov 23, 2018)

About depedencies you probably looked into build depends,
which are always more that run depends.


----------



## Deleted member 30996 (Nov 23, 2018)

BSDPeta said:


> I have a problem with installing handbrake, both over ports and per pkg. No matter if I install handbrake
> 
> via ports `# usr/ports/multimedia/handbrake/make install clean`



You didn't install multimedia/handbrake with that command. It's:

`# cd /usr/ports/multimedia/handbrake && make install clean`

I'm looking at the dependencies that would be installed/updated if I were to do so on one of my boxen. There are 11. That's not to mention handbrake is and has been marked as vulnerable for a long time, or mixing ports and packages is bad voodoo for you as a new user.


----------



## Maccraft123 (Nov 23, 2018)

Probably a typo about installation


----------



## ShelLuser (Nov 23, 2018)

BSDPeta said:


> I have a problem with installing handbrake, both over ports and per pkg. No matter if I install handbrake
> 
> via ports `# usr/ports/multimedia/handbrake/make install clean`
> 
> or via pkg with `# pkg install handbrake`


Don't mix ports and packages, if one method doesn't work then don't "just" try the other because that will cause some serious issues in the longer run. Instead try to actually fix the problem at hand.



BSDPeta said:


> the installation including 6-8 (?) dependencies will be installed, but handbrake cannot be started under Gnome3. Handbrake also does not have the "typical" program icon.


"_cannot be started_" doesn't tell us anything. How are you trying to start it?

Anyway, about those dependencies:


```
root@psi:/ # pkg search -d handbrake | wc -l
      34
```



BSDPeta said:


> According to freshports.org and FreeBSD Ports Search, handbrake has many dependencies. Why aren't these installed automatically as I described above?


Probably because most were already installed.

Alas: `pkg info -lx handbrake | less`, check for executables (usually in /usr/local/bin) and then try to start those from a console. Better yet: look for documentation and read up on that first.


----------



## Crivens (Nov 23, 2018)

Try "HandBrake", yes, with CamelCase. For some reason this is what I got when I installed it.


----------



## Sevendogsbsd (Nov 23, 2018)

I sit corrected - thanks Crivens, it's /usr/local/bin/HandBrake. FYI `ghb` also runs handbrake as well for whatever reason.


----------



## BSDPeta (Nov 23, 2018)

An advantage of virtualization - snapshot back to a clean initial situation... 

I reinstalled handbrake with `# pkg install handbrake`. What I meant by the "funny program icon" I attached as a screenshot - this is what I find in the Gnome "activity launchpad". Clicking on this icon does not have any result. Nothing happens… (And yes - it is *H*and*B*rake!)

The folder `/usr/local/bin/` actually contains HandBrake and HandBrakeCLI as well.

Execute handbrake via terminal shows the following error message:

`root@FreeBSD-VM:~ # /usr/local/bin/HandBrake
Shared object "libmp3lame.so.0" not found, required by "HandBrake"`

So it seems to be due to a lack of dependencies. But why isn't it installed with pkg?


----------



## BSDPeta (Nov 23, 2018)

I think I found the solution by "DuckDuckGo web searching" the error message.

I first installed `# pkg install vlc` (I'm not sure if really neccessary) and after that `# cd /usr/ports/multimedia/lame && make install clean`

That did the trick! HandBrake can be started directly from Gnome3 by double clicks and and as if that weren't enough already the icon became as expected. 

But - what about mixing ports and pkg?


----------



## Phishfry (Nov 23, 2018)

The problem is with audio/lame.
Problem is that it is a restricted software and official package binaries cannot be built for it. (legally)


> *PKGNAME:* there is no package for this port: _LICENSE_RESTRICTED



So some packages like handbrake are expecting to find lame but a package does not exist.
Mixing ports and packages will get you in a world of pain.
Lame has not changed any in recent history so no problem. No newer lame to update.

So the way I handled this on a fresh install with no lame package available was to build _just_ lame from ports.
It only has one dependency so this should not be too troublesome. The only dependency: converters/libiconv 

This advice could cause you troubles down the road. Mixing ports and packages is bad.
Something like multimedia/handbrake has alot of dependencies and that is the main point of contention.
Not a good situation but usable. No need to lock your newly created lame package as there is nothing upstream.

The ideal method is to use only ports for everything.. So if you see errors after updating concerning libiconv.so.* you now know where to turn. If you did a bunch of mixing this could become disastrous. One very small restricted package I took the risk.

Here is some background on the lame restriction:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223974


----------



## BSDPeta (Nov 24, 2018)

Phishfry said:


> The problem is with audio/lame.
> Problem is that it is a restricted software and official package binaries cannot be built for it. (legally)



That's also what I could basically find in my web search.

So far I installed everything via pkg because it is much faster. My FreeBSD VM is more of a test environment to familiarize myself with the system. Which works now... 

I will continue to use pkg and use ports for my next installation.

Thanks so long for your help!


----------



## Sevendogsbsd (Nov 24, 2018)

The only downside to using ports is the compile time, but only for large packages like editors/libreoffice, www/firefox, www/chromium, or the various webkit ports. Compilers such as the "llvm*" ports can take a while as well. This is all dependent on your computing power and you can always start updates before you head to sleep so they run at night.

Phishfry gives good advice - I exclusively use ports and have not had any dependency issues.


----------



## Deleted member 30996 (Nov 24, 2018)

I have wanted to install multimedia/handbrake for a while to do some video editing and ran ports-mgmt/portmaster like I was going to yesterday. That updated/installed the dependencies it wanted even though I knew it would stop at Handbrake since it was vulnerable. 

Today I'll build it by itself with the right flag to disable vulnerabilities and say in advance with all confidence it will go without a hitch.


----------

