M2TS AutoThumbnailer Tool
#1
Hi

I was having issues with m2ts thumbnails being created for XBMC.

So i have knocked together a windows service that auto creates the thumbnails in .tbn format for XBMC

you can download this from:

http://www.mediafire.com/?co73odc41bjyi8g

All this does is run as a service in the background and monitors a configured directory for .m2ts files and creates the required thumbnail.

A guide of the below is included in the zip file along with the msi.

M2TS Setup / operation

Once M2TS has been installed the following items are created:

1. C:\Program Files\M2TSThumbnailer
The Contents for the program files directory are:

a. M2TSThumbnailer.exe
b. Generic installstate file created by the installer
c. M2TSThumbailer_Config.rtf

2. The following Windows Service will be created: M2TSThumbnailer
Once the software is installed please stop the service by opening the “Run” dialog box by pressing the windows key on your keyboard + r
Type services.msc and navigate to M2TSthumbnailer.
If you don’t have a windows shortcut key on your keyboard or do not know how to open services.msc please google it ?.

3. Below are the Registry entries created by the service, these are used to configure the service and changing the config will require a restart of the M2TSthumbnailer service to pick up the new settings. To configure the service please go to the path and settings as mentioned below.
To access the windows registry please use the run command and select windows key and r on your keyboard. In the run dialog box type regedit and press enter. Once the registry editor is open navigate to the config path specified in point a.
Please do not amend any other registry keys other than the ones mentioned as you may do harm to your system.

a. Registry path to configuration:
HKEY_LOCAL_MACHINE\Software\M2TSThumbnailer\Config
b. Config Subkey: DirectoryToWatch
Value: The full windows path to the directory that contains the M2TS Content
Example: E:\Home Movies\My HD Content

c. Config Subkey: OutFileExtension
Value: .tbn
Details: ensure the period character . is added so for jpeg place .jpg here, XBMC uses a .tbn extension for its thumbnails,
the .tbn files can be viewed in mspaint or similar application as they are merely .jpeg files with a different extension

d. Config Subkey: SetThumbnailSize
Value: The default is 350x350 which is widthxheight
Please amend this to suit your needs if the size is incorrect for your needs the .tbn files will need to be removed from your directories before it will be recreated as the service will not overwrite files.
NOTE: The service will require a restart to pick up new config details

e. Config Subkey: VideoFileExtension
Value: Default is .m2ts
Detail: This can be any value you prefer ie if your content is m4v please enter this here including the period character .

f. Config Subkey: VideoStartSeconds
Value: Default is 5
Detail: This is how many seconds into the video files the service will create the .tbn file from.
Once the items above have been configured please start the service and check the movie folder for the thumbnails being created.

Enjoy.

For those that are interested the main method (C#) that is executed if you wish to use it for your own scripts is as follows:

Quote: public void CreateThumbNail(FileInfo _File)
{
try
{
//for %i in (*.m2ts) do ffmpeg -i "%i" -f rawvideo -t 00:00:10 -ss 15 -an -vframes 1 -r 1 -vcodec mjpeg -qscale 1 -s 351x450 -y "%~ni.tbn"
String Params = String.Format
(" -i " +_File.Name + " -f rawvideo -ss {0} -an -vframes 1 -r 1 -vcodec mjpeg -qscale 1 -s {1} -y "+Path.GetFileNameWithoutExtension(_File.Name)+"{2}",
ServiceConfig.StartSeconds,
ServiceConfig.ThumbSize,
ServiceConfig.OutFileExtension
);

//create a process info
ProcessStartInfo oInfo = new ProcessStartInfo(Environment.SystemDirectory+"\\ffmpeg.exe",Params);
oInfo.WorkingDirectory = Path.GetDirectoryName(_File.FullName);
oInfo.UseShellExecute = false;
oInfo.CreateNoWindow = true;
oInfo.RedirectStandardOutput = false;
oInfo.RedirectStandardError = false;

//run the process
Process proc = System.Diagnostics.Process.Start(oInfo);

proc.WaitForExit();
}
catch (Exception ex)
{
//MessageBox.Show(ex.Message);
}
}



The obligatory Disclaimer
M2TSThumbnailer software is supplied "as is". The publisher disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The publisher assumes no liability for damages, direct or consequential, which may result from the use of M2TSThumbnailer. The entire risk as to the quality and performance of the software is with you, and you assume the entire cost of any necessary servicing, repair or correction. No Support is provided for M2TSThumbnailer.
Reply

Logout Mark Read Team Forum Stats Members Help
M2TS AutoThumbnailer Tool0