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

#1 gbarone123 OFFLINE  

gbarone123

    Advanced Member

  • Members
  • 33 posts
  • Local time: 12:52 PM

Posted 19 November 2018 - 01:03 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.


  • Baenwort likes this

#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 124028 posts
  • Local time: 01:52 PM

Posted 19 November 2018 - 01:12 PM

Thanks for the info. I will ask josh4trunks to update the freenas plugin to resolve this.

This workaround will only work for a limited time as we'll be shipping a customized ffmpeg in 3.6.

#3 gbarone123 OFFLINE  

gbarone123

    Advanced Member

  • Members
  • 33 posts
  • Local time: 12:52 PM

Posted 19 November 2018 - 01:17 PM

Luke,

 

I assume that this fix should not affect anything when upgrading to 3.6, as the startup script should be re-created pointing to the correct location for the customized ffmpeg. Is that correct?



#4 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 124028 posts
  • Local time: 01:52 PM

Posted 19 November 2018 - 03:09 PM

Well I haven't tested what you're doing so it's hard to say.

#5 sluggo45 OFFLINE  

sluggo45

    Advanced Member

  • Members
  • 158 posts
  • Local time: 12:52 PM

Posted 20 November 2018 - 10:46 AM

Updates overwrite the startup script, yes. Any update, even for 3.5.


  • Baenwort likes this

#6 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 124028 posts
  • Local time: 01:52 PM

Posted 20 November 2018 - 12:54 PM

Thanks !

#7 dbx10 OFFLINE  

dbx10

    Newbie

  • Members
  • 2 posts
  • Local time: 12:52 PM

Posted 10 December 2018 - 12:53 AM

Very new to FreeNAS / FreeBSD. I tried this workaround but when trying to change the emby startup script in vi, I can't mount as rw. I'm stuck in read only and I have no idea what I'm doing. Am I missing something?



#8 makarai OFFLINE  

makarai

    Advanced Member

  • Members
  • 452 posts
  • Local time: 07:52 PM

Posted 10 December 2018 - 03:09 AM

Very new to FreeNAS / FreeBSD. I tried this workaround but when trying to change the emby startup script in vi, I can't mount as rw. I'm stuck in read only and I have no idea what I'm doing. Am I missing something?

 

Maybe give this a try! Delete all existing jails of emby, and follow one of these step. I recommend the beta installation as i have tested it quite extensively by now. 

You need to open a shell from the side panel in freenas (button shell)

 

FreeNAS

 

Simple Installation

  • Requires FreeNAS 11.2 Stable
  • This Installation method will create a Jail that is fully configurable via the FreeNAS GUI

 

LATEST STABLE

cd /tmp
wget https://raw.githubusercontent.com/MediaBrowser/iocage-amd64/master/emby-server.json
iocage fetch -P dhcp=on vnet=on bpf=yes allow_raw_sockets=1 -n emby-server.json --branch 'master' 

LATEST BETA (76)

cd /tmp
wget https://raw.githubusercontent.com/bott0r/iocage-plugin-emby/beta/emby-server-beta.json
iocage fetch -P dhcp=on vnet=on bpf=yes allow_raw_sockets=1 -n emby-server-beta.json --branch 'beta' 

Edited by makarai, 10 December 2018 - 03:51 AM.

  • rptozati and SuperMinecraftKid like this

#9 Fostersimp OFFLINE  

Fostersimp

    Newbie

  • Members
  • 1 posts
  • Local time: 05:52 PM

Posted 10 December 2018 - 07:51 AM

Hi Makarai,

 

I tested both versions of your installation method Stable  &  Beta.

 

Stable   >   I had the same ffmpeg  issues as every one else has been reporting

Beta      >   No issues

 

 

5c0e52a831fc5_Capture.jpg



#10 makarai OFFLINE  

makarai

    Advanced Member

  • Members
  • 452 posts
  • Local time: 07:52 PM

Posted 10 December 2018 - 12:38 PM

Hi Makarai,

 

I tested both versions of your installation method Stable  &  Beta.

 

Stable   >   I had the same ffmpeg  issues as every one else has been reporting

Beta      >   No issues

 

 

5c0e52a831fc5_Capture.jpg

 

 

