Transcode 360 can be easily integrated with other managed code projects. It exposes an interface that provides you with access to the same functionality available to it’s Media Center plug-in.
Open-source, personal and non-commercial projects can utilize this interface without any licensing issue; appropriate portions credit to myself would be appreciated.
ITranscode360 Interface 1.0
The Transcode 360 API is pretty simple, its hosted and accessed using .NET Remoting:
Boolean IsMediaTranscodeComplete(String filePath, Int64 timestamp, out String bufferPath);
This method is called to determine whether or not the movie that has been selected for transcoding has already been transcoded/cached. Provide the file path of the AVI, ISO, or VIDEO_TS that you wish to transcode. Pass ‘0′ as a timestamp - its reserved for future use. If it exists T360 will return true, and pass the file path of the buffered/transcoded file in the bufferPath ouput parameter; this file can be playback with a standard call to PlayMedia.
Boolean IsMediaTranscoding(String filePath, Int64 timestamp, out String bufferPath);
Boolean IsMediaTranscoding(String filePath);
These two methods enable you to determine whether the specified file is currently transcoding. The first override provides the file path to the buffered/transcoding file. As before, you can playback this file with a standard call to PlayMedia.
Boolean Transcode(String filePath, out String bufferPath, Int64 timestamp);
Instructs T360 to transcode the specified AVI, ISO or VIDEO_TS file/folder. The call will block for as long as it takes to setup the request and buffer sufficient content. The call will return with a file path for the buffered/transcoding file, which you can playback with a call to PlayMedia.
Boolean Transcode(String filePath, out String bufferPath, Int64 timestamp,
String audioLanguage, String subtitleLanguage, String profileName);
This override performs much the same function as above, but allows you to specify which audio/subtitles and transcoding profile will be used to produce the resulting MPEG2 program stream.
void StopTranscoding(String filePath);
Simply stops transcoding the specified file.
Sample Code
I’ve built a very simple example that demonstrates setting up a remoting connection and excercising a simple API method.
You can download the C# sample source code here.
You can download the VB.NET sample source code here.
Note: You may wish to change the project so that it references the Transcode360.Interface.dll located in your Transcode 360 installation directory, ensuring compatibility with the build you’re testing against.
