c# - Using Windows Azure Media Services SDK in .NET, how to encode to a dynamic package using custom encoding parameters instead of a preset string? -
First of all, some background information.
I have a code originally taken from here:
I have made some modifications because the code does not work very well with the box Does. Anyway, the code uploads a source video file in Azure, encodes it using a work preset for the media service encoder, and outputs the URL to the screen for smooth streaming and HLS playback.
The code that creates the encoding task as follows:
I'm not sure but I think this preset D means dynamic packaging. Now, question: How can specify exactly parameters for encoding, such as different video resolution and bitrate for each quality level, then enable the CABAC, B frame, closed GOP and I need a 2-second piece for the smooth streaming of HDS and a 10 second piece. How to get it? Some tell me that I should give some XML formatted string in the job configuration parameters. Tasks.AddNew method If this is true, then what is the recommended method for creating XML? Thank you! You can include the XML file and modify the XML file as per your requirement. You can find the XML file of the "H.264 Adaptive Bitrate MP4 Set SD 16X9" encoding format Itask Encodsksk = Job. Tasks. Aden New ("Encoding", Processor, "H.264 Adaptive Bitrate MP4 SD 16x9 Set", TaskOption.
var inputAsset = context.Assets.Where (a => a.Id = = InputAssetId) .FirstOrDefault (); If (InputAset == empty) leave the new logic Exception ("Could not find SITID:" + InputSetID); Var Encoding Preset = "H.264 Adaptive Bitrate MP3 Set SD 16 X 9"; // & lt; A href = "http://msdn.microsoft.com/en-us/library/windowsazure/jj129582.aspx#H264 encoding" & gt; Http: //msdn.microsoft.com/en-us/library/ windowsazure/jj129582.aspx # H264Encoding & lt; / A & gt; Var Encoding Process Configuration = File Read All Text (@ "D: \ WAMS \ DynamicPekingPopload \ Dynamic Peking Upload \ Dynamic Pekingupload \ Encoding.xml"); Job Job = Ref. Jobs. Create ("encoding" + input accesset. "" From "+ encoding peset); iMedia processor is the latest WiMedia processor = (In context by P. Media Processors, where p.Name ==" Windows Azure Media Encoder "select p) .Oollist (). Order By (Wam => New Version (wame.version)). LastOrDefault (); ITask encodeTask = job.Tasks.AddNew ("Encoding", Latest WameMediaProcessor, Encoding PresetConfig, TaskOptions.None); encodeTask InputAssets.Add (inputAsset); EncodeTask.OutputAssets.AddNew (inputAsset.Name + "as" + Encoding Parset, AssetCreationOptions.None);
Comments
Post a Comment