Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

87 Commits

Repository files navigation

Transcoder Extension

Extension for Transcoder app for Windows

Build an app that extends the Transcoder app, adding additional source and target formats. An example Transcoder extension, Animated GIF Creator with full source code is here and is in the Windows Store. You can use the Transcoder.Extension class in your project to help in the implementation of a Transcoder Extension:

publicsealedclassGifCreator:IBackgroundTask{publicasyncvoidRun(IBackgroundTaskInstancetaskInstance){vardeferral=taskInstance.GetDeferral();varlogoFile=awaitPackage.Current.InstalledLocation.GetFileAsync("Assets\\Logo.png");varextension=newTranscoder.Extension{Price=awaitTranscoder.Extension.GetPriceAsync(),SourceType="Video",SourceFormats=newstring[]{".mp4",".mov",".wmv",".avi"},DestinationFormats=newstring[]{".gif"},LogoFile=logoFile,TranscodeAsync=this.TranscodeGifAsync};extension.Run(taskInstance,deferral);}publicIAsyncActionTranscodeGifAsync(StorageFilesource,StorageFiledestination,ValueSetarguments){returnAsyncInfo.Run(asyncdelegate(CancellationTokentoken){
...todo: write transcoding here
});}}

Transcoder Protocol

Create a Windows Universal App that exposes an application service. Read this article on MSDN on how to create and consume an app service. To work in Transcoder, the app service needs to follow a specific protocol, responding to messages that have "Command" properties:

Get Description

Gets the description of the app service

Input

PropertyTypeDescription
CommandString"GetDescription"

Output

PropertyTypeDescription
DisplayNameStringthe localized display name of the hosting application
PublisherNameStringthe localized publisher name of the hosting application
VersionStringthe version of the hosting application in the store
PriceStringthe localized price of the hosting application in the store or "0" for free apps
LogoFileTokenStringthe token for a square .png image at 50x50 px minimum size created by using the SharedStorageAccessManager.AddFile API
SourceTypeString"Audio" or "Video"

Get Source Formats

Get the source formats that the app service supports

Input

PropertyTypeDescription
CommandString"GetSourceFormats"

Output

PropertyTypeDescription
FormatsStringthe source formats that the transcoder takes separated by commas (for example ".wmv,.avi,.mp4")

Get Destination Formats

Gets the destination formats that the app service supports

Input

PropertyTypeDescription
CommandString"GetDestinationFormats"

Output

PropertyTypeDescription
FormatsStringthe destination formats that the transcoder takes separated by commas (for example ".wmv,.avi,.mp4")

Transcode

Input

PropertyTypeDescription
CommandString"Transcode"
FileTokensStringa JSON array containing JSON objects with SourceToken and DestinationToken string properties. The file tokens are generated by using the SharedStorageAccessManager.AddFile API
QualityStringSource, Custom, HD1080p, HD720p, Wvga, Ntsc, Pal, Vga, Qvga
WidthUInt(optional) width of destination file if Quality is "Custom"
HeightUInt(optional) height of destination file if Quality is "Custom"

Output

PropertyTypeDescription
StatusString"OK" if successful, or an error message to show to the user in the case of a problem.

Errors in Extensions

If you use the Transcoder.Extension class, throwing an exception in your extension will show that message in the exception to the user in a Toast notification from Transcoder.

About

Extension for Transcoder app for Windows

Resources

Stars

15 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages