/// <summary> /// The encoding will be started with the per title object and the auto representations set. If the auto /// representation is set, stream configurations will be automatically added to the Per-Title profile. In that case /// at least one PER_TITLE_TEMPLATE stream configuration must be available. All other configurations will be /// automatically chosen by the Per-Title algorithm. All relevant settings for streams and muxings will be taken from /// the closest PER_TITLE_TEMPLATE stream defined. The closest stream will be chosen based on the resolution /// specified in the codec configuration. /// </summary> /// <param name="encoding">The reference of the encoding</param> private static void StartEncoding(Encoding.Encoding encoding) { var h264PerTitleConfig = new H264PerTitleConfiguration { AutoRepresentations = new AutoRepresentation() }; var startEncodingRequest = new StartEncodingRequest { PerTitle = new PerTitle(h264PerTitleConfig), EncodingMode = EncodingMode.THREE_PASS, }; bitmovin.Encoding.Encoding.Start(encoding.Id, startEncodingRequest); var encodingTask = bitmovin.Encoding.Encoding.RetrieveStatus(encoding.Id); // Wait for the encoding to finish while (encodingTask.Status != Status.ERROR && encodingTask.Status != Status.FINISHED) { encodingTask = bitmovin.Encoding.Encoding.RetrieveStatus(encoding.Id); Console.WriteLine("Status: {0}, Progress: {1}%", encodingTask.Status, encodingTask.Progress); Thread.Sleep(5000); } if (encodingTask.Status != Status.FINISHED) { Console.WriteLine("Encoding could not be finished successfully."); return; } }
public PerTitle(H264PerTitleConfiguration configuration) { h264Configuration = configuration; }