Please point me in the right direction ...
#1
I have an ATV and have been hacking away at it for a while to get support for my movies stored out on a NAS. So far, so good, got all the usual plugins but nothing gives me that wow factor in terms of a nice interface the family can use.

So I put on XBMC [9.04.1] (going the usual USB Creator / Launcher route - current build is May 26 2009, SVN 20677 according to the log, Launcher 3.1) and love the interface & skins etc... what I'm not liking so much is the playback of HD 720p content. I encode using Handbrake, settings for Apple TV bitrate set to 2500.

Having spent a fair while looking at it and trying different configs (802.11g, powerline ethernet and now 100mb cat-5) I decided to SSH into the box and take a look at cpu usage while playing back an h.264 movie. Playing using Sapphire (a media browser that, I believe, just uses the underlying Quicktime) the CPU is around 40% and everything is smooooooth, even high motion stuff.

Playing using XBMC, the CPU is in the 85-95% range and high motion breaks up and stutters from time to time. I know my links are fast enough (Sapphire can handle it) so what struck me as obvious, and perhaps a huge noob mis-conception, is can XBMC be configured to use Quicktime as its playback engine?

Yes, I realise ffmpeg supports far more codecs, but with Perian installed I'm not at a lack for codec support, I'm far more interested in getting a perfect playback experience... so is it possible or is it a complete no-no?

Has it already been done perhaps? Is there a better (as in more atv-centric) build of xbmc I should be using?

Thanks for any help, pointing and laughing welcome Wink
Reply
#2
Jemster Wrote:I have an ATV and have been hacking away at it for a while to get support for my movies stored out on a NAS. So far, so good, got all the usual plugins but nothing gives me that wow factor in terms of a nice interface the family can use.

So I put on XBMC [9.04.1] (going the usual USB Creator / Launcher route - current build is May 26 2009, SVN 20677 according to the log, Launcher 3.1) and love the interface & skins etc... what I'm not liking so much is the playback of HD 720p content. I encode using Handbrake, settings for Apple TV bitrate set to 2500.

Having spent a fair while looking at it and trying different configs (802.11g, powerline ethernet and now 100mb cat-5) I decided to SSH into the box and take a look at cpu usage while playing back an h.264 movie. Playing using Sapphire (a media browser that, I believe, just uses the underlying Quicktime) the CPU is around 40% and everything is smooooooth, even high motion stuff.

Playing using XBMC, the CPU is in the 85-95% range and high motion breaks up and stutters from time to time. I know my links are fast enough (Sapphire can handle it) so what struck me as obvious, and perhaps a huge noob mis-conception, is can XBMC be configured to use Quicktime as its playback engine?
Yes, I realise ffmpeg supports far more codecs, but with Perian installed I'm not at a lack for codec support, I'm far more interested in getting a perfect playback experience... so is it possible or is it a complete no-no?

Has it already been done perhaps? Is there a better (as in more atv-centric) build of xbmc I should be using?

Thanks for any help, pointing and laughing welcome Wink

I'd need to see a mediainfo output of the video content you are trying to play in order to see if you have a configuration problem or a CPU ponies problem.

Having XBMC use Quicktime will not help. The AppleTV gets a little hw decode assist from the GPU and that API is not public so we can't use it. However, there is something brewing that will knock your socks off with respect to the AppleTV and non-Ividia Intel MacMinis. Stay tuned.
Reply
#3
davilla Wrote:I'd need to see a mediainfo output of the video content you are trying to play in order to see if you have a configuration problem or a CPU ponies problem.

Hi! Thanks for the quick response Smile Sure thing.... here you go (for next time... do you need all of this?)

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : [email protected]
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1h 30mn
Bit rate mode : Variable
Bit rate : 1 500 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16/9
Frame rate mode : Variable
Frame rate : 23.976 fps
Minimum frame rate : 23.810 fps
Maximum frame rate : 24.390 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.068
Stream size : 970 MiB (71%)
Writing library : x264 core 65
Encoding settings : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x1:0x111 / me=umh / subme=6 / psy_rd=1.0:0.0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=3 / nr=0 / decimate=1 / mbaff=0 / bframes=2 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=1 / wpredb=0 / keyint=240 / keyint_min=24 / scenecut=40(pre) / rc=2pass / bitrate=1500 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00


davilla Wrote:Having XBMC use Quicktime will not help. The AppleTV gets a little hw decode assist from the GPU and that API is not public so we can't use it. However, there is something brewing that will knock your socks off with respect to the AppleTV and non-Ividia Intel MacMinis. Stay tuned.

I don't quite get you here (speak tech if you like, for background I'm a professional C++ programmer with a little bit of obj-C chucked in too, just zero familiarity with xbmc Smile) - surely the point is that Sapphire is just a browser that DOES use Quicktime. As a direct result of this it gets the same GPU assist that native ATV playback gets (for H.264 of course, not suggesting ALL the additional codecs Perian installed would get that). I know the above file plays back with low CPU on Sapphire (monitoring top from ssh) and I know it's high with XBMC in the same way so how would it not help to have XBMC use the same method for (at least) this file type? Not knowing the architecture of xbmc perhaps this is an impossible pipe dream though?

