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 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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` and so on.
  4. JVCL provides higher-level semantics for working with these lower level tools.
  5. # Motivation
  6. I don't do much video editing, so I've never bothered to learn iMovie or any
  7. graphical video editor. My editing needs are usually pretty simple, so I bust
  8. out ffmpeg and get it done.
  9. But it seems like every time, there is at least one wrinkle in my requirements
  10. that requires some deep research into
  11. [ffmpeg filter arcana](https://ffmpeg.org/ffmpeg-filters.html)
  12. and before I know it, the day is done.
  13. I created JVCL to make it really easy to do the most common things people
  14. usually do to videos: splitting, concatenating, letterboxing, overlaying
  15. one video onto another, and so on.
  16. # A Quick Example
  17. Suppose you have one video that is five minutes long,
  18. and you want to split it into five videos, each one minute long.
  19. With ffmpeg and bash, you might do something like this:
  20. ```shell script
  21. INCR=60
  22. for ((i=0;i<300;i=(i+INCR))); do
  23. ffmpeg -i /tmp/my/source.mp4 -ss ${i} -t $((i+INCR)) /tmp/my/slice_${i}_$((i+INCR)).mp4
  24. done
  25. ```
  26. With JVCL, you'd write this spec file and save it to a file
  27. (for example `my-spec.jvcl`):
  28. ```json
  29. {
  30. "assets": [ {"name": "src", "path": "/tmp/my/source.mp4"} ],
  31. "operations": [{
  32. "operation": "split",
  33. "creates": "src_split_files",
  34. "source": "src",
  35. "interval": "60"
  36. }]
  37. }
  38. ```
  39. and then run it like this:
  40. ```shell script
  41. jvcl my-spec.jvcl
  42. ```
  43. Yes, the JVCL is longer, but I think many would agree it is easier to read
  44. and maintain.
  45. **As the number of media assets and operations grows, hand-crafted shell
  46. scripts with magical ffmpeg incantations become ever more inscrutable.**
  47. JVCL is designed for readability and maintainability. JVCL will continue to
  48. evolve towards greater coverage of the full capabilities of ffmpeg.
  49. # Who is JVCL not for?
  50. If you like GUIs, JVCL is probably not for you.
  51. JVCL is not a replacement for Final Cut Pro or even iMovie.
  52. # Who is JVCL for?
  53. JVCL is for people who like CLIs and automation.
  54. JVCL is for people with relatively simple video composition needs (for now),
  55. since the range of operations supported is limited.
  56. # Requirements
  57. * Java 11
  58. * Maven 3
  59. The first time you run `jvcl`, it will automatically build the JVCL jar file
  60. from sources, using maven and javac. This takes a little time but only needs
  61. to be done once.
  62. # Running JVCL
  63. Learn more about [running `jvcl`](docs/running.md) and other useful tools.
  64. # JVCL Concepts
  65. Learn about [Assets and Operations](docs/concepts.md), the core concepts
  66. of JVCL.
  67. # Supported Operations
  68. Today, JVCL supports several basic operations.
  69. For each operation listed below, the header links to an example from the JVCL
  70. test suite.
  71. ### [concat](src/test/resources/tests/test_concat.jvcl)
  72. Concatenate audio/video assets together into one asset.
  73. ### [ken-burns](src/test/resources/tests/test_ken_burns.jvcl)
  74. For transforming still images into video via a fade-pan (aka Ken Burns) effect.
  75. ### [letterbox](src/test/resources/tests/test_letterbox.jvcl)
  76. Transform a video from one size to another size, maintaining the aspect ratio
  77. of the video and adding letterboxes on the sides or top/bottom.
  78. Handy for embedding mobile videos into other screen formats.
  79. ### [overlay](src/test/resources/tests/test_overlay.jvcl)
  80. Overlay one asset onto another.
  81. ### [remove-track](src/test/resources/tests/test_remove_track.jvcl)
  82. Remove a track from a video asset.
  83. ### [scale](src/test/resources/tests/test_scale.jvcl)
  84. Scale a video asset from one size to another. Scaling can be proportional
  85. or anamorphic.
  86. ### [split](src/test/resources/tests/test_split.jvcl)
  87. Split an audio/video asset into multiple assets of equal time lengths.
  88. ### [trim](src/test/resources/tests/test_trim.jvcl)
  89. Trim audio/video; crop a section of an asset, becomes a new asset.
  90. ## Complex Example
  91. Here is a [long, complex example](docs/complex_example.md) that uses
  92. every operation.
  93. ## What's with the name?
  94. A cross between a javelin and an icicle?
  95. Does that have any positive connotations?
  96. I really don't like naming things.