Jump to content

Playback error: there was an error processing the request....


arnie007
 Share

Recommended Posts

arnie007

Hi, 

 

I'm a long time follower and supporter of Mediabrower and now emby. All the way back to early beta versions of Mediabrowser for WMC.

I have to say that the project has evolved exponentially and I love what you guys are doing with it. Great work!! 

 

Now to my issues.

Recently I decided to move my emby Server away from Wintel Server to a dedicated box (NUC) running on i5 with what I think is enough grunt to transcode to multiple devices.

Cutting a long story short, I have not been successful in playing content via Android ,Roku 3, Nexus Player,  DLNA or Web Clients. It does not apply to all files however vast majority of my mkvs. 

 

I suspect that this is to do with transcoding as my external players are just fine. ie. BSPlayer, KODI, etc.

There is a lot going on in the log file but this particular one make me thing it's something to do with ffmpeg. 

"FFMpeg exited with code 138"

 

For example when I play an MKV in Android emby it will launch the internal player however I end up with error;

"Playback error: there was an error processing the request. Please try again later"

On the other hand, I can play the same content in external player. still redirected by emby

 

 

I would greatly appreciate if someone had some wisdom to share.

 

cheers. 

Server Log.txt

Transcode Log.txt

Link to comment
Share on other sites

kjp4756

I had a similar issue a while back.  I'm running freenas 9.3 and I have emby installed in a regular jail.  Anyway, what happened was one of the libraries that ffmpeg depends on was updated and ffmpeg needed to be recompiled.  

 

I'm not seeing much in yours logs other than the ffmpeg exiting for whatever reason.  What you could do is try to run the ffmpeg command from the shell and see if you get an error.  That's what I had to do to figure out my issue.

 

 

/usr/local/bin/ffmpeg -loglevel debug -i file:"/mnt/homeserver/g/Home Video/Baravelli Christmas Tape/title00.mkv" -map_metadata -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 libx264 -pix_fmt yuv420p -preset superfast -crf 23 -maxrate 1372000 -bufsize 2744000 -vsync vfr -profile:v high -level 41 -force_key_frames expr:gte(t,n_forced*3) -vf "scale=min(iw\,1280):trunc(ow/dar/2)*2" -flags +loop-global_header -sc_threshold 0 -codec:a:0 aac -strict experimental -ac 2 -ab 128000 -af "adelay=1,aresample=async=1" -hls_time 3 -start_number 0 -hls_list_size 0 -y "/var/tmp/transcoding-temp/a2e07b92112215284fc3c26fd728cc1c.m3u8"
Link to comment
Share on other sites

arnie007

thanks kjp4756. can you recommend how I can actually do this via CLI? 

Running above complete ffmpeg command just comes back with "Badly placed ()'s."

 

I have removed ffmpeg just as per installation instructions and recompiled it. Is there a way of reinstalling with all dependencies? 

Link to comment
Share on other sites

kjp4756

Right.  Now I remember.  I had the same problem running ffmpeg like that and getting the 'badly places ()'s" error.  

 

Run /usr/local/bin/ffmpeg alone without any other parameters and see if it errors out.  When I had this problem I got a message about a libx265 library missing or something.

 

To reinstall ffmpeg and dependencies you could do this:

 

 

pkg delete -f ffmpeg
pkg autoremove
cd /usr/ports/multimedia/ffmpeg
make install clean

 

I'm assuming you did a 'make config' before and made sure to enable lame support and libass support.

 

After re-reading your original post you stated that some files to transcode successfully.  When I had my similar issue, nothing would transcode at all.  I'm guessing the problem must be somewhere with your MKVs.

Link to comment
Share on other sites

sluggo45

Right.  Now I remember.  I had the same problem running ffmpeg like that and getting the 'badly places ()'s" error.  

 

Run /usr/local/bin/ffmpeg alone without any other parameters and see if it errors out.  When I had this problem I got a message about a libx265 library missing or something.

 

To reinstall ffmpeg and dependencies you could do this:

pkg delete -f ffmpeg
pkg autoremove
cd /usr/ports/multimedia/ffmpeg
make install clean

I'm assuming you did a 'make config' before and made sure to enable lame support and libass support.

 

After re-reading your original post you stated that some files to transcode successfully.  When I had my similar issue, nothing would transcode at all.  I'm guessing the problem must be somewhere with your MKVs.

 

If he/she (or anyone else reading this with the same problem) installed Emby via the pbi that won't work because it uses the version of ffmpeg packaged with it in /usr/pbi/emby-amd64/bin . 

 

