Erstellen von Aufträgen - Amazon Elastic Transcoder

Sparen Sie Kosten und erhalten Sie mehr Funktionen mit AWS Elemental MediaConvert

MediaConvert ist ein neuerer dateibasierter Videotranskodierungsdienst, der eine umfassende Suite erweiterter Transcodierungsfunktionen bietet. On-Demand-Tarife beginnen bei 0,0075 USD/Minute. Lesen Sie mehr.

Verwenden Sie bereits Amazon Elastic Transcoder? Es ist einfach, darauf zu migrieren. MediaConvert Weitere Informationen finden Sie in dieser Übersicht, die wertvolle Informationen über den Migrationsprozess und Links zu weiteren Ressourcen enthält.

Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.

Erstellen von Aufträgen

Beschreibung

Um einen Auftrag zu erstellen, senden Sie eine POST-Anfrage an die Ressource /2012-09-25/jobs. Aufträge werden gestartet, sobald sie erstellt werden.

Anmerkung

Sie können Elastic Transcoder so konfigurieren, dass Sie benachrichtigt werden, wenn sich der Status eines Auftrags ändert, z. B. wenn Elastic Transcoder die Verarbeitung eines Auftrags startet und abschließt und wenn Elastic Transcoder auf eine Warn- oder Fehlerbedingung stößt. Weitere Informationen finden Sie unter Erstellen einer Pipeline .

Anforderungen

Syntax

