Solved Movie playback issue (long time from selecting file and seeing playback)
#1
Exclamation 
Hi All

Please read only the bold for a quick summary,

I am having playback problems on my wireless XBMC's (OpenELEC) and NAS (NAS4Free) setup. In a nutshell, it is taking up to a couple of minutes to start a movie located on my NAS via the library interface on XBMC.

I have tried a variety of things:
  • Playback from my wireless laptop via VLC - no long start times.
  • Playback from wired desktop using VLC - no long start times.
  • Playback of files shared from another syste, - no long start times.
  • Playback from the files menu on XBMC - still long start times.

I have searched over XBMC logs several times and can never determine anything concrete, I have seeen issue where I think it is searching for subtitles and having issue - but there is never an error. Regardless I see this issue only with Movies, and not with Series - I have some episodes that are the approximately the same file size as movies, so I think it is a fair conclusion.

My file structure for Series is as follows (sub folders for shows and seasons):

smb://nas/Series/Show Name/Show Season/Show Episode.avi

My file structure for Movies is as follows (flat file , all in root directory):

smb://nas/Movies/Movie Title (Year).avi

I am beginning to think this isn't a NAS4Free issue or an OpenELEC, issue but a fundamental XBMC issue.

To me it appears that the flat file structure of my movies is creating issue for playback - I have no idea why, but here is how I came to this conclusion.

I start a movie from my library, the movie resides in the root directory of Movies on my NAS along with the fanart, poster, subtitles, nfo etc. - it take over a minute to start the video after selecting playback for it. As a test, I took the same movie and I put it in the following file structure, and added it to my library:

smb://nas/Movies/Movie Title (Year)/Movie Title (Year).avi

I started the movie and it took around 6 seconds to begin - I am aware that my wireless isn't the best in this location but it was a much quicker start time than over a minute.

To make sure I wasn't crazy I retested:
  • Back to the movie in the root folder - over a minute to see playback
  • Back to the movie in the movie title sub folder - 6 seconds
  • Back to the movie in the root folder - over a minute to see playback
  • Back to the movie in the movie title sub folder - 6 seconds
  • Back to the movie in the root folder - over a minute to see playback
  • Back to the movie in the movie title sub folder - 6 seconds

I have seen nothing on any forum or wiki that suggests a flat file structure isn't recommended, but my testing indicates it could be the source of my problems. Additionally: I noticed that using the sub folder setup in movies resulted in fanart and poster taking a little time to display in the XBMC interface. So I have several questions:


  1. What is the best structure when you have over 1000 movies?
  2. What is the best way to structure metadata for quickly displaying; folder, fanart, nfo - place it in the root?
  3. Am I doing anything fundamentally wrong, I've been using XBMC for almost 10 years?
  4. Can I provide logs or something to help this investigation?
  5. Is there any other tests I can conduct?
  6. And finally, is anyone else experiencing this?
Reply
#2
I've seen lots of recommendations to place each movie in its own folder as you describe with your test. That's the way all of mine are (about 2000). Artwork, themes, nfo's and trailers at the root of the individual movie folder with the movie file itself and Extras, extra fanart and extra thumbnails in sub folders.

I can't honestly say I know why you're having the problem. I could make some guesses but would rather not. It looks like you have found the fix though.
ASUS Chromebox M004U (LibreELEC 8.2/Aeon Nox SiLVO)--->HDMI--->Onkyo TX-NR646--->HDMI--->Panasonic P65VT30
Reply
#3
(2014-02-27, 22:26)wgstarks Wrote: I can't honestly say I know why you're having the problem. I could make some guesses but would rather not. It looks like you have found the fix though.

I really appreciate your prompt response, can you state a little clearer for me the structure. You are saying this works:

smb://Movies/Blockboster (2014)/Blockboster (2014).mkv
smb://Movies/Blockboster (2014)/Blockboster (2014)-fanart.jpg
smb://Movies/Blockboster (2014)/Blockboster (2014).nfo
smb://Movies/Blockboster (2014)/Blockboster (2014).srt
smb://Movies/Blockboster (2014)/exraThumbs/image1.jpg

As for anyone else viewing this, I would really appreciate if someone in general would look into why this is happening, I am more than happy to provide any logs and conduct any tests, I just don't see any reason why a flat file structure shouldn't be quick...
Reply
#4
When I setup my nas, I had some issues that I finally got worked out.

I have all my movies in their own folder named exactly the same.
You might try resetting your wireless connection (fixed my issues).
I changed my connection from smb to nfs.