Very curious about what's brewing... is it a long brew or almost ready for consumption? Smile Smile
Reply
#4
Jemster Wrote:Format/Info : Advanced Video Codec
Format profile : [email protected]

should be able to handle that, if xbmc upscaling is on, turn it off. pastebin your xbmc.log (www,pastebin.com)
Reply
#5
davilla Wrote:However, there is something brewing that will knock your socks off with respect to the AppleTV and non-Ividia Intel MacMinis. Stay tuned.

Hey you can't say stuff like that and then just leave us hanging..... Come on out with it Wink
Reply
#6
davilla Wrote:should be able to handle that, if xbmc upscaling is on, turn it off. pastebin your xbmc.log (www,pastebin.com)

Upscaling is already off. Here's a log of the past hour or so playing the file http://pastebin.com/m49fb30b4

I noticed lots and lots of

WARNING: Decode - avcodec_decode_video didn't consume the full packet.

messages. Also strange that it seems to think it's an invalid frame rate?

ERROR: CDVDPlayerVideo::OpenStream - Invalid framerate 1000, using forced 25fps and just trust timestamps


When it's a 23.976fps file.

Incidentally, I updated XBMC to the Questor SVN build just to see if that would make any difference but no visible change there. Can roll back if necessary.

Anyway, enjoy the light reading Smile suggestions appreciated and thanks for your help so far.
Reply
#7
Ok, having now read up a lot more on Sapphire I see the fundamental differences between it and XBMC and think I understand why launching QuickTime wouldn't help ... so given that avenue is closed off, could anyone (davilla?) please take a look at the log file and let me know if that avcodec Warning is normal or not?

There's 2 audio streams in the AVI, stream 0 being stereo, stream 1 being an AC3 DD5.1 passthrough, could that be the cause of the messages? I also don't see why it can't recognise the frame rate - it's recognised correctly by mediainfo and QuickTime on my Mac and I encoded it using standard Handbrake settings (i.e. it's not a dodgy source from somewhere unknown...) so am somewhat at a loss as to where to look next Sad

I can probably knock together a shorter sample file that shows the same behaviour if it's of any use in tracking this down?
Reply
#8
"WARNING: Decode - avcodec_decode_video didn't consume the full packet." is typically from the internal DVDPlayer dropping frames and such. This causes ffmpeg to abort the decode and not consume a full packet.

I looked at the xbmc.log, did not see anything that jumped out.

I'd have to get a sample and try it but I'm rather occupied at the moment with that "other" project.
Reply
#9
Ahhhh, so could the frames be dropped due to high CPU loading - reflecting what I saw in top with the high CPU assigned to XBMC?

My work involves multi-channel high-speed video decoding / streaming / storage with both proprietary and libav based codecs so I don't mind getting my hands dirty if it helps out. I just want to get a handle on what is a "normal" debug message so as I can focus some effort into working out what's wrong and how to get around it. The assumed frame rate of 25fps strikes me as something else that may be responsible for the slight judder on playback...

I totally understand your time is limited and appreciate your help so far, if there's something coming along that'll squash these issues in the near future then I'll not bother with the continuous recode / test / recode / test or searching through source code until I've had my socks well & truly knocked off Smile

EDIT: Ooooh just found something of interest - if I load up either of the 2 m4v files I've tried (both from mkv sources, both 23.976fps, both converted to m4v by Handbrake on default settings) using VLC, the frame rate is displaying as 23.80954... even though Mediainfo said 23.976. Working on the basis that VLC is built on the same libav as XBMC perhaps this is the reason for the invalid framerate message.

Just trying a recode with a fixed 23.976 framerate instead of letting it select "same as source" to see if that works better.
Reply
#10
AHaaaa... something new to report (finally!)

I played with encodings, lots and lots of encodings... no difference... I played with bit rates, no difference. However, while I was staring at the screen and wondering what was going on, I noticed the CPU usage in the debug text at the top of screen.

I noticed that when I was browsing my video files (held on an SMB share on a NetGear NAS, hard-wired to the Apple TV) in file mode, when I went in to the folder with 20 - 30 movie files that happened to contain the one I was working on, CPU usage shot up to between 50 and 60% (and does likewise for other folders on the share). If I waited, the CPU remained high... what on earth is XBMC doing?

If I then browsed away from the share, to the Home folder, CPU usage drops to approx 5-10%... Hmmmmmmmmm

So I copied the movie that was clocking 90-95% and not quite achieving the required 24fps into the Home folder... and it plays back pretty much perfectly - CPU now sits in the 70-85% range instead of 85-95% and fps is practically constant at 24fps.

My question I guess at this stage is, not just WTF?? Stare but... what is XBMC doing aside from playing the video? My library was fully updated, I tried with library turned off and turned on... what else can I disable and how? Huh
Reply

Logout Mark Read Team Forum Stats Members Help
Please point me in the right direction ...0