bug reading file properties of new files

Post Reply
ajuga
Posts: 13
Joined: Tue Apr 13, 2010 9:08 am

bug reading file properties of new files

Post by ajuga »

- I have version 0.73.4, running as service, scanning directories automatically every 10 minutes. The checkbox media-resources/scanning/read file properties of new files when scanning is checked.

- The UI is not running
- I have a sony bravia 32ex700.

- I put a new file (a .mts file from my camcorder) in one of the watch folders. It appeared on the TV and was playable. So far so good. However, I noticed the duration was unknown, skipping and fastforward did not work.

- So I looked on my server and started the UI. After the program scanned the directories on startup, I could see the file properties were unknown. So I manually clicked 'load file properties', which worked.

It appears there is a bug causing the file properties of the new file not to be read at that time. Perhaps the scanning routine should not mark files as already scanned when it has not read the file properties succesfully.
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: bug reading file properties of new files

Post by Eugene »

ajuga wrote:- I have version 0.73.4, running as service, scanning directories automatically every 10 minutes. The checkbox media-resources/scanning/read file properties of new files when scanning is checked.

- The UI is not running
- I have a sony bravia 32ex700.

- I put a new file (a .mts file from my camcorder) in one of the watch folders. It appeared on the TV and was playable. So far so good. However, I noticed the duration was unknown, skipping and fastforward did not work.

- So I looked on my server and started the UI. After the program scanned the directories on startup, I could see the file properties were unknown. So I manually clicked 'load file properties', which worked.

It appears there is a bug causing the file properties of the new file not to be read at that time. Perhaps the scanning routine should not mark files as already scanned when it has not read the file properties succesfully.
I could not repeat this problem, the server does not include files (open for writing) to the library.
ajuga
Posts: 13
Joined: Tue Apr 13, 2010 9:08 am

Re: bug reading file properties of new files

Post by ajuga »

Perhaps the following will help.

I added some more camcorder files. After adding the files I immediately watched the .mts fragments on my other TV, connected to the same computer via hdmi, using mediaportal. Then later that evening I watched them on my Sony, connected via LAN to WMS. Of the files I watched using mediaportal the file properties missed. Only one file, which I didn't watch immediately had file properties. So I do think its some kind of file locking isssue. Apparently WMS can open it for reading but the file properties tool can not (at that time), because it uses a different open mode.
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: bug reading file properties of new files

Post by Eugene »

ajuga wrote:Perhaps the following will help.

I added some more camcorder files. After adding the files I immediately watched the .mts fragments on my other TV, connected to the same computer via hdmi, using mediaportal. Then later that evening I watched them on my Sony, connected via LAN to WMS. Of the files I watched using mediaportal the file properties missed. Only one file, which I didn't watch immediately had file properties. So I do think its some kind of file locking isssue. Apparently WMS can open it for reading but the file properties tool can not (at that time), because it uses a different open mode.
I could not repeat this problem, but you can use the script processing media resources to read the properties
Settings-Processing-Add
Name - Read Properties
Script:

Code: Select all

var
  i: Integer;
  AllVideoFolder: TWmsScriptMediaItem;
begin
  AllVideoFolder := WmsFindMediaFolder(mfVideoAllMoviesItemID);
  if (AllVideoFolder <> nil) and (AllVideoFolder.ChildCount > 0) then 
    for i := 0 to AllVideoFolder.ChildCount - 1 do    
      if VarToStr(AllVideoFolder.ChildItems[i].Properties[mpiVideoCodec]) = '' then try 
        AllVideoFolder.ChildItems[i].RetrieveProperties;                                       
      except end;
  WmsDatabaseAutoSave; 
  ProcessMediaResult := True      
end.
Setup schedule
ajuga
Posts: 13
Joined: Tue Apr 13, 2010 9:08 am

Re: bug reading file properties of new files

Post by ajuga »

Thanks Eugene! I was searching for a Wms-function but couldn't find it. It didn't occur to me to look at the classes.

Could you nevertheless (in some future version) write debug information of the call to mediainfo.dll to wms.log.
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: bug reading file properties of new files

Post by Eugene »

ajuga wrote:Thanks Eugene! I was searching for a Wms-function but couldn't find it. It didn't occur to me to look at the classes.

Could you nevertheless (in some future version) write debug information of the call to mediainfo.dll to wms.log.
You can try wmsmpeg.exe -i "filename", during watching a movie in MediaPortal
ajuga
Posts: 13
Joined: Tue Apr 13, 2010 9:08 am

Re: bug reading file properties of new files

Post by ajuga »

I've implemented the script but I had to change Properties[mpiVideoCodec] in Properties[mpiTimeLength] to make it work correctly.

Apparently sometimes on a first call to mediainfo.dll the video codec can be identified but the duration can not. Maybe because the file was still being written. This is also what makes it so hard to reproduce.

Mediaportal had nothing to do with it.
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: bug reading file properties of new files

Post by Eugene »

ajuga wrote:I've implemented the script but I had to change Properties[mpiVideoCodec] in Properties[mpiTimeLength] to make it work correctly.

Apparently sometimes on a first call to mediainfo.dll the video codec can be identified but the duration can not. Maybe because the file was still being written. This is also what makes it so hard to reproduce.

Mediaportal had nothing to do with it.
Just for information, WMS does not use mediainfo.dll for read properties.
Post Reply