resources.proto 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.video.transcoder.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/duration.proto";
  19. import "google/protobuf/timestamp.proto";
  20. import "google/rpc/status.proto";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1;transcoder";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "ResourcesProto";
  24. option java_package = "com.google.cloud.video.transcoder.v1";
  25. // Transcoding job resource.
  26. message Job {
  27. option (google.api.resource) = {
  28. type: "transcoder.googleapis.com/Job"
  29. pattern: "projects/{project}/locations/{location}/jobs/{job}"
  30. };
  31. // The current state of the job.
  32. enum ProcessingState {
  33. // The processing state is not specified.
  34. PROCESSING_STATE_UNSPECIFIED = 0;
  35. // The job is enqueued and will be picked up for processing soon.
  36. PENDING = 1;
  37. // The job is being processed.
  38. RUNNING = 2;
  39. // The job has been completed successfully.
  40. SUCCEEDED = 3;
  41. // The job has failed. For additional information, see `failure_reason` and
  42. // `failure_details`
  43. FAILED = 4;
  44. }
  45. // The resource name of the job.
  46. // Format: `projects/{project}/locations/{location}/jobs/{job}`
  47. string name = 1;
  48. // Input only. Specify the `input_uri` to populate empty `uri` fields in each element of
  49. // `Job.config.inputs` or `JobTemplate.config.inputs` when using template.
  50. // URI of the media. Input files must be at least 5 seconds in duration and
  51. // stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`).
  52. string input_uri = 2 [(google.api.field_behavior) = INPUT_ONLY];
  53. // Input only. Specify the `output_uri` to populate an empty `Job.config.output.uri` or
  54. // `JobTemplate.config.output.uri` when using template.
  55. // URI for the output file(s). For example, `gs://my-bucket/outputs/`.
  56. string output_uri = 3 [(google.api.field_behavior) = INPUT_ONLY];
  57. // Specify the `job_config` for the transcoding job. If you don't specify the
  58. // `job_config`, the API selects `templateId`; this template ID is set to
  59. // `preset/web-hd` by default. When you use a `template_id` to create a job,
  60. // the `Job.config` is populated by the `JobTemplate.config`.<br>
  61. oneof job_config {
  62. // Input only. Specify the `template_id` to use for populating `Job.config`. The default
  63. // is `preset/web-hd`.
  64. //
  65. // Preset Transcoder templates:
  66. // - `preset/{preset_id}`
  67. //
  68. // - User defined JobTemplate:
  69. // `{job_template_id}`
  70. string template_id = 4 [(google.api.field_behavior) = INPUT_ONLY];
  71. // The configuration for this job.
  72. JobConfig config = 5;
  73. }
  74. // Output only. The current state of the job.
  75. ProcessingState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  76. // Output only. The time the job was created.
  77. google.protobuf.Timestamp create_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  78. // Output only. The time the transcoding started.
  79. google.protobuf.Timestamp start_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  80. // Output only. The time the transcoding finished.
  81. google.protobuf.Timestamp end_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
  82. // Job time to live value in days, which will be effective after job
  83. // completion. Job should be deleted automatically after the given TTL. Enter
  84. // a value between 1 and 90. The default is 30.
  85. int32 ttl_after_completion_days = 15;
  86. // Output only. An error object that describes the reason for the failure.
  87. // This property is always present when `state` is `FAILED`.
  88. google.rpc.Status error = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
  89. }
  90. // Transcoding job template resource.
  91. message JobTemplate {
  92. option (google.api.resource) = {
  93. type: "transcoder.googleapis.com/JobTemplate"
  94. pattern: "projects/{project}/locations/{location}/jobTemplates/{job_template}"
  95. };
  96. // The resource name of the job template.
  97. // Format:
  98. // `projects/{project}/locations/{location}/jobTemplates/{job_template}`
  99. string name = 1;
  100. // The configuration for this template.
  101. JobConfig config = 2;
  102. }
  103. // Job configuration
  104. message JobConfig {
  105. // List of input assets stored in Cloud Storage.
  106. repeated Input inputs = 1;
  107. // List of `Edit atom`s. Defines the ultimate timeline of the resulting
  108. // file or manifest.
  109. repeated EditAtom edit_list = 2;
  110. // List of elementary streams.
  111. repeated ElementaryStream elementary_streams = 3;
  112. // List of multiplexing settings for output streams.
  113. repeated MuxStream mux_streams = 4;
  114. // List of output manifests.
  115. repeated Manifest manifests = 5;
  116. // Output configuration.
  117. Output output = 6;
  118. // List of ad breaks. Specifies where to insert ad break tags in the output
  119. // manifests.
  120. repeated AdBreak ad_breaks = 7;
  121. // Destination on Pub/Sub.
  122. PubsubDestination pubsub_destination = 8;
  123. // List of output sprite sheets.
  124. repeated SpriteSheet sprite_sheets = 9;
  125. // List of overlays on the output video, in descending Z-order.
  126. repeated Overlay overlays = 10;
  127. }
  128. // Input asset.
  129. message Input {
  130. // A unique key for this input. Must be specified when using advanced
  131. // mapping and edit lists.
  132. string key = 1;
  133. // URI of the media. Input files must be at least 5 seconds in duration and
  134. // stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`).
  135. // If empty, the value will be populated from `Job.input_uri`.
  136. string uri = 2;
  137. // Preprocessing configurations.
  138. PreprocessingConfig preprocessing_config = 3;
  139. }
  140. // Location of output file(s) in a Cloud Storage bucket.
  141. message Output {
  142. // URI for the output file(s). For example, `gs://my-bucket/outputs/`.
  143. // If empty the value is populated from `Job.output_uri`.
  144. string uri = 1;
  145. }
  146. // Edit atom.
  147. message EditAtom {
  148. // A unique key for this atom. Must be specified when using advanced
  149. // mapping.
  150. string key = 1;
  151. // List of `Input.key`s identifying files that should be used in this atom.
  152. // The listed `inputs` must have the same timeline.
  153. repeated string inputs = 2;
  154. // End time in seconds for the atom, relative to the input file timeline.
  155. // When `end_time_offset` is not specified, the `inputs` are used until
  156. // the end of the atom.
  157. google.protobuf.Duration end_time_offset = 3;
  158. // Start time in seconds for the atom, relative to the input file timeline.
  159. // The default is `0s`.
  160. google.protobuf.Duration start_time_offset = 4;
  161. }
  162. // Ad break.
  163. message AdBreak {
  164. // Start time in seconds for the ad break, relative to the output file
  165. // timeline. The default is `0s`.
  166. google.protobuf.Duration start_time_offset = 1;
  167. }
  168. // Encoding of an input file such as an audio, video, or text track.
  169. // Elementary streams must be packaged before
  170. // mapping and sharing between different output formats.
  171. message ElementaryStream {
  172. // A unique key for this elementary stream.
  173. string key = 4;
  174. // Encoding of an audio, video, or text track.
  175. oneof elementary_stream {
  176. // Encoding of a video stream.
  177. VideoStream video_stream = 1;
  178. // Encoding of an audio stream.
  179. AudioStream audio_stream = 2;
  180. // Encoding of a text stream. For example, closed captions or subtitles.
  181. TextStream text_stream = 3;
  182. }
  183. }
  184. // Multiplexing settings for output stream.
  185. message MuxStream {
  186. // A unique key for this multiplexed stream. HLS media manifests will be
  187. // named `MuxStream.key` with the `".m3u8"` extension suffix.
  188. string key = 1;
  189. // The name of the generated file. The default is `MuxStream.key` with the
  190. // extension suffix corresponding to the `MuxStream.container`.
  191. //
  192. // Individual segments also have an incremental 10-digit zero-padded suffix
  193. // starting from 0 before the extension, such as `"mux_stream0000000123.ts"`.
  194. string file_name = 2;
  195. // The container format. The default is `"mp4"`
  196. //
  197. // Supported container formats:
  198. // - 'ts'
  199. // - 'fmp4'- the corresponding file extension is `".m4s"`
  200. // - 'mp4'
  201. // - 'vtt'
  202. string container = 3;
  203. // List of `ElementaryStream.key`s multiplexed in this stream.
  204. repeated string elementary_streams = 4;
  205. // Segment settings for `"ts"`, `"fmp4"` and `"vtt"`.
  206. SegmentSettings segment_settings = 5;
  207. // Encryption settings.
  208. Encryption encryption = 6;
  209. }
  210. // Manifest configuration.
  211. message Manifest {
  212. // The manifest type can be either `"HLS"` or `"DASH"`.
  213. enum ManifestType {
  214. // The manifest type is not specified.
  215. MANIFEST_TYPE_UNSPECIFIED = 0;
  216. // Create `"HLS"` manifest. The corresponding file extension is `".m3u8"`.
  217. HLS = 1;
  218. // Create `"DASH"` manifest. The corresponding file extension is `".mpd"`.
  219. DASH = 2;
  220. }
  221. // The name of the generated file. The default is `"manifest"` with the
  222. // extension suffix corresponding to the `Manifest.type`.
  223. string file_name = 1;
  224. // Required. Type of the manifest, can be "HLS" or "DASH".
  225. ManifestType type = 2 [(google.api.field_behavior) = REQUIRED];
  226. // Required. List of user given `MuxStream.key`s that should appear in this manifest.
  227. //
  228. // When `Manifest.type` is `HLS`, a media manifest with name `MuxStream.key`
  229. // and `.m3u8` extension is generated for each element of the
  230. // `Manifest.mux_streams`.
  231. repeated string mux_streams = 3 [(google.api.field_behavior) = REQUIRED];
  232. }
  233. // A Pub/Sub destination.
  234. message PubsubDestination {
  235. // The name of the Pub/Sub topic to publish job completion notification
  236. // to. For example: `projects/{project}/topics/{topic}`.
  237. string topic = 1;
  238. }
  239. // Sprite sheet configuration.
  240. message SpriteSheet {
  241. // Format type. The default is `"jpeg"`.
  242. //
  243. // Supported formats:
  244. // - 'jpeg'
  245. string format = 1;
  246. // Required. File name prefix for the generated sprite sheets.
  247. //
  248. // Each sprite sheet has an incremental 10-digit zero-padded suffix starting
  249. // from 0 before the extension, such as `"sprite_sheet0000000123.jpeg"`.
  250. string file_prefix = 2 [(google.api.field_behavior) = REQUIRED];
  251. // Required. The width of sprite in pixels. Must be an even integer. To preserve the
  252. // source aspect ratio, set the [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels] field or
  253. // the [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels] field, but not both (the API will
  254. // automatically calculate the missing field).
  255. int32 sprite_width_pixels = 3 [(google.api.field_behavior) = REQUIRED];
  256. // Required. The height of sprite in pixels. Must be an even integer. To preserve the
  257. // source aspect ratio, set the [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels] field or
  258. // the [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels] field, but not both (the API will
  259. // automatically calculate the missing field).
  260. int32 sprite_height_pixels = 4 [(google.api.field_behavior) = REQUIRED];
  261. // The maximum number of sprites per row in a sprite sheet. The default is 0,
  262. // which indicates no maximum limit.
  263. int32 column_count = 5;
  264. // The maximum number of rows per sprite sheet. When the sprite sheet is full,
  265. // a new sprite sheet is created. The default is 0, which indicates no maximum
  266. // limit.
  267. int32 row_count = 6;
  268. // Start time in seconds, relative to the output file timeline. Determines the
  269. // first sprite to pick. The default is `0s`.
  270. google.protobuf.Duration start_time_offset = 7;
  271. // End time in seconds, relative to the output file timeline. When
  272. // `end_time_offset` is not specified, the sprites are generated until the end
  273. // of the output file.
  274. google.protobuf.Duration end_time_offset = 8;
  275. // Specify either total number of sprites or interval to create sprites.
  276. oneof extraction_strategy {
  277. // Total number of sprites. Create the specified number of sprites
  278. // distributed evenly across the timeline of the output media. The default
  279. // is 100.
  280. int32 total_count = 9;
  281. // Starting from `0s`, create sprites at regular intervals. Specify the
  282. // interval value in seconds.
  283. google.protobuf.Duration interval = 10;
  284. }
  285. // The quality of the generated sprite sheet. Enter a value between 1
  286. // and 100, where 1 is the lowest quality and 100 is the highest quality.
  287. // The default is 100. A high quality value corresponds to a low image data
  288. // compression ratio.
  289. int32 quality = 11;
  290. }
  291. // Overlay configuration.
  292. message Overlay {
  293. // 2D normalized coordinates. Default: `{0.0, 0.0}`
  294. message NormalizedCoordinate {
  295. // Normalized x coordinate.
  296. double x = 1;
  297. // Normalized y coordinate.
  298. double y = 2;
  299. }
  300. // Overlaid jpeg image.
  301. message Image {
  302. // Required. URI of the JPEG image in Cloud Storage. For example,
  303. // `gs://bucket/inputs/image.jpeg`. JPEG is the only supported image type.
  304. string uri = 1 [(google.api.field_behavior) = REQUIRED];
  305. // Normalized image resolution, based on output video resolution. Valid
  306. // values: `0.0`–`1.0`. To respect the original image aspect ratio, set
  307. // either `x` or `y` to `0.0`. To use the original image resolution, set
  308. // both `x` and `y` to `0.0`.
  309. NormalizedCoordinate resolution = 2;
  310. // Target image opacity. Valid values are from `1.0` (solid, default) to
  311. // `0.0` (transparent), exclusive. Set this to a value greater than `0.0`.
  312. double alpha = 3;
  313. }
  314. // Display static overlay object.
  315. message AnimationStatic {
  316. // Normalized coordinates based on output video resolution. Valid
  317. // values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
  318. // object. For example, use the x and y coordinates {0,0} to position the
  319. // top-left corner of the overlay animation in the top-left corner of the
  320. // output video.
  321. NormalizedCoordinate xy = 1;
  322. // The time to start displaying the overlay object, in seconds. Default: 0
  323. google.protobuf.Duration start_time_offset = 2;
  324. }
  325. // Display overlay object with fade animation.
  326. message AnimationFade {
  327. // Required. Type of fade animation: `FADE_IN` or `FADE_OUT`.
  328. FadeType fade_type = 1 [(google.api.field_behavior) = REQUIRED];
  329. // Normalized coordinates based on output video resolution. Valid
  330. // values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
  331. // object. For example, use the x and y coordinates {0,0} to position the
  332. // top-left corner of the overlay animation in the top-left corner of the
  333. // output video.
  334. NormalizedCoordinate xy = 2;
  335. // The time to start the fade animation, in seconds. Default: 0
  336. google.protobuf.Duration start_time_offset = 3;
  337. // The time to end the fade animation, in seconds. Default:
  338. // `start_time_offset` + 1s
  339. google.protobuf.Duration end_time_offset = 4;
  340. }
  341. // End previous overlay animation from the video. Without AnimationEnd, the
  342. // overlay object will keep the state of previous animation until the end of
  343. // the video.
  344. message AnimationEnd {
  345. // The time to end overlay object, in seconds. Default: 0
  346. google.protobuf.Duration start_time_offset = 1;
  347. }
  348. // Animation types.
  349. message Animation {
  350. // Animations can be static or fade, or they can end the previous animation.
  351. oneof animation_type {
  352. // Display static overlay object.
  353. AnimationStatic animation_static = 1;
  354. // Display overlay object with fade animation.
  355. AnimationFade animation_fade = 2;
  356. // End previous animation.
  357. AnimationEnd animation_end = 3;
  358. }
  359. }
  360. // Fade type for the overlay: `FADE_IN` or `FADE_OUT`.
  361. enum FadeType {
  362. // The fade type is not specified.
  363. FADE_TYPE_UNSPECIFIED = 0;
  364. // Fade the overlay object into view.
  365. FADE_IN = 1;
  366. // Fade the overlay object out of view.
  367. FADE_OUT = 2;
  368. }
  369. // Image overlay.
  370. Image image = 1;
  371. // List of Animations. The list should be chronological, without any time
  372. // overlap.
  373. repeated Animation animations = 2;
  374. }
  375. // Preprocessing configurations.
  376. message PreprocessingConfig {
  377. // Color preprocessing configuration.
  378. message Color {
  379. // Control color saturation of the video. Enter a value between -1 and 1,
  380. // where -1 is fully desaturated and 1 is maximum saturation. 0 is no
  381. // change. The default is 0.
  382. double saturation = 1;
  383. // Control black and white contrast of the video. Enter a value between -1
  384. // and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no
  385. // change. The default is 0.
  386. double contrast = 2;
  387. // Control brightness of the video. Enter a value between -1 and 1, where -1
  388. // is minimum brightness and 1 is maximum brightness. 0 is no change. The
  389. // default is 0.
  390. double brightness = 3;
  391. }
  392. // Denoise preprocessing configuration.
  393. message Denoise {
  394. // Set strength of the denoise. Enter a value between 0 and 1. The higher
  395. // the value, the smoother the image. 0 is no denoising. The default is 0.
  396. double strength = 1;
  397. // Set the denoiser mode. The default is `"standard"`.
  398. //
  399. // Supported denoiser modes:
  400. // - 'standard'
  401. // - 'grain'
  402. string tune = 2;
  403. }
  404. // Deblock preprocessing configuration.
  405. message Deblock {
  406. // Set strength of the deblocker. Enter a value between 0 and 1. The higher
  407. // the value, the stronger the block removal. 0 is no deblocking. The
  408. // default is 0.
  409. double strength = 1;
  410. // Enable deblocker. The default is `false`.
  411. bool enabled = 2;
  412. }
  413. // Audio preprocessing configuration.
  414. message Audio {
  415. // Specify audio loudness normalization in loudness units relative to full
  416. // scale (LUFS). Enter a value between -24 and 0 (the default), where:
  417. //
  418. // * -24 is the Advanced Television Systems Committee (ATSC A/85) standard
  419. // * -23 is the EU R128 broadcast standard
  420. // * -19 is the prior standard for online mono audio
  421. // * -18 is the ReplayGain standard
  422. // * -16 is the prior standard for stereo audio
  423. // * -14 is the new online audio standard recommended by Spotify, as well
  424. // as Amazon Echo
  425. // * 0 disables normalization
  426. double lufs = 1;
  427. // Enable boosting high frequency components. The default is `false`.
  428. bool high_boost = 2;
  429. // Enable boosting low frequency components. The default is `false`.
  430. bool low_boost = 3;
  431. }
  432. // Video cropping configuration for the input video. The cropped input video
  433. // is scaled to match the output resolution.
  434. message Crop {
  435. // The number of pixels to crop from the top. The default is 0.
  436. int32 top_pixels = 1;
  437. // The number of pixels to crop from the bottom. The default is 0.
  438. int32 bottom_pixels = 2;
  439. // The number of pixels to crop from the left. The default is 0.
  440. int32 left_pixels = 3;
  441. // The number of pixels to crop from the right. The default is 0.
  442. int32 right_pixels = 4;
  443. }
  444. // Pad filter configuration for the input video. The padded input video
  445. // is scaled after padding with black to match the output resolution.
  446. message Pad {
  447. // The number of pixels to add to the top. The default is 0.
  448. int32 top_pixels = 1;
  449. // The number of pixels to add to the bottom. The default is 0.
  450. int32 bottom_pixels = 2;
  451. // The number of pixels to add to the left. The default is 0.
  452. int32 left_pixels = 3;
  453. // The number of pixels to add to the right. The default is 0.
  454. int32 right_pixels = 4;
  455. }
  456. // Color preprocessing configuration.
  457. Color color = 1;
  458. // Denoise preprocessing configuration.
  459. Denoise denoise = 2;
  460. // Deblock preprocessing configuration.
  461. Deblock deblock = 3;
  462. // Audio preprocessing configuration.
  463. Audio audio = 4;
  464. // Specify the video cropping configuration.
  465. Crop crop = 5;
  466. // Specify the video pad filter configuration.
  467. Pad pad = 6;
  468. }
  469. // Video stream resource.
  470. message VideoStream {
  471. // H264 codec settings.
  472. message H264CodecSettings {
  473. // The width of the video in pixels. Must be an even integer.
  474. // When not specified, the width is adjusted to match the specified height
  475. // and input aspect ratio. If both are omitted, the input width is used.
  476. int32 width_pixels = 1;
  477. // The height of the video in pixels. Must be an even integer.
  478. // When not specified, the height is adjusted to match the specified width
  479. // and input aspect ratio. If both are omitted, the input height is used.
  480. int32 height_pixels = 2;
  481. // Required. The target video frame rate in frames per second (FPS). Must be less than
  482. // or equal to 120. Will default to the input frame rate if larger than the
  483. // input frame rate. The API will generate an output FPS that is divisible
  484. // by the input FPS, and smaller or equal to the target FPS. See
  485. // [Calculating frame
  486. // rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for
  487. // more information.
  488. double frame_rate = 3 [(google.api.field_behavior) = REQUIRED];
  489. // Required. The video bitrate in bits per second. Must be between 1 and
  490. // 1,000,000,000.
  491. int32 bitrate_bps = 4 [(google.api.field_behavior) = REQUIRED];
  492. // Pixel format to use. The default is `"yuv420p"`.
  493. //
  494. // Supported pixel formats:
  495. // - 'yuv420p' pixel format.
  496. // - 'yuv422p' pixel format.
  497. // - 'yuv444p' pixel format.
  498. // - 'yuv420p10' 10-bit HDR pixel format.
  499. // - 'yuv422p10' 10-bit HDR pixel format.
  500. // - 'yuv444p10' 10-bit HDR pixel format.
  501. // - 'yuv420p12' 12-bit HDR pixel format.
  502. // - 'yuv422p12' 12-bit HDR pixel format.
  503. // - 'yuv444p12' 12-bit HDR pixel format.
  504. string pixel_format = 5;
  505. // Specify the `rate_control_mode`. The default is `"vbr"`.
  506. //
  507. // Supported rate control modes:
  508. // - 'vbr' - variable bitrate
  509. // - 'crf' - constant rate factor
  510. string rate_control_mode = 6;
  511. // Target CRF level. Must be between 10 and 36, where 10 is the highest
  512. // quality and 36 is the most efficient compression. The default is 21.
  513. int32 crf_level = 7;
  514. // Specifies whether an open Group of Pictures (GOP) structure should be
  515. // allowed or not. The default is `false`.
  516. bool allow_open_gop = 8;
  517. // GOP mode can be either by frame count or duration.
  518. oneof gop_mode {
  519. // Select the GOP size based on the specified frame count. Must be greater
  520. // than zero.
  521. int32 gop_frame_count = 9;
  522. // Select the GOP size based on the specified duration. The default is
  523. // `"3s"`. Note that `gopDuration` must be less than or equal to
  524. // [`segmentDuration`](#SegmentSettings), and
  525. // [`segmentDuration`](#SegmentSettings) must be divisible by
  526. // `gopDuration`.
  527. google.protobuf.Duration gop_duration = 10;
  528. }
  529. // Use two-pass encoding strategy to achieve better video quality.
  530. // `VideoStream.rate_control_mode` must be `"vbr"`. The default is `false`.
  531. bool enable_two_pass = 11;
  532. // Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
  533. // greater than zero. The default is equal to `VideoStream.bitrate_bps`.
  534. int32 vbv_size_bits = 12;
  535. // Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
  536. // Must be greater than zero. The default is equal to 90% of
  537. // `VideoStream.vbv_size_bits`.
  538. int32 vbv_fullness_bits = 13;
  539. // The entropy coder to use. The default is `"cabac"`.
  540. //
  541. // Supported entropy coders:
  542. // - 'cavlc'
  543. // - 'cabac'
  544. string entropy_coder = 14;
  545. // Allow B-pyramid for reference frame selection. This may not be supported
  546. // on all decoders. The default is `false`.
  547. bool b_pyramid = 15;
  548. // The number of consecutive B-frames. Must be greater than or equal to
  549. // zero. Must be less than `VideoStream.gop_frame_count` if set. The default
  550. // is 0.
  551. int32 b_frame_count = 16;
  552. // Specify the intensity of the adaptive quantizer (AQ). Must be between 0
  553. // and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
  554. // higher value equals a lower bitrate but smoother image. The default is 0.
  555. double aq_strength = 17;
  556. // Enforces the specified codec profile. The following profiles are
  557. // supported:
  558. //
  559. // * `baseline`
  560. // * `main`
  561. // * `high` (default)
  562. //
  563. // The available options are
  564. // [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile){:
  565. // class="external" }. Note that certain values for this field may cause the
  566. // transcoder to override other fields you set in the `H264CodecSettings`
  567. // message.
  568. string profile = 18;
  569. // Enforces the specified codec tune. The available options are
  570. // [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune){:
  571. // class="external" }. Note that certain values for this field may cause the
  572. // transcoder to override other fields you set in the `H264CodecSettings`
  573. // message.
  574. string tune = 19;
  575. // Enforces the specified codec preset. The default is `veryfast`. The
  576. // available options are
  577. // [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Preset){:
  578. // class="external" }. Note that certain values for this field may cause the
  579. // transcoder to override other fields you set in the `H264CodecSettings`
  580. // message.
  581. string preset = 20;
  582. }
  583. // H265 codec settings.
  584. message H265CodecSettings {
  585. // The width of the video in pixels. Must be an even integer.
  586. // When not specified, the width is adjusted to match the specified height
  587. // and input aspect ratio. If both are omitted, the input width is used.
  588. int32 width_pixels = 1;
  589. // The height of the video in pixels. Must be an even integer.
  590. // When not specified, the height is adjusted to match the specified width
  591. // and input aspect ratio. If both are omitted, the input height is used.
  592. int32 height_pixels = 2;
  593. // Required. The target video frame rate in frames per second (FPS). Must be less than
  594. // or equal to 120. Will default to the input frame rate if larger than the
  595. // input frame rate. The API will generate an output FPS that is divisible
  596. // by the input FPS, and smaller or equal to the target FPS. See
  597. // [Calculating frame
  598. // rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for
  599. // more information.
  600. double frame_rate = 3 [(google.api.field_behavior) = REQUIRED];
  601. // Required. The video bitrate in bits per second. Must be between 1 and
  602. // 1,000,000,000.
  603. int32 bitrate_bps = 4 [(google.api.field_behavior) = REQUIRED];
  604. // Pixel format to use. The default is `"yuv420p"`.
  605. //
  606. // Supported pixel formats:
  607. // - 'yuv420p' pixel format.
  608. // - 'yuv422p' pixel format.
  609. // - 'yuv444p' pixel format.
  610. // - 'yuv420p10' 10-bit HDR pixel format.
  611. // - 'yuv422p10' 10-bit HDR pixel format.
  612. // - 'yuv444p10' 10-bit HDR pixel format.
  613. // - 'yuv420p12' 12-bit HDR pixel format.
  614. // - 'yuv422p12' 12-bit HDR pixel format.
  615. // - 'yuv444p12' 12-bit HDR pixel format.
  616. string pixel_format = 5;
  617. // Specify the `rate_control_mode`. The default is `"vbr"`.
  618. //
  619. // Supported rate control modes:
  620. // - 'vbr' - variable bitrate
  621. // - 'crf' - constant rate factor
  622. string rate_control_mode = 6;
  623. // Target CRF level. Must be between 10 and 36, where 10 is the highest
  624. // quality and 36 is the most efficient compression. The default is 21.
  625. int32 crf_level = 7;
  626. // Specifies whether an open Group of Pictures (GOP) structure should be
  627. // allowed or not. The default is `false`.
  628. bool allow_open_gop = 8;
  629. // GOP mode can be either by frame count or duration.
  630. oneof gop_mode {
  631. // Select the GOP size based on the specified frame count. Must be greater
  632. // than zero.
  633. int32 gop_frame_count = 9;
  634. // Select the GOP size based on the specified duration. The default is
  635. // `"3s"`. Note that `gopDuration` must be less than or equal to
  636. // [`segmentDuration`](#SegmentSettings), and
  637. // [`segmentDuration`](#SegmentSettings) must be divisible by
  638. // `gopDuration`.
  639. google.protobuf.Duration gop_duration = 10;
  640. }
  641. // Use two-pass encoding strategy to achieve better video quality.
  642. // `VideoStream.rate_control_mode` must be `"vbr"`. The default is `false`.
  643. bool enable_two_pass = 11;
  644. // Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
  645. // greater than zero. The default is equal to `VideoStream.bitrate_bps`.
  646. int32 vbv_size_bits = 12;
  647. // Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
  648. // Must be greater than zero. The default is equal to 90% of
  649. // `VideoStream.vbv_size_bits`.
  650. int32 vbv_fullness_bits = 13;
  651. // Allow B-pyramid for reference frame selection. This may not be supported
  652. // on all decoders. The default is `false`.
  653. bool b_pyramid = 14;
  654. // The number of consecutive B-frames. Must be greater than or equal to
  655. // zero. Must be less than `VideoStream.gop_frame_count` if set. The default
  656. // is 0.
  657. int32 b_frame_count = 15;
  658. // Specify the intensity of the adaptive quantizer (AQ). Must be between 0
  659. // and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
  660. // higher value equals a lower bitrate but smoother image. The default is 0.
  661. double aq_strength = 16;
  662. // Enforces the specified codec profile. The following profiles are
  663. // supported:
  664. //
  665. // 8bit profiles
  666. // * `main` (default)
  667. // * `main-intra`
  668. // * `mainstillpicture`
  669. //
  670. // 10bit profiles
  671. // * `main10` (default)
  672. // * `main10-intra`
  673. // * `main422-10`
  674. // * `main422-10-intra`
  675. // * `main444-10`
  676. // * `main444-10-intra`
  677. //
  678. // 12bit profiles
  679. // * `main12` (default)
  680. // * `main12-intra`
  681. // * `main422-12`
  682. // * `main422-12-intra`
  683. // * `main444-12`
  684. // * `main444-12-intra`
  685. //
  686. // The available options are
  687. // [FFmpeg-compatible](https://x265.readthedocs.io/){:
  688. // class="external" }. Note that certain values for this field may cause the
  689. // transcoder to override other fields you set in the `H265CodecSettings`
  690. // message.
  691. string profile = 17;
  692. // Enforces the specified codec tune. The available options are
  693. // [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265){:
  694. // class="external" }. Note that certain values for this field may cause the
  695. // transcoder to override other fields you set in the `H265CodecSettings`
  696. // message.
  697. string tune = 18;
  698. // Enforces the specified codec preset. The default is `veryfast`. The
  699. // available options are
  700. // [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265){:
  701. // class="external" }. Note that certain values for this field may cause the
  702. // transcoder to override other fields you set in the `H265CodecSettings`
  703. // message.
  704. string preset = 19;
  705. }
  706. // VP9 codec settings.
  707. message Vp9CodecSettings {
  708. // The width of the video in pixels. Must be an even integer.
  709. // When not specified, the width is adjusted to match the specified height
  710. // and input aspect ratio. If both are omitted, the input width is used.
  711. int32 width_pixels = 1;
  712. // The height of the video in pixels. Must be an even integer.
  713. // When not specified, the height is adjusted to match the specified width
  714. // and input aspect ratio. If both are omitted, the input height is used.
  715. int32 height_pixels = 2;
  716. // Required. The target video frame rate in frames per second (FPS). Must be less than
  717. // or equal to 120. Will default to the input frame rate if larger than the
  718. // input frame rate. The API will generate an output FPS that is divisible
  719. // by the input FPS, and smaller or equal to the target FPS. See
  720. // [Calculating frame
  721. // rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for
  722. // more information.
  723. double frame_rate = 3 [(google.api.field_behavior) = REQUIRED];
  724. // Required. The video bitrate in bits per second. Must be between 1 and
  725. // 1,000,000,000.
  726. int32 bitrate_bps = 4 [(google.api.field_behavior) = REQUIRED];
  727. // Pixel format to use. The default is `"yuv420p"`.
  728. //
  729. // Supported pixel formats:
  730. // - 'yuv420p' pixel format.
  731. // - 'yuv422p' pixel format.
  732. // - 'yuv444p' pixel format.
  733. // - 'yuv420p10' 10-bit HDR pixel format.
  734. // - 'yuv422p10' 10-bit HDR pixel format.
  735. // - 'yuv444p10' 10-bit HDR pixel format.
  736. // - 'yuv420p12' 12-bit HDR pixel format.
  737. // - 'yuv422p12' 12-bit HDR pixel format.
  738. // - 'yuv444p12' 12-bit HDR pixel format.
  739. string pixel_format = 5;
  740. // Specify the `rate_control_mode`. The default is `"vbr"`.
  741. //
  742. // Supported rate control modes:
  743. // - 'vbr' - variable bitrate
  744. // - 'crf' - constant rate factor
  745. string rate_control_mode = 6;
  746. // Target CRF level. Must be between 10 and 36, where 10 is the highest
  747. // quality and 36 is the most efficient compression. The default is 21.
  748. int32 crf_level = 7;
  749. // GOP mode can be either by frame count or duration.
  750. oneof gop_mode {
  751. // Select the GOP size based on the specified frame count. Must be greater
  752. // than zero.
  753. int32 gop_frame_count = 8;
  754. // Select the GOP size based on the specified duration. The default is
  755. // `"3s"`. Note that `gopDuration` must be less than or equal to
  756. // [`segmentDuration`](#SegmentSettings), and
  757. // [`segmentDuration`](#SegmentSettings) must be divisible by
  758. // `gopDuration`.
  759. google.protobuf.Duration gop_duration = 9;
  760. }
  761. // Enforces the specified codec profile. The following profiles are
  762. // supported:
  763. //
  764. // * `profile0` (default)
  765. // * `profile1`
  766. // * `profile2`
  767. // * `profile3`
  768. //
  769. // The available options are
  770. // [WebM-compatible](https://www.webmproject.org/vp9/profiles/){:
  771. // class="external" }. Note that certain values for this field may cause the
  772. // transcoder to override other fields you set in the `Vp9CodecSettings`
  773. // message.
  774. string profile = 10;
  775. }
  776. // Codec settings can be h264, h265, or vp9.
  777. oneof codec_settings {
  778. // H264 codec settings.
  779. H264CodecSettings h264 = 1;
  780. // H265 codec settings.
  781. H265CodecSettings h265 = 2;
  782. // VP9 codec settings.
  783. Vp9CodecSettings vp9 = 3;
  784. }
  785. }
  786. // Audio stream resource.
  787. message AudioStream {
  788. // The mapping for the `Job.edit_list` atoms with audio `EditAtom.inputs`.
  789. message AudioMapping {
  790. // Required. The `EditAtom.key` that references the atom with audio inputs in the
  791. // `Job.edit_list`.
  792. string atom_key = 1 [(google.api.field_behavior) = REQUIRED];
  793. // Required. The `Input.key` that identifies the input file.
  794. string input_key = 2 [(google.api.field_behavior) = REQUIRED];
  795. // Required. The zero-based index of the track in the input file.
  796. int32 input_track = 3 [(google.api.field_behavior) = REQUIRED];
  797. // Required. The zero-based index of the channel in the input audio stream.
  798. int32 input_channel = 4 [(google.api.field_behavior) = REQUIRED];
  799. // Required. The zero-based index of the channel in the output audio stream.
  800. int32 output_channel = 5 [(google.api.field_behavior) = REQUIRED];
  801. // Audio volume control in dB. Negative values decrease volume,
  802. // positive values increase. The default is 0.
  803. double gain_db = 6;
  804. }
  805. // The codec for this audio stream. The default is `"aac"`.
  806. //
  807. // Supported audio codecs:
  808. // - 'aac'
  809. // - 'aac-he'
  810. // - 'aac-he-v2'
  811. // - 'mp3'
  812. // - 'ac3'
  813. // - 'eac3'
  814. string codec = 1;
  815. // Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000.
  816. int32 bitrate_bps = 2 [(google.api.field_behavior) = REQUIRED];
  817. // Number of audio channels. Must be between 1 and 6. The default is 2.
  818. int32 channel_count = 3;
  819. // A list of channel names specifying layout of the audio channels.
  820. // This only affects the metadata embedded in the container headers, if
  821. // supported by the specified format. The default is `["fl", "fr"]`.
  822. //
  823. // Supported channel names:
  824. // - 'fl' - Front left channel
  825. // - 'fr' - Front right channel
  826. // - 'sl' - Side left channel
  827. // - 'sr' - Side right channel
  828. // - 'fc' - Front center channel
  829. // - 'lfe' - Low frequency
  830. repeated string channel_layout = 4;
  831. // The mapping for the `Job.edit_list` atoms with audio `EditAtom.inputs`.
  832. repeated AudioMapping mapping = 5;
  833. // The audio sample rate in Hertz. The default is 48000 Hertz.
  834. int32 sample_rate_hertz = 6;
  835. }
  836. // Encoding of a text stream. For example, closed captions or subtitles.
  837. message TextStream {
  838. // The mapping for the `Job.edit_list` atoms with text `EditAtom.inputs`.
  839. message TextMapping {
  840. // Required. The `EditAtom.key` that references atom with text inputs in the
  841. // `Job.edit_list`.
  842. string atom_key = 1 [(google.api.field_behavior) = REQUIRED];
  843. // Required. The `Input.key` that identifies the input file.
  844. string input_key = 2 [(google.api.field_behavior) = REQUIRED];
  845. // Required. The zero-based index of the track in the input file.
  846. int32 input_track = 3 [(google.api.field_behavior) = REQUIRED];
  847. }
  848. // The codec for this text stream. The default is `"webvtt"`.
  849. //
  850. // Supported text codecs:
  851. // - 'srt'
  852. // - 'ttml'
  853. // - 'cea608'
  854. // - 'cea708'
  855. // - 'webvtt'
  856. string codec = 1;
  857. // The mapping for the `Job.edit_list` atoms with text `EditAtom.inputs`.
  858. repeated TextMapping mapping = 3;
  859. }
  860. // Segment settings for `"ts"`, `"fmp4"` and `"vtt"`.
  861. message SegmentSettings {
  862. // Duration of the segments in seconds. The default is `"6.0s"`. Note that
  863. // `segmentDuration` must be greater than or equal to
  864. // [`gopDuration`](#videostream), and `segmentDuration` must be divisible by
  865. // [`gopDuration`](#videostream).
  866. google.protobuf.Duration segment_duration = 1;
  867. // Required. Create an individual segment file. The default is `false`.
  868. bool individual_segments = 3 [(google.api.field_behavior) = REQUIRED];
  869. }
  870. // Encryption settings.
  871. message Encryption {
  872. // Configuration for AES-128 encryption.
  873. message Aes128Encryption {
  874. // Required. URI of the key delivery service. This URI is inserted into the M3U8
  875. // header.
  876. string key_uri = 1 [(google.api.field_behavior) = REQUIRED];
  877. }
  878. // Configuration for SAMPLE-AES encryption.
  879. message SampleAesEncryption {
  880. // Required. URI of the key delivery service. This URI is inserted into the M3U8
  881. // header.
  882. string key_uri = 1 [(google.api.field_behavior) = REQUIRED];
  883. }
  884. // Configuration for MPEG Common Encryption (MPEG-CENC).
  885. message MpegCommonEncryption {
  886. // Required. 128 bit Key ID represented as lowercase hexadecimal digits for use with
  887. // common encryption.
  888. string key_id = 1 [(google.api.field_behavior) = REQUIRED];
  889. // Required. Specify the encryption scheme.
  890. //
  891. // Supported encryption schemes:
  892. // - 'cenc'
  893. // - 'cbcs'
  894. string scheme = 2 [(google.api.field_behavior) = REQUIRED];
  895. }
  896. // Required. 128 bit encryption key represented as lowercase hexadecimal digits.
  897. string key = 1 [(google.api.field_behavior) = REQUIRED];
  898. // Required. 128 bit Initialization Vector (IV) represented as lowercase hexadecimal
  899. // digits.
  900. string iv = 2 [(google.api.field_behavior) = REQUIRED];
  901. // Encryption mode can be either `aes` or `cenc`.
  902. oneof encryption_mode {
  903. // Configuration for AES-128 encryption.
  904. Aes128Encryption aes_128 = 3;
  905. // Configuration for SAMPLE-AES encryption.
  906. SampleAesEncryption sample_aes = 4;
  907. // Configuration for MPEG Common Encryption (MPEG-CENC).
  908. MpegCommonEncryption mpeg_cenc = 5;
  909. }
  910. }