home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Recording thumbnails - resolved! :-D
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="glenn 1990" data-source="post: 789042" data-attributes="member: 105566"><p>About the fallback,</p><p></p><p>This is the code to get recording thumbs:</p><p>[CODE]bool succes = VideoThumbCreator.CreateVideoThumb(recFileName, thumbNail, true, true)[/CODE]</p><p></p><p>And this for video thumbs: (fallback code in red)</p><p>[CODE] bool success = VideoThumbCreator.CreateVideoThumb(path, strThumb, true, false);</p><p> [COLOR="Red"] if (!success)</p><p> {</p><p> //Failed due to incompatible format or no write permissions on folder. Try querying Explorer for thumb.</p><p> Log.Warn("Failed to extract thumb for {0}, trying another method.", path);</p><p> if (OSInfo.OSInfo.VistaOrLater())</p><p> {</p><p> thumb = VistaToolbelt.Shell.ThumbnailGenerator.GenerateThumbnail(path); //only works for Vista/7</p><p> }</p><p> else</p><p> {</p><p> using (ThumbnailExtractor extractor = new ThumbnailExtractor())</p><p> {</p><p> thumb = extractor.GetThumbnail(path); //works on XP but not too well threaded</p><p> }[/COLOR]</p><p> }[/CODE]</p><p></p><p>So, why a fallback for videos and not for recordings??</p><p></p><p>And this is the code to get the thums from windows explorer (easy to replace mtn.exe)</p><p>[CODE] try</p><p> {</p><p> using (ShellObject Item = ShellObject.FromParsingName(recording))</p><p> {</p><p> Item.Thumbnail.RetrievalOption = ShellThumbnailRetrievalOption.Default;</p><p> Item.Thumbnail.FormatOption = ShellThumbnailFormatOption.ThumbnailOnly;</p><p> Bitmap _bitmap;</p><p> _bitmap = Item.Thumbnail.LargeBitmap;</p><p> if (_bitmap != null)</p><p> {</p><p> _bitmap.Save(thumbNail, System.Drawing.Imaging.ImageFormat.Jpeg);</p><p> Log.Info("RecordedTV: Thumbnail successfully created for -- {0}", recording);</p><p> }</p><p> }</p><p> }</p><p> catch</p><p> {</p><p> Log.Info("RecordedTV: No thumbnail created for -- {0}", recording);</p><p> }[/CODE]</p><p></p><p></p><p>Maybe we should start another thread about it.</p></blockquote><p></p>
[QUOTE="glenn 1990, post: 789042, member: 105566"] About the fallback, This is the code to get recording thumbs: [CODE]bool succes = VideoThumbCreator.CreateVideoThumb(recFileName, thumbNail, true, true)[/CODE] And this for video thumbs: (fallback code in red) [CODE] bool success = VideoThumbCreator.CreateVideoThumb(path, strThumb, true, false); [COLOR="Red"] if (!success) { //Failed due to incompatible format or no write permissions on folder. Try querying Explorer for thumb. Log.Warn("Failed to extract thumb for {0}, trying another method.", path); if (OSInfo.OSInfo.VistaOrLater()) { thumb = VistaToolbelt.Shell.ThumbnailGenerator.GenerateThumbnail(path); //only works for Vista/7 } else { using (ThumbnailExtractor extractor = new ThumbnailExtractor()) { thumb = extractor.GetThumbnail(path); //works on XP but not too well threaded }[/COLOR] }[/CODE] So, why a fallback for videos and not for recordings?? And this is the code to get the thums from windows explorer (easy to replace mtn.exe) [CODE] try { using (ShellObject Item = ShellObject.FromParsingName(recording)) { Item.Thumbnail.RetrievalOption = ShellThumbnailRetrievalOption.Default; Item.Thumbnail.FormatOption = ShellThumbnailFormatOption.ThumbnailOnly; Bitmap _bitmap; _bitmap = Item.Thumbnail.LargeBitmap; if (_bitmap != null) { _bitmap.Save(thumbNail, System.Drawing.Imaging.ImageFormat.Jpeg); Log.Info("RecordedTV: Thumbnail successfully created for -- {0}", recording); } } } catch { Log.Info("RecordedTV: No thumbnail created for -- {0}", recording); }[/CODE] Maybe we should start another thread about it. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Recording thumbnails - resolved! :-D
Contact us
RSS
Top
Bottom