Javicle - a JSON Video Composition Language
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. }]
  38. }
  39. ```
  40. and then run it like this:
  41. ```shell script
  42. jvc my-spec.jvc
  43. ```
  44. Yes, the JVC is longer, but I think many would agree it is easier to read
  45. and maintain.
  46. **As the number of media assets and operations grows, hand-crafted shell
  47. scripts with magical ffmpeg incantations become ever more inscrutable.**
  48. JVC is designed for readability and maintainability. JVC will continue to
  49. evolve towards greater coverage of the full capabilities of ffmpeg.
  50. # Who is JVC not for?
  51. If you like GUIs, JVC is probably not for you.
  52. JVC is not a replacement for Final Cut Pro or even iMovie.
  53. # Who is JVC for?
  54. JVC is for people who like CLIs and automation.
  55. JVC is for people with relatively simple video composition needs (for now),
  56. since the range of operations supported is limited.
  57. JVC is for people who have used ffmpeg filters before and had flashbacks
  58. of editing Sendmail configs and debugging PostScript.
  59. Obligatory Disclaimer: JVC is still relatively new software and lots of stuff might break.
  60. At least it should never overwrite your source files. All output goes to new files.
  61. # Requirements
  62. * Java 11
  63. * Maven 3
  64. The first time you run `jvc`, it will automatically build the JVC jar file
  65. from sources, using maven and javac. This takes a little time but only needs
  66. to be done once.
  67. # Running JVC
  68. Learn more about **[running `jvc`](docs/running.md)** and other useful tools.
  69. # JVC Concepts
  70. Learn about **[Assets and Operations](docs/concepts.md)**, the core concepts
  71. of JVC.
  72. # Supported Operations
  73. Today, JVC supports several basic operations.
  74. For each operation listed below, the header links to an example from the JVC
  75. test suite.
  76. ### [add-silence](src/test/resources/tests/test_add_silence.jvc)
  77. Add a silent audio track to a video asset.
  78. ### [concat](src/test/resources/tests/test_concat.jvc)
  79. Concatenate audio/video assets together into one asset.
  80. ### [ken-burns](src/test/resources/tests/test_ken_burns.jvc)
  81. Transform still images into video via a fade-pan (aka Ken Burns) effect.
  82. ### [letterbox](src/test/resources/tests/test_letterbox.jvc)
  83. Transform a video from one size to another size, maintaining the aspect ratio
  84. of the video and adding letterboxes on the sides or top/bottom.
  85. Handy for embedding mobile videos into other screen formats.
  86. ### [merge-audio](src/test/resources/tests/test_merge_audio.jvc)
  87. Merge an audio asset into the audio track of a video asset.
  88. ### [overlay](src/test/resources/tests/test_overlay.jvc)
  89. Overlay one asset onto another.
  90. ### [remove-track](src/test/resources/tests/test_remove_track.jvc)
  91. Remove a track from a video asset.
  92. ### [scale](src/test/resources/tests/test_scale.jvc)
  93. Scale a video asset from one size to another. Scaling can be proportional
  94. or anamorphic.
  95. ### [split](src/test/resources/tests/test_split.jvc)
  96. Split an audio/video asset into multiple assets of equal time lengths.
  97. ### [trim](src/test/resources/tests/test_trim.jvc)
  98. Trim audio/video; crop a section of an asset, becomes a new asset.
  99. ## Complex Example
  100. Here is a [long, complex example](docs/complex_example.md) that uses
  101. every operation.
  102. ## What's with the name?
  103. A cross between a javelin and an icicle? JSON and a miracle?
  104. Something with positive connotations?
  105. I really don't like naming things.