I have noticed that if I haven't watched anything and decide to watch something, it takes a minute for the hard drives to spin up.
Reply
#5
(2014-02-27, 23:46)billybobjimbojr Wrote: I changed my connection from smb to nfs.

I have noticed that if I haven't watched anything and decide to watch something, it takes a minute for the hard drives to spin up.

I am not sure if implementing NFS will gain anything, once the movie has started I can skip forward and backward with ease, it appears to be the initial loading, and then on top of that my testing shows it wasn't anything to do with the HD's spinning down.

I think if this is truly the case we should change the wiki to advise against flat file structure. But fundamentally,I think there could be some fix that could be made to make this all work quicker - I mean, it sees the file, it knows I picked it...why is it taking so long to play itHuh?

If I were to move them into the folder, I am concerned because I would have to change all my DB references, which isn't happening easily, and then I have to make all the folders, any tools to help here?

Update: Here is a tool http://www.howtogeek.com/howto/19707/qui...d-folders/ - I would still like to understand the root cause here.
Reply
#6
(2014-02-27, 23:26)iainmacleod Wrote:
(2014-02-27, 22:26)wgstarks Wrote: I can't honestly say I know why you're having the problem. I could make some guesses but would rather not. It looks like you have found the fix though.

I really appreciate your prompt response, can you state a little clearer for me the structure. You are saying this works:

smb://Movies/Blockboster (2014)/Blockboster (2014).mkv
smb://Movies/Blockboster (2014)/Blockboster (2014)-fanart.jpg
smb://Movies/Blockboster (2014)/Blockboster (2014).nfo
smb://Movies/Blockboster (2014)/Blockboster (2014).srt
smb://Movies/Blockboster (2014)/exraThumbs/image1.jpg

As for anyone else viewing this, I would really appreciate if someone in general would look into why this is happening, I am more than happy to provide any logs and conduct any tests, I just don't see any reason why a flat file structure shouldn't be quick...

Here is one of my movies-
Image

There's no nfo file with this one (I don't use many) but if you use them they go at the same level as the movie.

Edit: Also if you have a local trailer it would go at the same level as the movie.
ASUS Chromebox M004U (LibreELEC 8.2/Aeon Nox SiLVO)--->HDMI--->Onkyo TX-NR646--->HDMI--->Panasonic P65VT30
Reply
#7
Excellent gentlemen, thank you for your help - I changed the structure of my file last night - it is night and day.

I think I will add a note somewhere in a wiki, or discussion, because I can honestly say this issue has plagued me for some time - I always thought it was NAS4Free.
Reply
#8
I see you added a big honking warning to the wiki - which I have removed again.

Rather than directly adding a warning because you experience an issue I want to know why this is causing you so much problems. (You really seem to be the only one experiencing this)
We advice people to use individual folders because it is easier scraping, not because of issues with playback.

Where are your logs ? I would expect you to upload a debug log (wiki) so we can see if anything is wrong here.
Reply
#9
I have seen this reported a few times.

My understanding is that on video playback the directory gets iterated looking for associated files (e.g. subtitles).
This directory iteration requires a network round trip time per file.
A flat directory structure may have thousands of files in a single directory (videos, nfos, artwork, subs).

This process is slower with wifi compared to wired ethernet.
This process is slower with smb compared to nfs.
This process is slower with a slow NAS.
This process is slower with a xbmc client.

This is just guesswork, but I can confirm that video playback start gets slower the more files that exist in the directory.

As a test I opened an mp4 file in a directory on its own from an SMB share over a wifi bridge, and it started in 3 seconds.
I created 3500 zero length files with a txt extension in the same directory, and then played the same file. It took 35 seconds to start.

So, I'd agree flat directory structures are bad for performance.
Reply
#10
Kib, it was a warning - it's not like I removed the section regarding flat file structures. I merely want to advise people to choose wisely - because the issue has plagued me for ages and I would hate anyone else to question everything on their network when simple file structure improves things. I was happy to conduct any testing a few days ago, now I have changed my file structure. I have examined debug logs myself several times, there is never anything of note.

Popcornmix - thank you for doing that quick test. I appreciate it.
Reply
#11
Also Kib, if you want logs you can check out the ones here possibly, they are almost three years old.

http://forum.xbmc.org/showthread.php?tid=100909
Reply



Logout Mark Read Team Forum Stats Members Help
Movie playback issue (long time from selecting file and seeing playback)0
This forum uses Lukasz Tkacz MyBB addons.