A quick & dirty way around this is to change the Emby-server startup options so it uses the port version of ffmpeg instead (and ffprobe, might as well do both since the versions will match).

 

Edit /usr/pbi/emby-amd64/etc/rc.d/emby-server (make a backup by copying it first) and look for the command arg line, change the ffmpeg and ffprobe directories to point to the system (port) locations like so:

 

command_args="-f -p ${pidfile} ${procname} /usr/pbi/emby-amd64/lib/emby-server/MediaBrowser.Server.Mono.exe -ffmpeg /usr
/local/bin/ffmpeg -ffprobe /usr/local/bin/ffprobe -programdata ${emby_server_data_dir}"
 
Then restart the server/jail. Do this after you build/rebuild ffmpeg from the port tree, it goes without saying :) This is only a temporary fix - an update to the pbi will overwrite it - however hopefully an updated PBI will also update ffmpeg and its dependencies.
 
You could also change the build options so that the port actually updated the version in the pbi directory however that has a greater chance of messing something up (the way I am outlining is super-easy to back out of) and also would be undone by an updated pbi. 
 
The version of ffmpeg that is built with the pbi is 2.3.6 and the one in the ports tree is 2.7.2. Mostly it's just small bug fixes but there are some small threading improvements - with my server (Xeon i3-1230) I got a noticeable speedup in encoding times, and I haven't seen any problems with playback yet like I was before.
 
FYI, when building ffmpeg from the ports tree, use the right config options. When you do "make config" the first time you'll get a screen that lets you pick options; here's the output you want it to look like:
 
--enable-libaacplus --disable-indev=alsa --disable-outdev=alsa --disable-libopencore-amrnb --disable-libopencore-amrwb --enable-libass --disable-libcdio --disable-libcelt --disable-libfaac --disable-libfdk-aac --disable-ffserver --disable-fontconfig --disable-libfreetype --disable-frei0r --disable-gnutls --disable-libgsm --disable-iconv --disable-indev=jack --enable-libmp3lame --disable-libbluray --disable-libv4l2 --disable-indev=v4l2 --disable-outdev=v4l2 --disable-libmodplug --disable-openal --disable-indev=openal --disable-libopencv --disable-libopenjpeg --disable-openssl --disable-libopus --disable-libpulse --disable-indev=pulse --disable-outdev=pulse --disable-librtmp --enable-libschroedinger --disable-libspeex --enable-libtheora --disable-vaapi --disable-vdpau --enable-libvorbis --disable-libvo-aacenc --disable-libvo-amrwbenc --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-shared --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --enable-memalign-hack --disable-libstagefright-h264 --disable-libutvideo --disable-libsoxr --cc=cc --extra-cflags='-msse --extra-ldflags='- --extra-libs=-pthread --disable-debug --disable-ffplay --disable-outdev=sdl --enable-nonfree

You won't have all those options but in general:

 

Make sure you check (enable) Lame support.

Disable (uncheck) ffmpeg server.

 

Other items in that list you see that are disabled that are checked by default, go ahead and uncheck them, and vice versa. If you don't see them on the list don't worry about it. 

Edited by sluggo45
  • Like 1
Link to comment
Share on other sites

josh4trunks

@@sluggo45 we don't know if this is a PBI install or package intall.

 

@@arnie007 mind clarifying if this is a FreeNAS plugin install or a FreeBSD package install? Thanks

Edited by josh4trunks
Link to comment
Share on other sites

kjp4756

I was assuming it was the ports version of emby because ffmpeg was at /usr/local/bin  I think with the PBI ffmpeg is at /usr/pbi

 

I could be wrong though.

Link to comment
Share on other sites

josh4trunks

I was assuming it was the ports version of emby because ffmpeg was at /usr/local/bin  I think with the PBI ffmpeg is at /usr/pbi

 

I could be wrong though.

Good point. Any discussion of the PBI/plugin is irrelevent then =O

Link to comment
Share on other sites

sluggo45

How is it irrelevant if it's in the FreeBSD forum? The PBI/Plugin is supported here, surely someone reading this might have the same problem. I know I was until I updated ffmpeg and I am using the PBI.... so this wasn't irrelevant for me :)

Link to comment
Share on other sites

josh4trunks

How is it irrelevant if it's in the FreeBSD forum? The PBI/Plugin is supported here, surely someone reading this might have the same problem. I know I was until I updated ffmpeg and I am using the PBI.... so this wasn't irrelevant for me :)

