Jump to content


Photo

FreeNAS iocage plugin Emby 3.5.3.0 ffmpeg SOLUTION

ffmpeg

  • Please log in to reply
50 replies to this topic

#21 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 128939 posts
  • Local time: 11:03 AM

Posted 06 January 2019 - 12:09 PM

Correct, with the new release coming so soon we've just been focusing on that. It should only be a matter of days away now.



#22 draino OFFLINE  

draino

    Newbie

  • Members
  • 1 posts
  • Local time: 07:03 AM

Posted 09 January 2019 - 02:41 PM

With the recent move by FreeNAS to 11.2, and the corresponding move from warden to iocage, I had been putting off my FreeNAS upgrade as all my plugins were still working. I finally made the jump to 11.2rc2, and had to rebuild my plugins that use the iocage backend. The install via plugin of Emby 3.5.3.0 worked without issue using the new UI. After adding the video libraries and re-scanning, everything seemed normal. Playback worked on ios clients without incident, but other clients had playback issues with ffmpeg errors in the logs. After searching several threads I found a solution. Here is a step-by-step of the fix for those experiencing this issue. Go easy, it's my first attempt. Also, thanks to all you gurus who helped me along the way with posts like this.

 

This assumes you have:     FreeNAS 11.2rc2

                                           Emby installed via plugin using iocage

                                           Playback issues, with ffmpeg as the prime suspect

 

1. Enter the shell of your Emby jail, either via the GUI jail shell, or using SSH

 

If using SSH, from the freenas root prompt type "jls" to get a list of your jails, followed by "jexec #" where # is the emby jail number

 

2. You should now be at the root prompt of your Emby iocage jail.

 

Now enter "portsnap fetch extract"

This will take some time

 

3. Once the process completes, you should be back to the root prompt of the emby jail.

 

type "cd /usr/ports/multimedia/ffmpeg"

type "make install clean"