Glad it worked for you, i pinged @Luke and mentioned that the stable has an issue, due to the fact that some dependencies are not ok. I think i mentioned that around the time when 3.5.3 came out. Also a reason why recommend the beta to people :P



#11 dbx10 OFFLINE  

dbx10

    Newbie

  • Members
  • 2 posts
  • Local time: 12:52 PM

Posted 11 December 2018 - 02:30 PM

Installing the beta seems to work, but the metadata doesn't work properly. I'll list the issues I currently have in the appropriate section of the forum.

Thanks a lot for the help!



#12 DangerIsGo OFFLINE  

DangerIsGo

    Member

  • Members
  • 14 posts
  • Local time: 12:52 PM

Posted 13 December 2018 - 11:44 AM

I'm trying to make ffmpeg on a fresh iocage jail and i'm getting the following error:

root@emby_2:/usr/ports/multimedia/ffmpeg # make install clean
===>   ffmpeg-4.1_1,1 depends on executable: nasm - found
===>   ffmpeg-4.1_1,1 depends on file: /usr/local/bin/as - not found
===>   binutils-2.30_7,1 depends on file: /usr/local/lib/libgmp.so - found
===>   binutils-2.30_7,1 depends on file: /usr/local/lib/libmpfr.so - not found
===>  Patching for mpfr-4.0.1_2
===>  Applying distribution patches for mpfr-4.0.1_2
1 out of 1 hunks failed--saving rejects to src/mpfr.h.rej
Ignoring previously applied (or reversed) patch.
1 out of 1 hunks ignored--saving rejects to src/sub1sp.c.rej
Ignoring previously applied (or reversed) patch.
4 out of 4 hunks ignored--saving rejects to tests/tsub.c.rej
1 out of 2 hunks failed--saving rejects to tests/tsub1sp.c.rej
*** Error code 1

Stop.
make[5]: stopped in /usr/ports/math/mpfr
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/math/mpfr
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/devel/binutils
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/devel/binutils
*** Error code 1

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

Stop.
make: stopped in /usr/ports/multimedia/ffmpeg

This happened with a previous emby iocage jail so I blew that away and made a new one.  Now I'm getting this.  Any ideas?  OS is:

FreeBSD 11.2-STABLE (FreeNAS.amd64) #0 r325575+fc3d65faae6(freenas/11.2-stable)



#13 makarai OFFLINE  

makarai

    Advanced Member

  • Members
  • 452 posts
  • Local time: 07:52 PM

Posted 13 December 2018 - 12:00 PM

I'm trying to make ffmpeg on a fresh iocage jail and i'm getting the following error:

root@emby_2:/usr/ports/multimedia/ffmpeg # make install clean
===>   ffmpeg-4.1_1,1 depends on executable: nasm - found
===>   ffmpeg-4.1_1,1 depends on file: /usr/local/bin/as - not found
===>   binutils-2.30_7,1 depends on file: /usr/local/lib/libgmp.so - found
===>   binutils-2.30_7,1 depends on file: /usr/local/lib/libmpfr.so - not found
===>  Patching for mpfr-4.0.1_2
===>  Applying distribution patches for mpfr-4.0.1_2
1 out of 1 hunks failed--saving rejects to src/mpfr.h.rej
Ignoring previously applied (or reversed) patch.
1 out of 1 hunks ignored--saving rejects to src/sub1sp.c.rej
Ignoring previously applied (or reversed) patch.
4 out of 4 hunks ignored--saving rejects to tests/tsub.c.rej
1 out of 2 hunks failed--saving rejects to tests/tsub1sp.c.rej
*** Error code 1

Stop.
make[5]: stopped in /usr/ports/math/mpfr
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/math/mpfr
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/devel/binutils
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/devel/binutils
*** Error code 1

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

Stop.
make: stopped in /usr/ports/multimedia/ffmpeg

This happened with a previous emby iocage jail so I blew that away and made a new one.  Now I'm getting this.  Any ideas?  OS is:

FreeBSD 11.2-STABLE (FreeNAS.amd64) #0 r325575+fc3d65faae6(freenas/11.2-stable)

 

Hi,

 

can you try this installation method and give the beta a shot!

 

LATEST BETA (76)