POST /2012-09-25/jobs HTTP/1.1 Content-Type: application/json; charset=UTF-8 Accept: */* Host: elastictranscoder.Elastic Transcoder endpoint.amazonaws.com:443 x-amz-date: 20130114T174952Z Authorization: AWS4-HMAC-SHA256 Credential=AccessKeyID/request-date/Elastic Transcoder endpoint/elastictranscoder/aws4_request, SignedHeaders=host;x-amz-date;x-amz-target, Signature=calculated-signature Content-Length: number of characters in the JSON string { "Inputs":[{ "Key":"name of the file to transcode", "Encryption":{ "Mode":"aes-cbc-pkcs7|aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded decryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, "TimeSpan":{ "StartTime":"starting place of the clip, in HH:mm:ss.SSS or sssss.SSS", "Duration":"duration of the clip, in HH:mm:ss.SSS or sssss.SSS" }, "FrameRate":"auto|10|15|23.97|24|25|29.97|30|50|60", "Resolution":"auto", "AspectRatio":"auto|1:1|4:3|3:2|16:9", "Interlaced":"auto|true|false", "Container":"auto|aac|asf|avi|divx|flv|m4a|mkv|mov|mp2|mp3| mp4|mpeg|mpeg-ps|mpeg-ts|mxf|ogg|vob|wav|webm", "InputCaptions":{ "MergePolicy":"MergeOverride|MergeRetain|Override", "CaptionSources":[ { "Key":"name of the input caption file", "Encryption":{ "Mode":"aes-cbc-pkcs7|aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded encryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, "Language":"language of the input caption file", "TimeOffset":"starting place of the captions, in either [-+]SS.sss or [-+]HH:mm:SS.ss", "Label":"label for the caption" }, {...} ] } }, {...} ] "OutputKeyPrefix":"prefix for file names in Amazon S3 bucket", "Outputs":[{ "Key":"name of the transcoded file", "Encryption":{ "Mode":"s3||aes-cbc-pkcs7|aes-ctr| aes-gcm", "Key":"encrypted and base64-encoded encryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, "ThumbnailPattern":""|"pattern", "Rotate":"auto|0|90|180|270", "PresetId":"preset to use for the job", "SegmentDuration":"[1,60]", "Watermarks":[ { "InputKey":"name of the .png or .jpg file", "Encryption":{ "Mode":"s3||aes-cbc-pkcs7| aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded encryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, "PresetWatermarkId":"value of Video:Watermarks:Id in preset" }, {...} ], "AlbumArt":[ { "AlbumArtMerge":"Replace|Prepend|Append|Fallback", "AlbumArtArtwork":"can be empty, but not null":[ { "AlbumArtInputKey":"name of the file to use as album art", "Encryption":{ "Mode":"s3||aes-cbc-pkcs7| aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded encryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, "AlbumArtMaxWidth":"maximum width of output album art in pixels", "AlbumArtMaxHeight":"maximum height of output album art in pixels", "AlbumArtSizingPolicy":"Fit|Fill|Stretch|Keep| ShrinkToFit|ShrinkToFill", "AlbumArtPaddingPolicy":"Pad|NoPad", "AlbumArtFormat":"jpg|png" }, {...} ] }, {...} ], "Captions":{ "CaptionFormats":[ { "Format":"cea-708|dfxp|mov-text|scc|srt|webvtt", "Pattern":"myCaption/file-language", "Encryption":{ "Mode":"s3||aes-cbc-pkcs7| aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded encryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" } }, {...} ] } }, {...}], "Playlists":[{ "Format":"HLSv3|HLSv4|MPEG-DASH|Smooth", "Name":"name", "OutputKeys":[ "Outputs:Key to include in this playlist", ... ], "HlsContentProtection":{ "Method":"aes-128", "Key":"encrypted and base64-encoded protection key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector", "LicenseAcquisitionUrl":"license acquisition url", "KeyStoragePolicy":"NoStore|WithVariantPlaylists" }, "PlayReadyDrm":{ "Format":"microsoft|discretix-3.0", "Key":"encrypted and base64-encoded DRM key", "KeyId":"id of the DRM key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector", "LicenseAcquisitionUrl":"license acquisition url" } }, {...}], "UserMetadata": { "Key":"Value", "Second user metadata key":"Second user metadata value" }, "PipelineId":"pipeline to use for transcoding" }

Anfrageparameter

Dieser Vorgang verwendet keine Anforderungsparameter.

Anforderungsheader

Für diesen Vorgang werden ausschließlich Anforderungs-Header verwendet, die für alle Vorgänge gelten. Weitere Informationen über allgemeine Anforderungs-Header finden Sie unter Inhalt des HTTP-Headers.

Anforderungstext

Die JSON-Zeichenfolge im Anfragetext enthält die Eingabeobjekte für die CreateJob-Operation. Weitere Informationen zu den Eingabeobjekten finden Sie unter Einstellungen, die Sie angeben, wenn Sie einen Elastic Transcoder Transcoder-Job erstellen.

Antworten

Syntax

Status: 201 Created x-amzn-RequestId: c321ec43-378e-11e2-8e4c-4d5b971203e9 Content-Type: application/json Content-Length: number of characters in the response Date: Mon, 14 Jan 2013 06:01:47 GMT { "Job":{ "Id":"Id that Elastic Transcoder assigns to the job", "Inputs":[{ "Key":"name of the file to transcode", "Encryption":{ "Mode":"aes-cbc-pkcs7|aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded decryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, "TimeSpan":{ "StartTime":"starting place of the clip, in HH:mm:ss.SSS or sssss.SSS", "Duration":"duration of the clip, in HH:mm:ss.SSS or sssss.SSS" }, "FrameRate":"auto|10|15|23.97|24|25|29.97|30|50|60", "Resolution":"auto|width in pixelsxheight in pixels", "AspectRatio":"auto|1:1|4:3|3:2|16:9", "Interlaced":"auto|true|false", "Container":"auto|aac|asf|avi|divx|flv|m4a|mkv|mov|mp2|mp3| mp4|mpeg|mpeg-ps|mpeg-ts|mxf|ogg|vob|wav|webm", "InputCaptions":{ "MergePolicy":"MergeOverride|MergeRetain|Override", "CaptionSources":[ { "Key":"name of the input caption file", "Language":"language of the input caption file", "TimeOffset":"starting place of the captions, in either [-+]SS.sss or [-+]HH:mm:SS.ss", "Label":"label for the caption" "Encryption":{ "Mode":"aes-cbc-pkcs7|aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded decryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, }, {...} ] } }, {...}], "OutputKeyPrefix":"prefix for file names in Amazon S3 bucket", "Outputs":[{ "Id":"sequential counter", "Key":"name of the transcoded file", "Encryption":{ "Mode":"s3||aes-cbc-pkcs7|aes-ctr| aes-gcm", "Key":"encrypted and base64-encoded encryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, "ThumbnailPattern":""|"pattern", "Rotate":"auto|0|90|180|270", "PresetId":"preset to use for the job", "SegmentDuration":"[1,60]", "Watermarks":[ { "InputKey":"name of the .png or .jpg file", "Encryption":{ "Mode":"s3||aes-cbc-pkcs7| aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded encryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, "PresetWatermarkId":"value of Video:Watermarks:Id in preset" }, {...} ], "AlbumArt":[ { "AlbumArtMerge":"Replace|Prepend|Append|Fallback", "AlbumArtArtwork":"can be empty, but not null":[ { "AlbumArtInputKey":"name of the file to use as album art", "Encryption":{ "Mode":"s3||aes-cbc-pkcs7| aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded encryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, "AlbumArtMaxWidth":"maximum width of output album art in pixels", "AlbumArtMaxHeight":"maximum height of output album art in pixels", "AlbumArtSizingPolicy":"Fit|Fill|Stretch|Keep| ShrinkToFit|ShrinkToFill", "AlbumArtPaddingPolicy":"Pad|NoPad", "AlbumArtFormat":"jpg|png" }, {...} ] }, {...} ], "Duration":"duration in seconds", "Width":"width in pixels", "Height":"height in pixels", "Status":"Submitted|Progressing|Complete|Canceled|Error", "StatusDetail":"additional information about job status", "Captions":{ "CaptionFormats":[ { "Format":"cea-708|dfxp|mov-text|scc|srt|webvtt", "Pattern":"myCaption/file-language", "Encryption":{ "Mode":"s3||aes-cbc-pkcs7| aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded encryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" } }, {...} ] }, "AppliedColorSpaceConversion":"None|Bt601ToBt709| Bt709ToBt601" }, {...} ], "Playlists":[ { "Format":"HLSv3|HLSv4|MPEG-DASH|Smooth", "Name":"name", "OutputKeys":[ "Outputs:Key to include in this playlist", ... ], "HlsContentProtection":{ "Method":"aes-128", "Key":"encrypted and base64-encoded protection key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector", "LicenseAcquisitionUrl":"license acquisition url", "KeyStoragePolicy":"NoStore|WithVariantPlaylists" }, "PlayReadyDrm":{ "Format":"microsoft|discretix-3.0", "Key":"encrypted and base64-encoded DRM key", "KeyId":"id of the DRM key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector", "LicenseAcquisitionUrl":"license acquisition url" } }, {...} ], "UserMetadata":{ "key1":"First user metadata value", "key2":"Second user metadata value" }, "PipelineId":"pipeline to add the job to", "Status":"Submitted|Progressing|Complete|Canceled|Error" } }

Antwort-Header

Für diesen Vorgang werden ausschließlich Antwort-Header verwendet, die für die meisten Antworten gelten. Weitere Informationen über allgemeine Antwort-Header finden Sie unter HTTP-Antworten.

Antworttext

Wenn Sie einen Auftrag erstellen, gibt Elastic Transcoder die Werte zurück, die Sie in der Anfrage angegeben haben. Weitere Informationen finden Sie unter Einstellungen, die Sie angeben, wenn Sie einen Elastic Transcoder Transcoder-Job erstellen .

Außerdem gibt Elastic Transcoder die folgenden Werte zurück.

(Automatisch) Id

Die Kennung, die Elastic Transcoder dem Job zugewiesen hat. Diesen Wert können Sie verwenden, um die Einstellungen für den Auftrag abzurufen oder den Auftrag zu löschen.

(Automatisch) Outputs:Id

Ein sequentieller Zähler, beginnend mit 1, der eine Ausgabe zwischen den Ausgängen des aktuellen Jobs identifiziert. In derOutputSyntax ist dieser Wert immer1aus.

(Automatisch) Outputs:Duration

Dauer der Ausgabedatei in Sekunden, aufgerundet.

(Automatisch) Outputs:Width

Breite der Ausgabedatei in Pixeln.

(Automatisch) Outputs:Height

Höhe der Ausgabedatei in Pixeln.

(Automatisch) Outputs:Status

Der Status einer Ausgabe in einem Job. Wenn Sie nur eine Ausgabe für den Job angegeben haben,Outputs:StatusEs ist immer dasselbe wieJob:Statusaus. Wenn Sie mehr als einen Ausgang angegeben haben:

  • Job:StatusundOutputs:Statusfür alle Ausgänge istSubmittedbis Elastic Transcoder beginnt, die erste Ausgabe zu verarbeiten.

  • Wenn Elastic Transcoder beginnt, den ersten Ausgang zu verarbeiten,Outputs:Statusfür diese Ausgabe undJob:StatusBeide wechseln zuProgressingaus. Für jede Ausgabe ist der Wert vonOutputs:StatusbleibtSubmittedbis Elastic Transcoder beginnt, die Ausgabe zu verarbeiten.

  • Job:StatusbleibtProgressingbis alle Ausgänge einen Terminalstatus erreichen, entwederCompleteoderErroraus.

  • Wenn alle Ausgänge einen Terminalstatus erreichen,Job:StatusÄnderungen anCompleteNur wennOutputs:Statusfür alle Ausgänge istCompleteaus. WennOutputs:Statusfür einen oder mehrere Outputs istError, der Terminalstatus fürJob:Status is also Erroraus.

Der Wert vonStatusgehen Sie wie folgt vor:Submitted,Progressing,Complete,Canceled, oderErroraus.

(Automatisch) Outputs:StatusDetail

Informationen, die weiter erklärenOutputs:Statusaus.

(Automatisch) Outputs:AppliedColorSpaceConversion

Wenn Elastic Transcoder eine Voreinstellung mit einemColorSpaceConversionModeum die Ausgabedatei zu transcodieren, wird dieAppliedColorSpaceConversion-Parameter zeigt die verwendete Konvertierung an. Wenn neinColorSpaceConversionModewurde in der Voreinstellung definiert, dieser Parameter wird nicht in die Job-Antwort aufgenommen.

(Automatisch) Status

Wenn Sie mehr als eine Ausgabe für den Job angegeben haben, den Status des gesamten Jobs. Wenn Elastic Transcoder mit der Verarbeitung eines Jobs beginnt, ist der Wert vonJob:StatusÄnderungen anProgressingund ändert sich erst, wenn Elastic Transcoder die Verarbeitung aller Ausgaben abgeschlossen hat. Wenn die Verarbeitung abgeschlossen ist,Job:Statusändert sich entweder inCompleteoder, falls eine der Ausgaben fehlgeschlagen ist,Erroraus.

Wenn Sie nur eine Ausgabe für den Job angegeben haben,Job:Statusist dasselbe wieOutputs:Statusaus.

Der Wert vonJob:Statusgehen Sie wie folgt vor:Submitted,Progressing,Complete,Canceled, oderErroraus.

Fehler

Weitere Informationen über Elastic Transcoder Transcoder-Ausnahmen und -Fehlermeldungen finden Sie unterUmgang mit Fehlern in Elastic Transcoderaus.

Anmerkung

Wenn ein Auftrag mit einem Access Denied-Fehler fehlschlägt, wird empfohlen, die API-Aktion Test Role auszuführen, um die Ursache des Fehlers zu bestimmen. Weitere Informationen finden Sie unter Testrolle .

Beispiele

Mit der folgenden Beispielanfrage wird ein Auftrag mit zwei Ausgaben erstellt.

Beispielanforderung

POST /2012-09-25/jobs HTTP/1.1 Content-Type: application/json; charset=UTF-8 Accept: */* Host: elastictranscoder.Elastic Transcoder endpoint.amazonaws.com:443 x-amz-date: 20130114T174952Z Authorization: AWS4-HMAC-SHA256 Credential=AccessKeyID/request-date/Elastic Transcoder endpoint/elastictranscoder/aws4_request, SignedHeaders=host;x-amz-date;x-amz-target, Signature=calculated-signature Content-Length: number of characters in the JSON string { "Inputs":[{ "Key":"recipes/lasagna.mp4", "FrameRate":"auto", "Resolution":"auto", "AspectRatio":"auto", "Interlaced":"auto", "Container":"mp4", "InputCaptions":{ "MergePolicy":"MergeOverride", "CaptionSources":[ { "Key":"scc/lasagna-kindlefirehd.scc", "Language":"en", "Label":"English" }, { "Key":"srt/lasagna-kindlefirehd.srt", "Language":"fr", "TimeOffset":"1:00:00", "Label":"French" } ] } }] "OutputKeyPrefix":"recipes/", "Outputs":[ { "Key":"mp4/lasagna-kindlefirehd.mp4", "ThumbnailPattern":"mp4/thumbnails/lasagna-{count}", "Rotate":"0", "PresetId":"1351620000000-100080", "Watermarks":[ { "InputKey":"logo/128x64.png", "PresetWatermarkId":"company logo 128x64" } ], "Captions":{ "CaptionFormats":[ { "Format":"scc", "Pattern":"scc/lasagna-{language}" }, { "Format":"srt", "Pattern":"srt/lasagna-{language}", } ] } }, { "Key":"iphone/lasagna-1024k", "ThumbnailPattern":"iphone/th1024k/lasagna-{count}", "Rotate":"0", "PresetId":"1351620000000-987654", "SegmentDuration":"5" }, { "Key":"iphone/lasagna-512k", "ThumbnailPattern":"iphone/th512k/lasagna-{count}", "Rotate":"0", "PresetId":"1351620000000-456789", "SegmentDuration":"5" }, ], "Playlists": [ { "Format": "HLSv3", "Name": "playlist-iPhone-lasagna.m3u8", "OutputKeys": [ "iphone/lasagna-1024k", "iphone/lasagna-512k" ] } ], "UserMetadata": { "Food type":"Italian", "Cook book":"recipe notebook" }, "PipelineId":"1111111111111-abcde1" }