I just meant helping him fix the plugin was irrelevant since he wasn't using the plugin.

 

guess I didn't think of others hitting a similar issue with the plugin, lol

 

EDIT

so you noticed better performance with the latest ffmpeg? I'll make sure to update the one package with the PBI

Edited by josh4trunks
Link to comment
Share on other sites

sluggo45

No problem, and btw thanks for putting the PBI together.

 

I haven't done any objective measurements between the two versions. There are a number of fixes between 2.3.x and 2.7.x, particularly for mp3 and aac, so it's possible there are two things happening: One, files I was having problems with that were transcoded (that refused to play in the Windows Store client, for example) now play fine after I redid them with the updated version of ffmpeg in place, so "edge case" files are handled better, perhaps, and two, also perhaps as a result of the updates files are converted a little quicker (maybe simply as a result of better error correction/etc.). It's hard to say without doing a 1:1 comparison. 

Link to comment
Share on other sites

arnie007

Well, for good or bad I found a solution, overall less time intensive than my attempts to troubleshooting this. 

 

Solution?

I've put a cracker under FreeBSD server and replaced it with Ubantu server then reinstalled Emby on it.

All good and humming along just nicely on my NUC box.

 

Thanks everyone for trying to help me but sometimes it's just better to cut your loses while sanity is still intact.

 

I feel like I owe few clarification on above questions;

1. Emby was installed on a clean FreeBSD 10.1 server, not FreeNAS 

2. Installed via ports, as per instructions on http://emby.media/downloads/freebsd-server/

3. Did follow kjp4756 suggestion with uninstalling ffmpeg including dependencies. result, no cigar.

4. I had inconsistent streaming behavior on different platforms. Android client for example would play music where as my Kodi would not. the opposite happened on Kodi however I fell this is more to do with embedded player.

Link to comment
Share on other sites

kjp4756

Ok, I just discovered I am in fact having the same issue as the OP.  When I try to play any of my MKVs in the web ui it won't play.  MP4 videos play fine.

 

I'm thinking that the "Badly placed ()'s" error when trying to run the ffmpeg command from the log file was what was causing the transcode to fail.

 

Here is the original command from the server log:  The "Badly placed ()'s" error is coming from -force_key_frames expr:gte ( t,n_forced*3 )

/usr/local/bin/ffmpeg -i file:"/media/Movies/Prison Break The Final Break (2009).mkv" -map_metadata -1 -threads 0 -map 0:0 -map 0:2 -map -0:s -codec:v:0 libx264 -pix_fmt yuv420p -preset superfast -crf 23 -maxrate 718054 -bufsize 1436108 -vsync vfr -profile:v high -level 41 -force_key_frames expr:gte ( t,n_forced*3 ) -vf "scale=min(iw\,720):trunc(ow/dar/2)*2" -flags +loop-global_header -sc_threshold 0 -codec:a:0 aac -strict experimental -ac 2 -ab 128000 -af "adelay=1,aresample=async=1" -hls_time 3 -start_number 0 -hls_list_size 0 -y "/var/db/mediabrowser/transcoding-temp/f51e59feb67ccaf6b12dec8e9f657c8d.m3u8"

Here is the command modified to work.  All I did was add double quotes at -force_key_frames expr:gte ( t,n_forced*3 )

/usr/local/bin/ffmpeg -i file:"/media/Movies/Prison Break The Final Break (2009).mkv" -map_metadata -1 -threads 0 -map 0:0 -map 0:2 -map -0:s -codec:v:0 libx264 -pix_fmt yuv420p -preset superfast -crf 23 -maxrate 718054 -bufsize 1436108 -vsync vfr -profile:v high -level 41 -force_key_frames "expr:gte ( t,n_forced*3 )" -vf "scale=min(iw\,720):trunc(ow/dar/2)*2" -flags +loop-global_header -sc_threshold 0 -codec:a:0 aac -strict experimental -ac 2 -ab 128000 -af "adelay=1,aresample=async=1" -hls_time 3 -start_number 0 -hls_list_size 0 -y "/var/db/mediabrowser/transcoding-temp/f51e59feb67ccaf6b12dec8e9f657c8d.m3u8"

This is all from when running via the csh shell.  I am not entirely sure if any of this applies to when ffmpeg is being called from within mono.  Hopefully someone who knows more on this can chime in.

 

Ooops, for got my details:

 

Freenas 9.3

Emby server 3.0.5675.1

Emby  installed using package in a regular jail

Edited by kjp4756
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...