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
Support
Watch / Listen Media
watch/edit Videos
Video thumbnails script
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="MonsterM" data-source="post: 144987" data-attributes="member: 49746"><p>While waiting for a video thumbnail/preview plugin you can use this Jscript to create thumbnails for your movies.</p><p>You need <a href="http://avisynth.org/" target="_blank">Avisynth</a></p><p></p><p>Open notepad, paste the code and save as ThumbnailCreator.<strong>js</strong></p><p>Edit the settings and doubleclick it <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" /> </p><p></p><p>EDIT<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite5" alt=":confused:" title="Confused :confused:" loading="lazy" data-shortname=":confused:" />orry code format is wrong, please download the zip file (next post)</p><p>(Or break the lines js style...)</p><p></p><p>[CODE]/*########## Dirty ThumbnailCreator Script by MonsterMagnet ################################################</p><p>############################################################################################################</p><p></p><p>### Best viewed >= 1024x768</p><p></p><p>### Requires Avisynth 2.5 (http://sourceforge.net/projects/avisynth2/)(tested with 2.56 and 2.57)</p><p>### and mplayer2 (included in WinXP C:\Programme\Windows Media Player\mplayer2.exe).</p><p></p><p>### This script creates thumbnail and preview images from your movies, for use with Mediaportal.</p><p>### Only missing thumbs or previews are created.(so you can run this script every time you add new movies !)</p><p>### 100 movie thumbs and 100 previews are created in 3:10 min (Athlon64 3500).</p><p></p><p>### TIP 1: Try this script with a test movie directory.</p><p>### TIP 2: You can use this script inside Mediaportal with the MyPrograms plugin.</p><p>### TIP 3: In directory: C:\Programme\Team MediaPortal\MediaPortal\Skin\BlueTwo\myvideo.xml change </p><p>### <import>common.facade.video.xml</import> to <import>common.facade.pictures.xml</import> </p><p>### TIP 4: Eventghost.org (open-source automation tool for MS Windows, supports infrared or wireless remotes)</p><p> </p><p>#############################################################################################################</p><p>############ SETTINGS (Edit carefully !!!) ################################################################*/</p><p></p><p>/*----------- Path to AviSynth "DirectShowSource.dll" (double backslashes !) --------------------------------</p><p>-----------------------------------------------------------------------------------------------------------*/</p><p></p><p>var AviSynth = "C:\\Programme\\AviSynth 2.5\\plugins"</p><p></p><p>/*----------- VideoFrame to use as thumbnail (use lower value for small and higher for large files !) -------</p><p>-----------------------------------------------------------------------------------------------------------*/</p><p></p><p>var imageframe = 500</p><p></p><p>/*----------- MediaPortal video title thumbnail directory (double backslashes !) ----------------------------</p><p>-----------------------------------------------------------------------------------------------------------*/</p><p></p><p>var MPdir = "C:\\Programme\\Team MediaPortal\\MediaPortal\\Thumbs\\videos\\Title"</p><p></p><p>/*----------- Directories to scan (double backslashes !, remove leading double slashes for more directories!)</p><p>-----------------------------------------------------------------------------------------------------------*/</p><p></p><p>dirs = new Array();</p><p></p><p>dirs[0] = "F:\\Shared saved\\Movies"</p><p>//dirs[1] = "D:\\Test2"</p><p>//dirs[2] = "E:\\Test3"</p><p>//dirs[3] = "F:\\Test4"</p><p></p><p>/*---------- Mplayer exe path (Only edit if mplayer2 was not found or you want to use another player --------</p><p>------------ (no blanks !, double backslashes !) ------------------------------------------------------------</p><p>-----------------------------------------------------------------------------------------------------------*/</p><p></p><p>var mplayer ="mplayer2.exe"</p><p></p><p>/*############# END SETTINGS ################################################################################</p><p>###########################################################################################################*/</p><p></p><p>var counterS = 0;</p><p>var counterL = 0;</p><p></p><p>var fso = new ActiveXObject("Scripting.FileSystemObject");</p><p>var wshshell = new ActiveXObject("Wscript.shell");</p><p></p><p></p><p>function scan ()</p><p>{</p><p> for (i=0; i < dirs.length; i++)</p><p> { </p><p> scandir (dirs[i])</p><p> }</p><p> wshshell.Popup(counterS + " Thumbnails and " + counterL + " Preview images created", 1, "ThumbnailCreator", 0+64)</p><p>}</p><p></p><p>function scandir( dir )</p><p>{</p><p> if (fso.FolderExists( dir ) == true)</p><p> {</p><p> var srcFolder = fso.GetFolder( dir );</p><p> var files = new Enumerator( srcFolder.files );</p><p></p><p> do </p><p> {</p><p> var ext = fso.GetExtensionName (files.item());</p><p> ext = ext.toLowerCase();</p><p></p><p> if (ext == "avi" || ext == "mpg" || ext == "wmv" || ext == "rmvb" || ext == "mov")</p><p> { </p><p> var search = files.item().name.lastIndexOf(".");</p><p> var part = files.item().name.substring(0,search);</p><p> var thumbS = part + ".jpg";</p><p> var thumbL = part + "L.jpg";</p><p></p><p></p><p> if (fso.FileExists(dir + '\\' + thumbS) == false && fso.FileExists(MPdir + '\\' + thumbS) == false)</p><p> { </p><p> var tf = fso.CreateTextFile(AviSynth + "\\Tempscript.avs",true)</p><p> tf.WriteLine('LoadPlugin ("' +AviSynth+ '\\DirectShowSource.dll")')</p><p> tf.WriteLine('input=(DirectShowSource("'+files.item().path+ '", fps=25, seek=true, audio=false))')</p><p> tf.WriteLine("converttorgb24(input)")</p><p> tf.WriteLine("Crop(16, 16, -16, -16)")</p><p> tf.WriteLine("BilinearResize(128,96)")</p><p> tf.WriteLine('Trim(' + imageframe + ',' + imageframe + ')')</p><p> tf.WriteLine('ImageWriter("' +AviSynth+ '\\" ,0,0,"jpg")')</p><p> tf.Close() </p><p> wshshell.run (mplayer + " /play /close " +AviSynth+ "\\Tempscript.avs",7, true)</p><p> fso.CopyFile (AviSynth + '\\000000.jpg',dir + '\\' + thumbS)</p><p> counterS++;</p><p> }</p><p></p><p> if (fso.FileExists(dir + '\\' + thumbL) == false && fso.FileExists(MPdir + '\\' + thumbL) == false)</p><p> { </p><p> var tf = fso.CreateTextFile(AviSynth + "\\Tempscript.avs",true)</p><p> tf.WriteLine('LoadPlugin ("' +AviSynth+ '\\DirectShowSource.dll")')</p><p> tf.WriteLine('input=(DirectShowSource("'+files.item().path+ '", fps=25, seek=true, audio=false))')</p><p> tf.WriteLine("converttorgb24(input)")</p><p> tf.WriteLine("Crop(16, 16, -16, -16)")</p><p> tf.WriteLine("BilinearResize(512,384)")</p><p> tf.WriteLine('Trim(' + imageframe + ',' + imageframe + ')')</p><p> tf.WriteLine('ImageWriter("' +AviSynth+ '\\" ,0,0,"jpg")')</p><p> tf.Close() </p><p> wshshell.run (mplayer + " /play /close " +AviSynth+ "\\Tempscript.avs",7, true)</p><p> fso.CopyFile (AviSynth + '\\000000.jpg',dir + '\\' + thumbL)</p><p> counterL++;</p><p> }</p><p></p><p> }</p><p></p><p> files.moveNext();</p><p> </p><p> }</p><p></p><p> while (!files.atEnd() ); </p><p></p><p> }</p><p></p><p>}</p><p></p><p>scan()[/CODE]</p></blockquote><p></p>
[QUOTE="MonsterM, post: 144987, member: 49746"] While waiting for a video thumbnail/preview plugin you can use this Jscript to create thumbnails for your movies. You need [URL="http://avisynth.org/"]Avisynth[/URL] Open notepad, paste the code and save as ThumbnailCreator.[B]js[/B] Edit the settings and doubleclick it :D EDIT:Sorry code format is wrong, please download the zip file (next post) (Or break the lines js style...) [CODE]/*########## Dirty ThumbnailCreator Script by MonsterMagnet ################################################ ############################################################################################################ ### Best viewed >= 1024x768 ### Requires Avisynth 2.5 (http://sourceforge.net/projects/avisynth2/)(tested with 2.56 and 2.57) ### and mplayer2 (included in WinXP C:\Programme\Windows Media Player\mplayer2.exe). ### This script creates thumbnail and preview images from your movies, for use with Mediaportal. ### Only missing thumbs or previews are created.(so you can run this script every time you add new movies !) ### 100 movie thumbs and 100 previews are created in 3:10 min (Athlon64 3500). ### TIP 1: Try this script with a test movie directory. ### TIP 2: You can use this script inside Mediaportal with the MyPrograms plugin. ### TIP 3: In directory: C:\Programme\Team MediaPortal\MediaPortal\Skin\BlueTwo\myvideo.xml change ### <import>common.facade.video.xml</import> to <import>common.facade.pictures.xml</import> ### TIP 4: Eventghost.org (open-source automation tool for MS Windows, supports infrared or wireless remotes) ############################################################################################################# ############ SETTINGS (Edit carefully !!!) ################################################################*/ /*----------- Path to AviSynth "DirectShowSource.dll" (double backslashes !) -------------------------------- -----------------------------------------------------------------------------------------------------------*/ var AviSynth = "C:\\Programme\\AviSynth 2.5\\plugins" /*----------- VideoFrame to use as thumbnail (use lower value for small and higher for large files !) ------- -----------------------------------------------------------------------------------------------------------*/ var imageframe = 500 /*----------- MediaPortal video title thumbnail directory (double backslashes !) ---------------------------- -----------------------------------------------------------------------------------------------------------*/ var MPdir = "C:\\Programme\\Team MediaPortal\\MediaPortal\\Thumbs\\videos\\Title" /*----------- Directories to scan (double backslashes !, remove leading double slashes for more directories!) -----------------------------------------------------------------------------------------------------------*/ dirs = new Array(); dirs[0] = "F:\\Shared saved\\Movies" //dirs[1] = "D:\\Test2" //dirs[2] = "E:\\Test3" //dirs[3] = "F:\\Test4" /*---------- Mplayer exe path (Only edit if mplayer2 was not found or you want to use another player -------- ------------ (no blanks !, double backslashes !) ------------------------------------------------------------ -----------------------------------------------------------------------------------------------------------*/ var mplayer ="mplayer2.exe" /*############# END SETTINGS ################################################################################ ###########################################################################################################*/ var counterS = 0; var counterL = 0; var fso = new ActiveXObject("Scripting.FileSystemObject"); var wshshell = new ActiveXObject("Wscript.shell"); function scan () { for (i=0; i < dirs.length; i++) { scandir (dirs[i]) } wshshell.Popup(counterS + " Thumbnails and " + counterL + " Preview images created", 1, "ThumbnailCreator", 0+64) } function scandir( dir ) { if (fso.FolderExists( dir ) == true) { var srcFolder = fso.GetFolder( dir ); var files = new Enumerator( srcFolder.files ); do { var ext = fso.GetExtensionName (files.item()); ext = ext.toLowerCase(); if (ext == "avi" || ext == "mpg" || ext == "wmv" || ext == "rmvb" || ext == "mov") { var search = files.item().name.lastIndexOf("."); var part = files.item().name.substring(0,search); var thumbS = part + ".jpg"; var thumbL = part + "L.jpg"; if (fso.FileExists(dir + '\\' + thumbS) == false && fso.FileExists(MPdir + '\\' + thumbS) == false) { var tf = fso.CreateTextFile(AviSynth + "\\Tempscript.avs",true) tf.WriteLine('LoadPlugin ("' +AviSynth+ '\\DirectShowSource.dll")') tf.WriteLine('input=(DirectShowSource("'+files.item().path+ '", fps=25, seek=true, audio=false))') tf.WriteLine("converttorgb24(input)") tf.WriteLine("Crop(16, 16, -16, -16)") tf.WriteLine("BilinearResize(128,96)") tf.WriteLine('Trim(' + imageframe + ',' + imageframe + ')') tf.WriteLine('ImageWriter("' +AviSynth+ '\\" ,0,0,"jpg")') tf.Close() wshshell.run (mplayer + " /play /close " +AviSynth+ "\\Tempscript.avs",7, true) fso.CopyFile (AviSynth + '\\000000.jpg',dir + '\\' + thumbS) counterS++; } if (fso.FileExists(dir + '\\' + thumbL) == false && fso.FileExists(MPdir + '\\' + thumbL) == false) { var tf = fso.CreateTextFile(AviSynth + "\\Tempscript.avs",true) tf.WriteLine('LoadPlugin ("' +AviSynth+ '\\DirectShowSource.dll")') tf.WriteLine('input=(DirectShowSource("'+files.item().path+ '", fps=25, seek=true, audio=false))') tf.WriteLine("converttorgb24(input)") tf.WriteLine("Crop(16, 16, -16, -16)") tf.WriteLine("BilinearResize(512,384)") tf.WriteLine('Trim(' + imageframe + ',' + imageframe + ')') tf.WriteLine('ImageWriter("' +AviSynth+ '\\" ,0,0,"jpg")') tf.Close() wshshell.run (mplayer + " /play /close " +AviSynth+ "\\Tempscript.avs",7, true) fso.CopyFile (AviSynth + '\\000000.jpg',dir + '\\' + thumbL) counterL++; } } files.moveNext(); } while (!files.atEnd() ); } } scan()[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
Watch / Listen Media
watch/edit Videos
Video thumbnails script
Contact us
RSS
Top
Bottom