Building the Plex New Transcoder

I tried to build the Plex New Transcoder using the source provided at http://files.plexapp.com/elan/ffmpeg/PlexNewTranscoder.tar.bz2(don't grab this; it's really old) (mentioned in the LICENSE file).  This does not build because the archive appears to be incomplete.  Notably, the file plex.c contains the following:

#include "plexConfig.h"

#include "plexVersion.h"

 

Neither of these files are present.  In addition, I've had to modify a location looking for header files under the wrong name.  I'd like to build this from source so that I could apply the 2 patches I've created to correct errors in the transcoder.  At least then I can use them myself and confirm their fixes while I wait for them to be rolled into the official release.

 

So I ask, has anyone built this transcoder from source?  What is the configure line used (if it is different than the documentation for FFmpeg)?  Are there any particular packages that should be installed prior to configure?  Specifically, I'm interesting in building it for Ubuntu 12.04.

hey,

i have excatly the same issue, because plex does not use hardware decoder very well, like CrystalHD and libvdpau, that why my cpu load is very high, on TVHeadend every thing works fine, also on mediatomb, but plex, grrrrr

Any updates on this?

The source tarball downloaded from the link in OP still does not include a couple of files like plexConfig.h, plexVersion.h, version.sh etc.

Creating stub versions of these files helps to move further, but it still fails to build:

libavfilter/libavfilter.a(vf_inlineass.o): In function `vf_inlineass_set_storage_size': 
/home/novel/code/transcode/plex-new-transcoder/libavfilter/vf_inlineass.c:583: undefined reference to `ass_set_storage_size'                                                    
libavfilter/libavfilter.a(vf_inlineass.o): In function `vf_inlineass_add_attachment':   
/home/novel/code/transcode/plex-new-transcoder/libavfilter/vf_inlineass.c:606: undefined reference to `ass_add_font'                                                            
libavfilter/libavfilter.a(vf_inlineass.o): In function `vf_inlineass_set_fonts':        
/home/novel/code/transcode/plex-new-transcoder/libavfilter/vf_inlineass.c:613: undefined reference to `ass_set_fonts' 

any many other errors because of the missing ass_* functions.

To move forward, I’ve added -lass to EXTRALIBS defined in config.mak and that helped. There were some other minor problems on the way, like some undefined calls to PMS_log which I commented out and also a missing libavutil/ffversion.h file which I also created and wrote down some random FFMPEG_VERSION there.

In the end, I did make install and got the following files installed to /usr/local/bin/:

-rwxr-xr-x    1 root  wheel  15674144 Oct 19 09:16 ffmpeg
-rwxr-xr-x    1 root  wheel  15592768 Oct 19 09:16 ffplay
-rwxr-xr-x    1 root  wheel  15616160 Oct 19 09:16 ffprobe
-rwxr-xr-x    1 root  wheel  14736928 Oct 19 09:16 ffserver

I copied over /usr/local/bin/ffmpeg to /usr/local/share/plexmediaserver/Plex\ Transcoder. Unfortunately, after that playback got completely broken, it just won’t play anything at all, showing the ‘loading’ icon. Which is no surprising considering count of hacks I had to apply.

Is there any guide how to obtain these missing files and build/install things properly?

It should build with --enable-libass. Our sources should build like normal FFmpeg, but I guess sometimes some build configurations we don’t need break.

and also a missing libavutil/ffversion.h file which I also created and wrote down some random FFMPEG_VERSION there.

No, that shouldn’t be necessary. This sounds very wrong. You probably didn’t finish running configure or so.

The link in the first post is actually quite outdated. My suggestion might still help, but you should use the newer sources here: http://files.plexapp.com/sources/ffmpeg-2017-08.txz

(I tried out building with only ./configure && make -j4 and it succeeded. That wasn’t exactly the code in the newer link either, though.)

@vlang said:
The link in the first post is actually quite outdated. My suggestion might still help, but you should use the newer sources here: http://files.plexapp.com/sources/ffmpeg-2017-08.txz

(I tried out building with only ./configure && make -j4 and it succeeded. That wasn’t exactly the code in the newer link either, though.)

Thanks, with this source tarball it builds like a charm. For the previous tarball I did run configure and it finished, probably it needs some extra configuration, but anyway it doesn’t matter now when there’s a newer tarball available.

By the way, is there any page with a link to the current actual source snapshot of Plex Transcoder? Before I asked, I’ve googled for that and only found the link in the first post of this topic.

PS The reason I’m trying to figure this out is because I want to fix a segfault I’m having on FreeBSD. I’ve posted some analysis of these crashes and a proposed fix here: https://forums.plex.tv/discussion/comment/1541567#Comment_1541567. Appreciate if somebody from the Plex team could take a look.

Thanks a lot for your help!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.