Video.proto 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // required/optional feilds are deprecated in proto v3
  2. // https://www.ben-morris.com/handling-protocol-buffers-backwards-compatibility-between-versions-2-and-3-using-c/
  3. // For our usecase we wish to re-use same message to create and update
  4. // subset of fields. For this reason we need the explicit information
  5. // about wether a field has been set or not and this is only possible with proto v2.
  6. syntax = "proto2";
  7. message PublishedBeforeJoystream {
  8. optional bool is_published = 1;
  9. optional uint32 timestamp = 2;
  10. }
  11. // Joystream Specific License type
  12. message License {
  13. // License code defined by Joystream
  14. optional int32 code = 1;
  15. // Text for licenses that require an attribution
  16. optional string attribution = 2;
  17. // Text for custom license type
  18. optional string custom_text = 3;
  19. }
  20. // Rich format description of video media type
  21. message MediaType {
  22. // enum AVCodecID from FFmpeg: libavcodec/codec_id.h
  23. // optional int32 codec_id = 1;
  24. // string name field from FFmpeg libavcodec/codec_desc.c
  25. optional string codec_name = 1;
  26. // Video container format (eg. 'MP4', 'WebM', 'Ogg' ...)
  27. // https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Video_codecs
  28. optional string container = 2;
  29. // MIME Media Type
  30. // https://www.iana.org/assignments/media-types/media-types.xhtml#video
  31. // eg. 'video/mp4'
  32. optional string mime_media_type = 3;
  33. }
  34. message VideoMetadata {
  35. optional string title = 1;
  36. optional string description = 2;
  37. // Duration in seconds of the video
  38. optional int32 duration = 3;
  39. // Resolution of the video
  40. optional int32 media_pixel_height = 4;
  41. optional int32 media_pixel_width = 5;
  42. // Rich media type information about the media format
  43. optional MediaType media_type = 6;
  44. // ISO_639-1 code: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
  45. // useful: npm package https://www.npmjs.com/package/iso-639-1
  46. optional string language = 7;
  47. // License type for the media
  48. optional License license = 8;
  49. optional PublishedBeforeJoystream published_before_joystream = 9;
  50. // Set to true if video has marketing/adverts in the stream
  51. optional bool has_marketing = 10;
  52. // Set to true if it should be visiable to public
  53. optional bool is_public = 11;
  54. // Set to true if video has explicit language or scenes
  55. // Should this be a curator managed property instead?
  56. optional bool is_explicit = 12;
  57. }