Wild Media Server Wild Media Server
 
 
 
E-Mail Us
Home Product Info Download Buy Forum Feedback Extend Trial Contact Us Sitemap
 
It is currently Wed Nov 21, 2018 5:41 pm

All times are UTC




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon May 07, 2012 5:36 pm 

Joined: Tue Nov 17, 2009 8:05 pm
Posts: 2901
Required version 1.51

These function and the class may be useful for reading tags of files, that the program does not handle by default (for example in the event "After reading of properties of a media resource").

Example simply display the tags of current media-resource in the List [Movies, Music, Photo]

Settings - Processing - Add
Name: Display Tags
Check "Button on the main form"
Script:

Code:
var
  FileTags: TWmsScriptFileTags;
  TextTags: TStringList; 
  i: Integer; 
  sProviderName, sValue: string;   
begin
  if InputQuery('Provider Name', 'Exif, FFmpeg, MediaInfo, Shell, Wms, Xmp', sProviderName) then begin
    FileTags := WmsCreateMediaItemTags(sProviderName, WmsCurrentMediaListItem);
    if FileTags <> nil then try
      TextTags := TStringList.Create;
      try           
        for i := 0 to FileTags.GetTagCount - 1 do begin
          sValue := VarToStr(FileTags.GetTagValue(FileTags.GetTagID(i)));
          if (sValue <> '') and (Length(sValue) < 100) then 
            TextTags.Add(Format('%s (%s): %s', [FileTags.GetTagName(i), FileTags.GetTagID(i), sValue]));
        end;     
        ShowMessage(TextTags.Text)
      finally
        TextTags.Free
      end                 
    finally 
      FileTags.Free
    end
  end     
end.

Ok - Ok
Select a media-resource - click "Display Tags" - specify a provider name - Ok


Top
   
PostPosted: Tue Jan 22, 2013 1:19 pm 

Joined: Tue Nov 17, 2009 8:05 pm
Posts: 2901
Example of use WmsMediaInfoCreate, for a video track (Stream_Video), the possible values ​​in description of the type TMIStreamKind

Code:
var
  i, iCount: Integer; 
  sValue: string;
  TextTags: TStringList;     
begin
  if WmsCurrentMediaListItem <> nil then begin
    if WmsMediaInfoCreate('', WmsCurrentMediaListItem.ItemID) then begin
      TextTags := TStringList.Create;
      try
        iCount := WmsMediaInfoGetCount(Stream_Video);
        for i := 0 to iCount - 1 do begin 
          sValue := VarToStr(WmsMediaInfoGetI(Stream_Video, 0, i));
          if (sValue <> '') and (Length(sValue) < 100) then 
            TextTags.Add(Format('%s (%s): %s', [
               WmsMediaInfoGetI(Stream_Video, 0, i, Info_Name_Text),
               WmsMediaInfoGetI(Stream_Video, 0, i, Info_Name), sValue]));
        end;   
        ShowMessage(TextTags.Text)
      finally
        TextTags.Free
      end                 
    end
  end     
end.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Copyright 2009-2018 Wild Media Server Powered by phpBB® Forum Software © phpBB Limited