Javicle - a JSON Video Composition Language
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

complex_example.md 9.8 KiB

vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. # Complex Example
  2. Here is a complex example using multiple assets and operations.
  3. Note that comments, which are not usually legal in JSON, are allowed in
  4. JVC files.
  5. If you have other JSON-aware tools that need to read JVLC files, you may not
  6. want to use this comment syntax. The `asset` and `operation` JSON objects also
  7. support a `comment` field, which can be used as well.
  8. ```js
  9. {
  10. "assets": [
  11. // file -- will be referenced directory
  12. {
  13. "comment": "first video, already local",
  14. "name": "vid1",
  15. "path": "/tmp/path/to/video1.mp4"
  16. },
  17. // URL -- will be downloaded to scratch directory and referenced from there
  18. {
  19. "comment": "second video, will be downloaded",
  20. "name": "vid2",
  21. "path": "https://archive.org/download/gov.archives.arc.1257628/gov.archives.arc.1257628_512kb.mp4"
  22. },
  23. // URL -- will be downloaded to `dest` directory and referenced from there
  24. {
  25. "comment": "third video, will be downloaded",
  26. "name": "vid3",
  27. "path": "https://archive.org/download/gov.archives.arc.49442/gov.archives.arc.49442_512kb.mp4",
  28. "dest": "src/test/resources/sources/"
  29. },
  30. // Image URL
  31. {
  32. "comment": "JPEG image, will be downloaded",
  33. "name": "img1",
  34. "path": "https://live.staticflickr.com/65535/48159911972_01efa0e5ea_b.jpg",
  35. "dest": "src/test/resources/sources/"
  36. },
  37. // Audio clip
  38. {
  39. "name": "bull-roar",
  40. "path": "http://soundbible.com/grab.php?id=2073&type=mp3",
  41. "dest": "src/test/resources/sources/"
  42. }
  43. ],
  44. "operations": [
  45. // scale examples
  46. {
  47. "comment": "scale using explicity height x width",
  48. "operation": "scale", // name of the operation
  49. "creates": "vid2_scaled", // asset it creates, can be referenced later
  50. "source": "vid2", // source asset, from `assets` above
  51. "width": "1024", // width of scaled asset. if omitted and height is present, width will be proportional
  52. "height": "768" // height of scaled asset. if omitted and width is present, height will be proportional
  53. },
  54. {
  55. "comment": "scale proportionally by a scale factor",
  56. "operation": "scale", // name of the operation
  57. "creates": "vid2_big", // asset it creates
  58. "source": "vid2", // source asset, from `assets` above
  59. "factor": "2.2" // scale factor. if factor is set, width and height are ignored.
  60. },
  61. // split example
  62. {
  63. "comment": "split one asset into many",
  64. "operation": "split", // name of the operation
  65. "creates": "vid1_splits", // assets it creates, 'vid1_splits' will be a list of assets
  66. "source": "vid1", // split this asset
  67. "interval": "10" // split every ten seconds
  68. },
  69. // concat examples
  70. {
  71. "comment": "re-combine previously split assets back together",
  72. "operation": "concat", // name of the operation
  73. "creates": "recombined_vid1", // asset it creates
  74. "sources": ["vid1_split"] // recombine all split assets
  75. },
  76. {
  77. "comment": "append vid2 to the end of vid1 and create a new asset",
  78. "operation": "concat", // name of the operation
  79. "creates": "combined_vid2", // asset it creates
  80. "sources": ["vid1", "vid2"] // operation-specific: this says, concatenate these named assets
  81. },
  82. {
  83. "comment": "re-combine only some of the previously split assets",
  84. "operation": "concat", // name of the operation
  85. "sources": ["vid1_splits[1..2]"],// concatentate these sources -- the 2nd and 3rd files only
  86. "creates": "combined_vid3" // name of the output asset, will be written to scratch directory
  87. },
  88. // trim example
  89. {
  90. "comment": "trim all of the assets that were split above",
  91. "operation": "trim", // name of the operation
  92. "creates": { // create multiple files, will be prefixed with `name`, store them in `dest`
  93. "name": "vid1_trims",
  94. "dest": "src/test/resources/outputs/trims/"
  95. },
  96. "source": "vid1_split", // trim these source assets
  97. "start": "1", // cropped region starts here, default is zero
  98. "end": "6" // cropped region ends here, default is end of video
  99. },
  100. // overlay example
  101. {
  102. "comment": "overlay one video onto another",
  103. "operation": "overlay", // name of the operation
  104. "creates": "overlay1", // asset it creates
  105. "source": "combined_vid1", // main video asset, `combined_vid1` was the output of an earlier operation
  106. "start": "30", // when (on the main video timeline) to begin showing the overlay. default is 0 (beginning)
  107. "end": "60", // when (on the main video timeline) to stop showing the overlay. default is to play the entire overlay
  108. "overlay": {
  109. "source": "vid2", // overlay this video on the main video
  110. "start": "0", // when (on the overlay video timeline) to begin playback on the overlay. default is 0 (beginning)
  111. "end": "overlay.duration", // when (on the overlay video timeline) to end playback on the overlay. default is to play the entire overlay
  112. "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
  113. "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
  114. "x": "source.width / 2", // horizontal overlay position on main video. default is 0
  115. "y": "source.height / 2" // vertical overlay position on main video. default is 0
  116. }
  117. },
  118. // ken-burns example
  119. {
  120. "comment": "apply zoom-pan effect to image, creates video",
  121. "operation": "ken-burns", // name of the operation
  122. "creates": "ken1", // asset it creates
  123. "source": "img1", // source image, `img1` is defined above in `assets`
  124. "zoom": "1.3", // zoom level, from 1 to 10
  125. "duration": "5.5", // how long the resulting video will be
  126. "start": "0", // when to start zooming, default is 0
  127. "end": "duration", // when to end zooming, default is duration
  128. "x": "source.width * 0.6", // pan to this x-position
  129. "y": "source.height * 0.4", // pan to this y-position
  130. "upscale": "8", // upscale factor. upscaling the image results in a smoother pan, but a longer encode, default is 8
  131. "width": "1024", // width of output video
  132. "height": "768" // height of output video
  133. },
  134. // letterbox example
  135. {
  136. "comment": "increase video size proportionally and add letterboxes as needed",
  137. "operation": "letterbox", // name of the operation
  138. "creates": "boxed1", // asset it creates
  139. "source": "ken1", // source asset
  140. "width": "source.width * 1.5", // make it wider
  141. "height": "source.height * 0.9", // and shorter
  142. "color": "AliceBlue" // default is black. can be a hex value (0xff0000 for red) or a color name from here: https://ffmpeg.org/ffmpeg-utils.html#color-syntax
  143. },
  144. // remove-track examples
  145. {
  146. "comment": "remove all audio tracks",
  147. "operation": "remove-track", // name of the operation
  148. "creates": "vid2_video_only", // name of the output asset
  149. "source": "vid2", // main video asset
  150. "track": "audio" // remove all audio tracks
  151. },
  152. {
  153. "comment": "remove all video tracks",
  154. "operation": "remove-track", // name of the operation
  155. "creates": "vid2_audio_only", // name of the output asset
  156. "source": "vid2", // main video asset
  157. "track": "video" // remove all video tracks
  158. },
  159. {
  160. "comment": "remove a specific audio track",
  161. "operation": "remove-track", // name of the operation
  162. "creates": "vid2_video_only2", // name of the output asset
  163. "source": "vid2", // main video asset
  164. "track": {
  165. // only remove the first audio track
  166. "type": "audio", // track type to remove
  167. "number": "0" // track number to remove
  168. }
  169. },
  170. // merge-audio example
  171. {
  172. "operation": "merge-audio", // name of the operation
  173. "creates": "with_roar", // output asset name
  174. "source": "vid2", // main video asset
  175. "insert": "bull-roar", // audio asset to insert
  176. "at": "5" // when (on the video timeline) to start playing the audio. default is 0 (beginning)
  177. },
  178. // add-silence example
  179. {
  180. "operation": "add-silence", // name of the operation
  181. "creates": "v2_silent", // output asset name
  182. "source": "v2", // main video asset
  183. "channelLayout": "stereo", // optional channel layout, usually 'mono' or 'stereo'. Default is 'stereo'
  184. "samplingRate": 48000 // optional sampling rate, in Hz. default is 48000
  185. },
  186. // adjust-speed example
  187. {
  188. "operation": "adjust-speed", // name of the operation
  189. "creates": "quickened", // output asset name
  190. "source": "v2", // main video asset
  191. "factor": "4", // factor=1 is no change, factor>1 is faster, factor<1 is slower
  192. "audio": "silent" // audio: silent (default), unchanged, match
  193. // if audio is match, then factor must be between 0.5 and 100
  194. }
  195. ]
  196. }
  197. ```