I moved to Plex a few months ago as the RoksBox app on my Roku 3 (model 4230R) appears to be no longer maintained. I ran across Plex and decided to give it a whirl and installed it on my local FreeNAS box as a plugin and added the Plex channel to my Roku. I am having an issue with Plex buffering content every few seconds.
I am intimately aware the of root causes of buffering after having worked six and a half years at RealNetworks supporting their Helix Server which could deliver content via RTSP, RTMP, HLS, and MPEG-DASH. While there I became their onsite encoding expert and have since created a 1,500 line bash shell script that drives FFmpeg to convert my content. I am now back in the streaming media industry after our group was laid off back in November 2014.
My content, which is H.264 video with stereo AAC audio in an MP4 container, is compliant for repacketization to all of the protocols previously mentioned. All of my keyframes are aligned with either a two or five second GOP for segmented content. I blog about encoding here. An example line from my bash shell script that I run under Cygwin on Windows is as follows:
ffmpeg.exe -threads 1 -hwaccel dxva2 $startPosition $endPosition -fpsprobesize $gop -i $inputfile $scan -pix_fmt $colorspace -vsync 1 -sn -vcodec libx264 -map $vtrack -r $fps -vf "crop=$w1:$h1:$x1:$y1,scale=$fixedwidth:$fixedheight:$fixrotation" -threads 0 -b:v:$vtrack $averagevideobitrate -bufsize $buffer -maxrate $maximumvideobitrate -minrate $minimumvideobitrate -strict experimental -acodec aac -map $audio -b:a:$audio $audiobitrate -ac 2 -ar $audiofrequency -af "aresample=async=1:min_hard_comp=0.100000:first_pts=0" -pass 1 -preset $newpreset -profile:v $defaultprofile -g $gop $gohigher $newtune -x264opts no-scenecut -map_metadata -1 -f mp4 -y $outputfile
Every variable in that command line is either prepopulated on the command line or calculated in my script and then inserted for optimal bitrate as shown here. The line above might end up looking something like this:
ffmpeg.exe -threads 1 -hwaccel dxva2 -fpsprobesize 48 -i input.mp4 -pix_fmt yuv420p -vsync 1 -sn -vcodec libx264 -map 0:0 -r 23.976 -vf "crop=1920:800:0:140,scale=1920:800" -threads 0 -b:v:0 2486272 -bufsize 25059328 -maxrate 24862720 -minrate 248627 -strict experimental -acodec aac -map 0:1 -b:a:1 196608 -ac 2 -ar 48000 -af "aresample=async=1:min_hard_comp=0.100000:first_pts=0" -pass 1 -preset medium -profile:v high -g 48 -tune film -x264opts no-scenecut -map_metadata -1 -f mp4 -y output.mp4
Today I had my first buffering issue. I updated to Version 2.7.10 (or 1.1.3.2700-6f64a8d) as reported in the Plex Interface as I thought that an update would resolve the issue. I was wrong as the issue persists. The last version that I see is 2.7.3 (or 1.0.0.2261-a17e99e) under Settings / Web and Settings / Server respectively.
My network is 1GB Ethernet with my ASUS RT-AC66U router running the DD-WRT firmware v24-sp2 (12/22/14) giga (SVN revision 25697). I have zero issues connecting to Amazon Prime or to Netflix. My internal network is clean as Bittorrent is not in use. I do not perform transcoding with my content as my content is restricted to my internal network. Were I to consider creating ABR content I can make my own, assuming that Plex can deal with that and rate switch automatically as network bandwidth changes.
My FreeNAS box is not performing any ZFS scrubs at this time. I am not disk speed constrained.
As I am new to Plex and it appears that this issue is resolved for some people who roll back to either 1.0 or 0.9.12.19. Any advice on how to roll back to a previously working version on FreeNAS-9.10.1 (d989edd)?