SOLVED How to install Handbrake Step by step on FreeNAS 11

fahadshery

Contributor
Joined
Sep 29, 2017
Messages
179
Hello Smarty pants!

I successfully built my first ever FreeNAS box (https://uk.pcpartpicker.com/b/NbpG3C)
I have just one jail running Plex Media Server.
As the built has a good processor, I want to install Handbrake to re-encode my media (Family holidays vids etc.) to reduce size!
But i have no clue as to how to install it?

I have looked here and here and here...they say create a jail and go inside and run commands which I don't know how to do.
Any step by step instructions for a beginner will be highly appreciated.

Regards,
 
Last edited by a moderator:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Any step by step instructions for a beginner will be highly appreciated.
You've just linked to some pretty complete instructions. What part of them did you not understand?
 

fahadshery

Contributor
Joined
Sep 29, 2017
Messages
179
@danb35 thank you for your msg...this is what I did but HandbrakeCLI still showing unknown command.

  1. Create a New dataset called "encode" under the main "Media" Dataset so the full path looks like mnt/raid2TB/Media/encode
  2. changed the permissions on encode to allow guest access
  3. The Media folder already has been shared using Windows SMB with guest access
  4. Now add a new jail handbrake_encoding
  5. Assign storage to this jail where source is my all media files i.e. mnt/raid2TB/Media (this folder has 3 folders Movies, Family Vids, TV Shows and the destination is the new dataset mnt/raid2TB/Media/encode
  6. open the shell by selecting the handbrake_encoding and clicking the Shell
  7. Run the following commands
  8. pkg upgrade
  9. pkg install handbrake libass ffmpeg x265 libaacs libbdplus
  10. Use the Ports collection to install lame and libdvdcss:
  11. portsnap fetch extract
  12. cd /usr/ports/audio/lame && make install clean
  13. cd /usr/ports/multimedia/libdvdcss && make install clean
At this stage I should be able to run the handbrakeCLI from the Jail shell by typing HandBrakeCLI at the prompt.. but I get the Unknown command error when I type HandBrakeCLI.

Not sure what am I missing
 
Joined
Apr 9, 2015
Messages
1,258

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
At this stage I should be able to run the handbrakeCLI from the Jail shell by typing HandBrakeCLI at the prompt
Yeah, looks like you should. Do you have a file at /usr/local/bin/HandBrakeCLI? Note that FreeBSD is case-sensitive, so HandBrakeCLI is not the same as handbrakeCLI.
 

fahadshery

Contributor
Joined
Sep 29, 2017
Messages
179
Yeah, looks like you should. Do you have a file at /usr/local/bin/HandBrakeCLI? Note that FreeBSD is case-sensitive, so HandBrakeCLI is not the same as handbrakeCLI.

you were right... it's HandBrakeCLI
 

Grinas

Contributor
Joined
May 4, 2017
Messages
174
You can use the GUI version by accessing the jail via Xterm.

Thanks for the tutorial.
 

CFC

Cadet
Joined
Aug 15, 2020
Messages
2
You can use the GUI version by accessing the jail via Xterm.

Thanks for the tutorial.
I know this is seemingly a simple item, but how does one access the jail via Xterm?

I'm very fresh to FreeNAS and Linux in general.
To this point I've created the jail, built Handbrake following their guide, and I've been able to use the CLI to encode a few test videos. So I know all should be good on that front.
I'd like to use the GUI, but so far I haven't been able to figure that part out.
I appreciate the help.

CFC
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
ssh -X into your jail, then start any X11 application.
 

CFC

Cadet
Joined
Aug 15, 2020
Messages
2
ssh -X into your jail, then start any X11 application.
Ok. Thanks!
This gave me the hint necessary to push through, do some forum and web searches to get it working.

I'm not sure if the steps I took were optimal, but this is what I did:
  1. Allowed root SSH in the handbrake jail by editing its sshd_config and rc.conf files
  2. Set a root password in the jail (passwd root)
  3. Configured a putty SSH session to the jail IP which forwards X11
  4. Installed Xming on my Windows PC
  5. SSH into the handbrake jail and type the command "ghb" to get the GUI to pop up
In putty I get this as an error message, though the GUI seems to be working just fine. Did a few test encodes, and all seems correct:
Code:
MESA-LOADER: failed to open swrast (search paths /usr/local/lib/dri)
libGL error: failed to load driver: swrast
(ghb:70277): IBUS-WARNING **: 16:09:29.061: Unable to load /var/lib/dbus/machine-id: Failed to open file ?/var/lib/dbus/machine-id?: No such file or directory
fstab: /etc/fstab:0: No such file or directory

HandbrakeGUI.png


Is there anything else I should modify or update? Should I make some changes to eliminate the error messages?
I really appreciate the help. I feel pretty accomplished after all this.

CFC
 

Grinas

Contributor
Joined
May 4, 2017
Messages
174
@CFC

I dont use windows but on Mac the GUI will open in XQuartz if needed. e.g. running the command HandBrake will open the GUI for HandBrake, running firefox will open a firefox window.

Also the errors you see are normal or at least i see them too and have never had any issues. I never looked into how to resolve them.

P.S thanks for the steps I'm sure others will benefit from them.
 

Palle34

Cadet
Joined
Jan 16, 2021
Messages
2
"
  1. Allowed root SSH in the handbrake jail by editing its sshd_config and rc.conf files
  2. Set a root password in the jail (passwd root)
  3. Configured a putty SSH session to the jail IP which forwards X11
  4. Installed Xming on my Windows PC
  5. SSH into the handbrake jail and type the command "ghb" to get the GUI to pop up
"


Can someone please explain to me what exactly I have to do to make it work.

P.S. Sorry for my bad English
 
Top