cd /tmp
wget https://raw.githubusercontent.com/bott0r/iocage-plugin-emby/beta/emby-server-beta.json
iocage fetch -P dhcp=on vnet=on bpf=yes allow_raw_sockets=1 -n emby-server-beta.json --branch 'beta' 

  • DangerIsGo likes this

#14 DangerIsGo OFFLINE  

DangerIsGo

    Member

  • Members
  • 14 posts
  • Local time: 12:52 PM

Posted 13 December 2018 - 01:57 PM

 

Hi,

 

can you try this installation method and give the beta a shot!

 

LATEST BETA (76)

cd /tmp
wget https://raw.githubusercontent.com/bott0r/iocage-plugin-emby/beta/emby-server-beta.json
iocage fetch -P dhcp=on vnet=on bpf=yes allow_raw_sockets=1 -n emby-server-beta.json --branch 'beta' 

That worked for me, thanks!  Is there going to be any official way in the future of installing in iocage jails?  Or a more updated PBI release schedule for freenas plugins??



#15 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 124028 posts
  • Local time: 01:52 PM

Posted 13 December 2018 - 02:07 PM

Yes we are working on this. Thanks guys.

#16 gbarone123 OFFLINE  

gbarone123

    Advanced Member

  • Members
  • 33 posts
  • Local time: 12:52 PM

Posted 14 December 2018 - 09:54 AM

Update for those curious, I upgraded to 3.6.0.76 last night from my setup described above using the following command:

pkg add -f https://github.com/M...X.X.X_amd64.txz

Of note, I was missing the dependency “libraw” and had to just run “pkg install libraw” first for the Emby server download to run.

After Emby server restart, everything seems to work perfectly. I haven’t dug deeper into whether the startup script changed, or if I’m still on the manually compiled ffmpeg, but if you followed my guide and had success, upgrading seems to be a three-command process from the shell.

#17 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 124028 posts
  • Local time: 01:52 PM

Posted 14 December 2018 - 04:40 PM

Thanks for the feedback !



#18 rsvp OFFLINE  

rsvp

    Member

  • Members
  • 19 posts
  • Local time: 06:52 AM

Posted 05 January 2019 - 12:07 AM

Hi,

I love the integration into Kodi, and that is what made me move over to Emby. But this has been down for a very long time....Do you have an ETA on the actual plugin being released?  I have tried every option on line that people are posting to fix it. For one reason or another none of them are working. All come up with some error.  



#19 justFlow OFFLINE  

justFlow

    Newbie

  • Members
  • 1 posts
  • Local time: 06:52 PM

Posted 05 January 2019 - 06:05 PM

Yeah, right now it seems more like an organizationally issue to provide a working emby plugin for FreeNAS 11.2 ... plugin not updated, infos spreaded all over, obsolete links etc. :wacko:

 

But #8 from makarai still works for me after updating the link to the latest emby beta release 83 (otherwise post_install.sh fails with an error at the end of the iocage plugin install). So exec the (adjusted) commands in post_install.sh inside the emby jail manually after plugin install:

# Install the binary package
#pkg add --force https://github.com/MediaBrowser/Emby.Releases/releases/download/3.5.3.0/emby-server-freebsd_3.5.3.0_amd64.txz
#pkg add --force https://github.com/MediaBrowser/Emby.Releases/releases/download/3.6.0.75/emby-server-freebsd_3.6.0.75_amd64.txz
#pkg add --force https://github.com/MediaBrowser/Emby.Releases/releases/download/3.6.0.80/emby-server-freebsd_3.6.0.80_amd64.txz
pkg add --force https://github.com/MediaBrowser/Emby.Releases/releases/download/3.6.0.83/emby-server-freebsd_3.6.0.83_amd64.txz

# Enable the service
sysrc -f /etc/rc.conf emby_server_enable="YES"

# Start the service
service emby-server start 2>/dev/null

hf


Edited by justFlow, 05 January 2019 - 06:06 PM.


#20 makarai OFFLINE  

makarai

    Advanced Member

  • Members
  • 452 posts
  • Local time: 07:52 PM

Posted 06 January 2019 - 10:02 AM

I have been on vacation, and I can update the repo of course. I assume the problems with the stable have not changed @Luke?





Also tagged with one or more of these keywords: ffmpeg

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users