When prompted, make sure to check lame, opus, and x265 (libass was not listed for me, but check it if it's there)

This process will take some time as well, and you'll have to press enter a bunch of times, just leave everything else as default

If everything worked correctly, you should be back at the root prompt of the emby jail

 

4. Now we need to edit the emby startup script to use the new ffmpeg we just compiled

 

type "vi /usr/local/etc/rc.d/emby-server"

There are 5 lines that we need to edit (example of mine, make the changes to match the red text)

 

 


[ -z "${emby_server_user}" ] && emby_server_user=emby
[ -z "${emby_server_group}" ] && emby_server_group=emby
[ -z "${emby_server_data_dir}" ] && emby_server_data_dir=/var/db/emby-server
[ -z "${emby_server_ffmpeg}" ] && emby_server_ffmpeg=/usr/local/bin/ffmpeg
[ -z "${emby_server_ffprobe}" ] && emby_server_ffprobe=/usr/local/bin/ffprobe

: ${emby_server_enable:="no"}
: ${emby_server_user:="emby"}
: ${emby_server_group:="emby"}
: ${emby_server_data_dir:="/var/db/emby-server"}
: ${emby_server_ffmpeg:="/usr/local/bin/ffmpeg"}
: ${emby_server_ffprobe:="/usr/local/bin/ffprobe"}

export LD_LIBRARY_PATH=/usr/local/lib
 

5. Save the file, return to the FreeNAS GUI and restart the emby server plugin. Playback issues should now be resolved.

The above fix worked for me. I'm adding some info below in case it helps someone. I see 3.6 is almost  out so not looking to fix 3.5.3.

 

The error I was getting before I followed gbarone123's steps above was:

"Shared object "libx264.so.152" not found, required by "libavcodec.so.58""

 

I looked in the  /usr/local/lib/emby-server/lib folder and didn't see a libx264. 

when executing the binaries in /usr/local/lib/emby-server/bin/[ffmpeg, ffprobe] they both ran without error, but would fail when running the full command emby-server was sending it:

(/usr/local/lib/emby-server/bin/ffmpeg -i file:"/media/MediaBrowser/music/Pink Floyd - Time.mp3" -threads 0 -vn -ab 384000 -ac 6 -id3v2_version 3 -write_id3v1 1 -y "/var/db/emby-server/transcoding-temp/ff19a3ed8f3d082964d1a77130cfc8e9.aac"}

 

Side note: I did have one folder with incorrect permissions that was causing a separate issue, so look at your logs (Logs side bar <emby-server-url:8096/web/index.html#!/log.html )

 

Thanks everyone



#23 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 128939 posts
  • Local time: 11:03 AM

Posted 09 January 2019 - 11:34 PM

Thanks for the info !



#24 gbarone123 OFFLINE  

gbarone123

    Advanced Member

  • Members
  • 33 posts
  • Local time: 10:03 AM

Posted 10 January 2019 - 11:17 AM

Draino,

 

Now that you have a working instance of emby server (I assume 3.5.3.0 since it's the plugin), I recommend you run the following commands from the root shell of your emby jail:

 

pkg install libraw

 

pkg add -f https://github.com/MediaBrowser/Emby.Releases/releases/download/X.X.X.X/emby-server-freebsd_X.X.X.X_amd64.txz
(change the X's to whatever version you want from the github page, latest current for FreeNAS is 4.0.0.0 at the time of this post)

 

service emby-server restart

(I tend to use the FreeNAS GUI and restart the plugin that way, but either should work)

 

I'm currently running 3.6.0.79 and it's been very stable. I had some crash issues with .76, was thinking of upgrading to .84 but held off. Version 4.0.0.0 seems to have been posted since last night and this morning. Haven't read all the release notes yet.



#25 gbarone123 OFFLINE  

gbarone123

    Advanced Member

  • Members
  • 33 posts
  • Local time: 10:03 AM

Posted 10 January 2019 - 11:38 AM

Also recommend you read this before you make the jump to 4.0.0.0, some major changes there.

 

https://emby.media/c...-before-stable/



#26 rsvp OFFLINE  

rsvp

    Member

  • Members
  • 19 posts
  • Local time: 04:03 AM

Posted 13 January 2019 - 09:12 PM

Well these last tips got Emby finally working on XBOX and android. Unfortunately broke all my kodi devices i use for TV. The hours spent on this , or months now has made me realize emby on freenas platform is not working for me.. I need to stop hosting on freenas.  Seems this is where all the issues have started. First with waiting for Freenas 11.2 to rollout and not be broken just to put emby in there that is broken.  . Add up the months its sizable time comittement with little success..  I am  giving up on freenas before I give up on emby.



#27 makarai OFFLINE  

makarai

    Advanced Member

  • Members
  • 485 posts
  • Local time: 05:03 PM

Posted 14 January 2019 - 04:15 AM

Well these last tips got Emby finally working on XBOX and android. Unfortunately broke all my kodi devices i use for TV. The hours spent on this , or months now has made me realize emby on freenas platform is not working for me.. I need to stop hosting on freenas.  Seems this is where all the issues have started. First with waiting for Freenas 11.2 to rollout and not be broken just to put emby in there that is broken.  . Add up the months its sizable time comittement with little success..  I am  giving up on freenas before I give up on emby.

 

Have you installed the kodi addon for emby, in emby Attached File  Capture.JPG   17.39KB   2 downloads ? without it it wont work.

 

I am running freenas with emby in a native jail, with all the clients and casting devices possible behind a reverse proxy, and it works like a charm!


Edited by makarai, 14 January 2019 - 04:17 AM.


#28 gbarone123 OFFLINE  

gbarone123

    Advanced Member

  • Members
  • 33 posts
  • Local time: 10:03 AM

Posted 14 January 2019 - 08:17 AM

RSVP, what are your issues with freenas? I’ve been hosting Emby for well over a year now without issue on freenas. There were very few issues along the way. I wrote this thread after solving the only playback issues I have had. I was running Plex and Emby in tandem for the first few months, and stayed with Emby, dumping Plex. If you detail your specific issues, I can probably help you solve them. My freenas box is pretty much set it and forget it.

#29 rsvp OFFLINE  

rsvp

    Member

  • Members
  • 19 posts
  • Local time: 04:03 AM

Posted 14 January 2019 - 12:52 PM

Well old version of freenas didn't update the plugin.  And all Apps stopped working.  Freenas updated to 11.2.. All apps didnt work with the IOCAGE plugin.  With this beta version.. Having problems with always asking to sign in the app in kodi. And it has problems refreshing when library gets new items. So all in all I would say its been close to a year of problems.



#30 rsvp OFFLINE  

rsvp

    Member

  • Members
  • 19 posts
  • Local time: 04:03 AM

Posted 14 January 2019 - 12:53 PM

Yes I have kodi companion.. I even went to v18. that had problems went back to 17 and it worked ok.  



#31 gbarone123 OFFLINE  

gbarone123

    Advanced Member

  • Members
  • 33 posts
  • Local time: 10:03 AM

Posted 14 January 2019 - 11:44 PM

Rsvp,

A few questions. What plugins are you running? What kind of hardware are you running on? Did you make any changes to the base os?

#32 stuartsjg OFFLINE  

stuartsjg

    Advanced Member

  • Members
  • 50 posts
  • Local time: 03:03 PM

Posted 21 February 2019 - 07:32 PM

Hello, I used this post and successfully updated.  However, i still had issues with ffmpeg and i spotted this thread which shown promise.

 

However the process failed at the "make install clean" which i felt was due to being on freenas 11.1 not 11.2.  I upgraded to 11.2-U2 but now emby wont load at the IP address.  Ive tried to install a new emby 3.5.3.0 via the plugin GUI  i get this error:

 

5c6f340dde04c_Embyfail.png

 

 

If i try the above instructions, the portsnap fails:

[root@[member="freenas"] ~]# jls
   JID  IP Address      Hostname                      Path
     2                  emby-server                   /mnt/iocage/jails/emby-server/root
[root@[member="freenas"] ~]# jexec 2
# portsnap fetch extract
Looking up portsnap.FreeBSD.org mirrors... none found.
Fetching snapshot tag from portsnap.FreeBSD.org... failed.
No mirrors remaining, giving up.
#

I tried a fresh CLI install based upon the emby home page instructions, however when i run

sudo pkg install mono libass fontconfig freetype2 fribidi gnutls iconv opus samba48 sqlite3 libtheora libva libvorbis webp libx264 libzvbi libraw

i get the message coming back

Sorry, user root is not allowed to execute '/usr/sbin/pkg install mono libass fontconfig freetype2 fribidi gnutls iconv opus samba48 sqlite3 libtheora libva libvorbis webp libx264 libzvbi libraw' as root on freenas.stuartjgraham.com.
[root@freenas ~]# sudo pkg install mono libass fontconfig freetype2 fribidi gnutls iconv opus samba48 sqlite3 libtheora libva libvorbis webp libx264 libzvbi libraw

So perhaps my permissions are mucked up somewhere and thats stopping things from working.

 

I only get a few hours a month to work on this due to work and family commitments and i wish i had never upgraded as it was such a simple thing back in October.... :(


Edited by stuartsjg, 21 February 2019 - 07:38 PM.


#33 gbarone123 OFFLINE  

gbarone123

    Advanced Member

  • Members
  • 33 posts
  • Local time: 10:03 AM

Posted 21 February 2019 - 10:28 PM

Stuart,

There are some issues being ironed out with 11.2u2 with iocage jails, apparently. That being said, seems like you have the jail networking issues worked out. Other threads have pointed out that unchecking and re-checking the auto button on DHCP for the jails somehow allows it to function again properly. Also, there were autostart on boot issues for iocage jails in u2.

As for the permission issues, are you using ssh or the GUI? I’d recommend trying the GUI shell instead of ssh. There are also threads you could read about editing the sudoers file. Not sure why root would not be elevated privileges already, but u2 seems to have some bugs. Worth a read through of the threads. For starters though, try the GUI shell.

#34 gbarone123 OFFLINE  

gbarone123

    Advanced Member

  • Members
  • 33 posts
  • Local time: 10:03 AM

Posted 21 February 2019 - 10:36 PM

Stuart,

Having read the code lines more carefully, it looks like you are running the install command from the base OS?? Root@freenas???

Big no no. Create a new jail and run the commands inside the jail.

#35 stuartsjg OFFLINE  

stuartsjg

    Advanced Member

  • Members
  • 50 posts
  • Local time: 03:03 PM

Posted 22 February 2019 - 08:25 PM

Hi,

 

Yes - thanks, after some mucking about with the IP address settings i was able to access emby.  Theres a good amount on the bug at this freenas post.

 

I am not clear what you mean by running commands inside the jail, this doesnt work either as in either the existing emby (plugin installed) jail i get a "sudo: command not found" and likewise if i create a new jail from scratch and run the sudo command first.

 

This is where i thought it had to be ran from outside the jail so looked about and found if i run without "sudo" (suggested here) i.e. just "pkg install mono libass fontconfig freetype2 fribidi gnutls iconv opus samba48 sqlite3 libtheora libva libvorbis webp libx264 libzvbi libraw"

 

Then i get mismatches (package 1102000, kernel 1101001 (i say Y) and things then appear to go well.

 

I reboot emby and still no resolution to playback issues.  But now the steps above appear to work and i dont get errors after portsnap fetch extract.

 

Things then go wrong when i follow the ffmpeg steps:

# cd /usr/ports/multimedia/ffmpeg
# make install clean
===> Building/installing dialog4ports as it is required for the config dialog
===>  Cleaning for dialog4ports-0.1.6
===> Skipping 'config' as NO_DIALOG is defined
/!\ ERROR: /!\

Ports Collection support for your FreeBSD version has ended, and no ports are
guaranteed to build on this system. Please upgrade to a supported release.

No support will be provided if you silence this message by defining
ALLOW_UNSUPPORTED_SYSTEM.

*** Error code 1

Stop.
make[3]: stopped in /usr/ports/ports-mgmt/dialog4ports
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/ports-mgmt/dialog4ports
===> Options unchanged
/!\ ERROR: /!\

Ports Collection support for your FreeBSD version has ended, and no ports are
guaranteed to build on this system. Please upgrade to a supported release.

No support will be provided if you silence this message by defining
ALLOW_UNSUPPORTED_SYSTEM.

*** Error code 1

Stop.
make[1]: stopped in /usr/ports/multimedia/ffmpeg
*** Error code 1

Stop.
make: stopped in /usr/ports/multimedia/ffmpeg
#
/usr/ports/x11-toolkits/fltk-devel/

looks like i need to find a different version?


Edited by stuartsjg, 22 February 2019 - 08:25 PM.


#36 stuartsjg OFFLINE  

stuartsjg

    Advanced Member

  • Members
  • 50 posts
  • Local time: 03:03 PM

Posted 22 February 2019 - 08:48 PM

For reference, i rebooted freenas in 11.1 RC1 boot environment and got the same error when i tried 

 

I did notice i was not on 11.2 RC2 as the post above suggests but a newer version.  Will try with RC2.



#37 gbarone123 OFFLINE  

gbarone123

    Advanced Member

  • Members
  • 33 posts
  • Local time: 10:03 AM

Posted 22 February 2019 - 09:01 PM

Stuart,

 

Ok, let's start from scratch. Delete the plugin jail you created and create a new iocage jail via the GUI. Once you have done so, mount your storage (folder where your media is located) to the /media folder of the jail. I can give detailed instructions if you aren't sure how to do this. Note, you'll have to stop the jail to add the storage, then restart it before going on. Then go into the shell of the jail.

 

From within the shell of the jail run the following commands. Also, forget sudo, you are root. No need, and unless you've installed sudo and edited the config file, not sure it would work anyway, which is why you keep getting command not found errors.

 

pkg install mono libass fontconfig freetype2 fribidi gnutls iconv opus samba48 sqlite3 libtheora libva libvorbis webp libx264 libzvbi libraw

 

 

sysrc emby_server_enable="YES"
service emby-server start
 
That should do it. Also, I would stick with 11.2u1 for now. There are some bugs with u2 and u3 will be out next month (3 weeks I've read).


#38 stuartsjg OFFLINE  

stuartsjg

    Advanced Member

  • Members
  • 50 posts
  • Local time: 03:03 PM

Posted 24 February 2019 - 12:18 PM

Hello

 

I changed version to 11.2u1 (that was an interesting experience but i got there).  Installed emby OK using the method you describe but then i do a rsync to copy the server data over and then i only get this site cant be reached, but i can ping.

 

(my rsync is "rsync -vrlpogth /mnt/iocage/jails/emby-server/root/var/db/emby-server/ /mnt/iocage/jails/emby-mediaserver/root/var/db/emby/" )

 

"emby-server" jail is 4.1.0.8 but with the playback issues.  "emby-mediaserver" is the install per your method which did work, then didnt after the sync.

 

So, the routes are either fix the playback issues, or find a way to import the data without killing the new install.  I done that before but cannot replicate it.

 

Again i tried the proposed fix above, but the "make install clean" fails with the "ports collection support for your FreeBSD version has endee" message - i had wondered if this may work with u1 where it didnt on rc1



#39 gbarone123 OFFLINE  

gbarone123

    Advanced Member

  • Members
  • 33 posts
  • Local time: 10:03 AM

Posted 24 February 2019 - 02:16 PM

The new version of Emby (beyond 3.5.3.0) comes packaged with a working version of ffmpeg. This fix was a short term in response to version control issues between Emby and freenas and which release was being used.

At this point, you may be able to try installing via plugin, then from the Emby jail run “pkg install libraw” and then run the upgrade command “pkg add -f...” from previous response, then restart the jail. This would get you to the newest version with the appropriate ffmpeg. I can test this later to be sure (I’m on u1 currently). Haven’t tried doing the plugin since RC2.

#40 gbarone123 OFFLINE  

gbarone123

    Advanced Member

  • Members
  • 33 posts
  • Local time: 10:03 AM

Posted 24 February 2019 - 02:20 PM

Also, what exactly are you trying to copy over with rsync? Is it users? You should just add the libraries again and after a scan, you should be back to normal. As long as you don’t have a ton of users, I’d recommend just re-creating their accounts once you have everything up and running.





Also tagged with one or more of these keywords: ffmpeg

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users