Beispielantwort

Status: 201 Created x-amzn-RequestId: c321ec43-378e-11e2-8e4c-4d5b971203e9 Content-Type: application/json Content-Length: number of characters in the response Date: Mon, 14 Jan 2013 06:01:47 GMT { "Job":{ "Id":"3333333333333-abcde3", "Inputs":[{ "Key":"recipes/lasagna.mp4", "FrameRate":"auto", "Resolution":"auto", "AspectRatio":"auto", "Interlaced":"auto", "Container":"mp4", "InputCaptions":{ "MergePolicy":"MergeOverride", "CaptionSources":[ { "Key":"scc/lasagna-kindlefirehd.scc", "Language":"en", "Label":"English" }, { "Key":"srt/lasagna-kindlefirehd.srt", "Language":"fr", "TimeOffset":"1:00:00", "Label":"French" } ] } }], "Outputs":[ { "Id":"1", "Key":"mp4/lasagna-kindlefirehd.mp4", "ThumbnailPattern":"mp4/thumbnails/lasagna-{count}", "Rotate":"0", "PresetId":"1351620000000-100080", "Watermarks":[ { "InputKey":"logo/128x64.png", "PresetWatermarkId":"company logo 128x64", } ], "Duration":"1003", "Width":"1280", "Height":"720", "Status":"Progressing", "StatusDetail":"", "Captions":{ "CaptionFormats":[ { "Format":"scc", "Pattern":"scc/lasagna-{language}", }, { "Format":"srt", "Pattern":"srt/lasagna-{language}", }, { "Format":"mov-text" } ] } }, { "Id":"2", "Key":"iphone/lasagna-1024k", "ThumbnailPattern":"iphone/th1024k/lasagna-{count}", "Rotate":"0", "PresetId":"1351620000000-987654", "SegmentDuration":"5", "Duration":"1003", "Width":"1136", "Height":"640", "Status":"Progressing", "StatusDetail":"" }, { "Id":"3", "Key":"iphone/lasagna-512k", "ThumbnailPattern":"iphone/th512k/lasagna-{count}", "Rotate":"0", "PresetId":"1351620000000-456789", "SegmentDuration":"5", "Duration":"1003", "Width":"1136", "Height":"640", "Status":"Complete", "StatusDetail":"", "AppliedColorSpaceConversion":"None" } ], "Playlists":[ { "Format":"HLSv3", "Name":"playlist-iPhone-lasagna.m3u8", "OutputKeys": [ "iphone/lasagna-1024k", "iphone/lasagna-512k" ] } ], "UserMetadata": { "Food type":"Italian", "Cook book":"recipe notebook" }, "PipelineId":"1111111111111-abcde1", "Status":"Progressing" } }