Javicle - a JSON Video Composition Language
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 5.4 KiB

3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. # Javicle - a JSON Video Composition Language
  2. Javicle (JVC for short) is a JSON DSL for audio/video transformations.
  3. Under the hood, it's all shell commands: `ffmpeg`, `mediainfo` and so on.
  4. JVC provides higher-level semantics for working with these lower level tools.
  5. # Motivation
  6. I infrequently find myself doing video editing, so I've never bothered to
  7. learn iMovie or any graphical video editor.
  8. My editing needs are usually pretty simple, so I bust out ffmpeg and get the
  9. job done.
  10. But it seems like every time, there is at least one wrinkle in the requirements
  11. that requires some deep research into
  12. [ffmpeg filter arcana](https://ffmpeg.org/ffmpeg-filters.html).
  13. Hours later, before I know it, the day has gone by.
  14. I created JVC to make it really easy to do the most common things people
  15. usually do to videos: splitting, concatenating, letterboxing, overlaying
  16. one video onto another, and so on.
  17. # A Quick Example
  18. Suppose you have one video that is five minutes long,
  19. and you want to split it into five videos, each one minute long.
  20. With ffmpeg and bash, you might do something like this:
  21. ```shell script
  22. INCR=60
  23. for ((i=0;i<300;i=(i+INCR))); do
  24. ffmpeg -i /tmp/my/source.mp4 -ss ${i} -t $((i+INCR)) /tmp/my/slice_${i}_$((i+INCR)).mp4
  25. done
  26. ```
  27. With JVC, you'd write this spec file and save it to a file
  28. (for example `my-spec.jvc`):
  29. ```json
  30. {
  31. "assets": [ {"name": "src", "path": "/tmp/my/source.mp4"} ],
  32. "operations": [{
  33. "operation": "split",
  34. "creates": "src_split_files",
  35. "source": "src",
  36. "interval": "60",
  37. "validate": [{ "comment": "expected 12 files", "test": "output.length === 12" }]
  38. }]
  39. }
  40. ```
  41. and then run it like this:
  42. ```shell script
  43. jvc my-spec.jvc
  44. ```
  45. Yes, the JVC is longer, but I think many would agree it is easier to read
  46. and maintain.
  47. As you can see above, JVC can also `validate` your operations to ensure that
  48. the output assets are what you expect them to be.
  49. **As the number of media assets and operations grows, hand-crafted shell
  50. scripts with magical ffmpeg incantations become ever more inscrutable.**
  51. JVC is designed for readability and maintainability. JVC will continue to
  52. evolve towards greater coverage of the full capabilities of ffmpeg.
  53. # Who is JVC not for?
  54. If you like GUIs, JVC is probably not for you.
  55. JVC is not a replacement for Final Cut Pro or even iMovie.
  56. # Who is JVC for?
  57. JVC is for people who like CLIs and automation.
  58. JVC is for people with relatively simple video composition needs (for now),
  59. since the range of operations supported is limited.
  60. JVC is for people who have used ffmpeg filters before and had flashbacks
  61. of editing Sendmail configs, debugging PostScript, or maintaining a legacy
  62. Perl system.
  63. ##### Caveat Emptor
  64. Obligatory Disclaimer: JVC is still relatively new software and lots of stuff
  65. might not work right, ffmpeg could crap out on bad arguments, encodings,
  66. formats, filter syntax errors, or whatever.
  67. In any case, JVC should never overwrite your source files, since all output
  68. goes to new files.
  69. # Requirements
  70. * Java 11
  71. * Maven 3
  72. The first time you run `jvc`, it will automatically build the JVC jar file
  73. from sources, using maven and javac. This takes a little time but only needs
  74. to be done once.
  75. # Running JVC
  76. Learn more about **[running `jvc`](docs/running.md)** and other useful tools.
  77. # JVC Concepts
  78. Learn about **[Assets and Operations](docs/concepts.md)**, the core concepts
  79. of JVC.
  80. # Supported Operations
  81. Today, JVC supports several basic operations.
  82. For each operation listed below, the header links to an example from the JVC
  83. test suite.
  84. ### [add-silence](src/test/resources/tests/test_add_silence.jvc)
  85. Add a silent audio track to a video asset.
  86. ### [adjust-speed](src/test/resources/tests/test_adjust_speed.jvc)
  87. Speed up or slow down a video asset. Sound can be silenced, played at
  88. regular speed, or sped up/slowed down to match the video.
  89. ### [concat](src/test/resources/tests/test_concat.jvc)
  90. Concatenate audio/video assets together into one asset.
  91. ### [ken-burns](src/test/resources/tests/test_ken_burns.jvc)
  92. Transform a still image into video via a zoom-pan (aka Ken Burns) effect.
  93. ### [letterbox](src/test/resources/tests/test_letterbox.jvc)
  94. Resize a video, maintaining the aspect ratio and adding letterboxes on
  95. the sides or top/bottom.
  96. ### [merge-audio](src/test/resources/tests/test_merge_audio.jvc)
  97. Merge an audio asset into the audio track of a video asset.
  98. ### [overlay](src/test/resources/tests/test_overlay.jvc)
  99. Overlay one video onto another.
  100. ### [remove-track](src/test/resources/tests/test_remove_track.jvc)
  101. Remove a track from a video asset.
  102. ### [scale](src/test/resources/tests/test_scale.jvc)
  103. Scale a video asset from one size to another. Scaling can be proportional
  104. or anamorphic.
  105. ### [split](src/test/resources/tests/test_split.jvc)
  106. Split an audio/video asset into multiple assets of equal time lengths.
  107. ### [trim](src/test/resources/tests/test_trim.jvc)
  108. Trim audio/video; crop a section of an asset, becomes a new asset.
  109. ## Complex Example
  110. Here is a [long, complex example](docs/complex_example.md) that uses
  111. every operation.
  112. ## JVC JavaScript Expressions
  113. There are actually two DSLs in JVC. One is the JSON format for JVC files,
  114. which tells jvc where the assets are and what to do with them.
  115. The second DSL is not really a full DSL, it's more a JavaScript context
  116. in which you can evaluate expressions.
  117. ## What's with the name?
  118. A cross between a javelin and an icicle? JSON and a miracle?
  119. Something with positive connotations?
  120. I really don't like naming things.