Javicle - a JSON Video Composition Language
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

README.md 5.7 KiB

4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
4 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. # Javicle - a JSON Video Composition Language
  2. JVCL (pronounced "Javicle") is a JSON DSL for audio/video transformations.
  3. Under the hood, it's all shell commands: `ffmpeg`, `mediainfo`, `sox`, and so on.
  4. JVCL provides higher-level semantics for working with these lower level tools.
  5. # A Quick Example
  6. Say you want to split a portion of a video into ten-second chunks. With ffmpeg
  7. and bash, you might do something like this:
  8. ```shell script
  9. INCR=10
  10. for ((i=10;i<130;i=(i+INCR))); do
  11. ffmpeg -i /tmp/my/source.mp4 -ss ${i} -t $((i+INCR)) /tmp/my/slice_${i}_$((i+INCR)).mp4
  12. done
  13. ```
  14. With JVCL, you'd create this spec:
  15. ```json
  16. {
  17. "assets": [ {"name": "src", "path": "/tmp/my/source.mp4"} ],
  18. "operations": [{
  19. "operation": "split",
  20. "creates": "src_split_files",
  21. "split": "src",
  22. "interval": "10s",
  23. "start": "10s",
  24. "end": "130s"
  25. }]
  26. }
  27. ```
  28. Yes, the JVCL is longer, but I think many would agree it is easier to read and maintain.
  29. **As the number of input assets and operations grows, hand-crafted shell scripts with magical
  30. ffmpeg incantations become ever more inscrutable.**
  31. JVCL is designed for readability and maintainability. JVCL will continue to evolve towards greater
  32. coverage of the full capabilities of ffmpeg. We also plan to introduce "function" concepts
  33. to create reusable compound operations, further increasing reusability and lowering long-term
  34. maintenance.
  35. # Who is JVCL not for?
  36. If you like GUIs, JVCL is probably not for you.
  37. JVCL is not a replacement for Final Cut Pro or even iMovie.
  38. # Who is JVCL for?
  39. If you like CLIs, JVCL might be for you.
  40. You might enjoy JVCL if your video composition needs are relatively simple or
  41. if you enjoy capturing repeatable processes in source control.
  42. # Concepts
  43. In JVCL there are two main concepts: assets and operations.
  44. ## Assets
  45. Assets are the inputs: generally image, audio and video files. Assets have a name and a path.
  46. The path can be a file or a URL.
  47. ## Operations
  48. Operations are transformations to perform on the inputs.
  49. An operation can produce one or more new assets, which can then be referenced in
  50. later operations.
  51. The operations that JVCL either supports or intends to support are:
  52. ### split
  53. Split an audio/video asset into multiple assets
  54. ### concat
  55. Concatenate audio/video assets together into one asset
  56. ### trim
  57. Trim audio/video; crop a section of an asset, becomes a new asset
  58. ### overlay
  59. Overlay one audio or video file onto another
  60. ### ken-burns
  61. For transforming still images into video via a fade-pan (aka Ken Burns) effect
  62. ### letterbox
  63. Transform a video in one size to another size using black letterboxes on the sides or top/bottom. Handy for embedding mobile videos into other screen formats
  64. ### split-silence
  65. Split an audio file according to silence
  66. # Complex Example
  67. Here is a complex example using multiple assets and operations:
  68. ```json
  69. {
  70. "assets": [
  71. {"name": "vid1", "path": "/tmp/path/to/video1.mp4"},
  72. {"name": "vid2", "path": "/tmp/path/to/video2.mp4"}
  73. ],
  74. "operations": [
  75. {
  76. "operation": "split", // name of the operation,
  77. "creates": "vid1_split_%", // assets it creates, the '%' will be replaced with a counter
  78. "split": "vid1", // split this source asset
  79. "interval": "10s" // split every ten seconds
  80. },
  81. {
  82. "operation": "concat", // name of the operation,
  83. "creates": "recombined_vid1", // assets it creates, the '%' will be replaced with a counter
  84. "concat": ["vid1_split"] // recombine all split assets
  85. },
  86. {
  87. "operation": "concat", // name of the operation,
  88. "creates": "combined_vid", // asset it creates, can be referenced later
  89. "concat": ["vid1", "vid2"] // operation-specific: this says, concatenate these named assets
  90. },
  91. {
  92. "operation": "concat", // name of the operation,
  93. "creates": "combined_vid", // the asset it creates, can be referenced later
  94. "concat": ["vid1", "vid2"] // operation-specific: this says, concatenate these named assets
  95. },
  96. {
  97. "operation": "overlay", // name of the operation,
  98. "creates": {
  99. "name": "overlay1", // asset it creates
  100. "width": "1920", // output width in pixels. default is source width
  101. "height": "1024" // output height in pixes. default is source height
  102. },
  103. "main": "combined_vid1", // main video asset
  104. "startTime": "30", // when (on the main video timeline) to begin showing the overlay. default is 0 (beginning)
  105. "endTime": "60", // when (on the main video timeline) to stop showing the overlay. default is to play the entire overlay
  106. "overlay": {
  107. "source": "vid2", // overlay this video on the main video
  108. "startTime": "0", // when (on the overlay video timeline) to begin playback on the overlay. default is 0 (beginning)
  109. "endTime": "0", // when (on the overlay video timeline) to end playback on the overlay. default is to play the entire overlay
  110. "width": "overlay.width / 2", // how wide the overlay will be, in pixels. default is the full overlay width, or maintain aspect ratio if height was set
  111. "height": "source.height", // how tall the overlay will be, in pixels. default is the full overlay height, or maintain aspect ratio if width was set
  112. "x": "source.width / 2", // horizontal overlay position on main video. default is 0
  113. "y": "source.height / 2" // vertical overlay position on main video. default is 0
  114. }
  115. }
  116. ]
  117. }
  118. ```
  119. ## What's up with the name?
  120. I dunno, a cross between a javelin and an icicle? does that have any positive connotations? ok then...