Javicle - a JSON Video Composition Language
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

README.md 3.9 KiB

3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 capture the most common things people usually do to videos:
  14. splitting, concatenating, letterboxing, overlaying one video onto another,
  15. and so on.
  16. # A Quick Example
  17. Say you want to split a portion of a video into ten-second chunks. With ffmpeg
  18. and bash, you might do something like this:
  19. ```shell script
  20. INCR=10
  21. for ((i=10;i<130;i=(i+INCR))); do
  22. ffmpeg -i /tmp/my/source.mp4 -ss ${i} -t $((i+INCR)) /tmp/my/slice_${i}_$((i+INCR)).mp4
  23. done
  24. ```
  25. With JVCL, you'd write this spec file and save it to a file (for
  26. example `my-spec.jvcl`):
  27. ```json
  28. {
  29. "assets": [ {"name": "src", "path": "/tmp/my/source.mp4"} ],
  30. "operations": [{
  31. "operation": "split",
  32. "creates": "src_split_files",
  33. "source": "src",
  34. "interval": "10s",
  35. "start": "10s",
  36. "end": "130s"
  37. }]
  38. }
  39. ```
  40. and then run it like this:
  41. ```shell script
  42. jvcl my-spec.jvcl
  43. ```
  44. Yes, the JVCL 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. JVCL is designed for readability and maintainability. JVCL will continue to
  49. evolve towards greater coverage of the full capabilities of ffmpeg.
  50. # Who is JVCL not for?
  51. If you like GUIs, JVCL is probably not for you.
  52. JVCL is not a replacement for Final Cut Pro or even iMovie.
  53. # Who is JVCL for?
  54. JVCL is for people who like CLIs and automation.
  55. JVCL is for people with relatively simple video composition needs (for now),
  56. since the range of operations supported is limited.
  57. # Running JVCL
  58. Learn more about [running `jvcl`](docs/running.md) and other useful tools.
  59. # JVCL Concepts
  60. Learn about [Assets and Operations](docs/concepts.md), the core concepts
  61. of JVCL.
  62. ### Supported Operations
  63. Today, JVCL supports several basic operations.
  64. For each operation listed below, the header links to an example from the JVCL
  65. test suite.
  66. ### [concat](src/test/resources/tests/test_concat.jvcl)
  67. Concatenate audio/video assets together into one asset.
  68. ### [ken-burns](src/test/resources/tests/test_ken_burns.jvcl)
  69. For transforming still images into video via a fade-pan (aka Ken Burns) effect.
  70. ### [letterbox](src/test/resources/tests/test_letterbox.jvcl)
  71. Transform a video from one size to another size, maintaining the aspect ratio
  72. of the video and adding letterboxes on the sides or top/bottom.
  73. Handy for embedding mobile videos into other screen formats.
  74. ### [overlay](src/test/resources/tests/test_overlay.jvcl)
  75. Overlay one asset onto another.
  76. ### [remove-track](src/test/resources/tests/test_remove_track.jvcl)
  77. Remove a track from a video asset.
  78. ### [scale](src/test/resources/tests/test_scale.jvcl)
  79. Scale a video asset from one size to another. Scaling can be proportional
  80. or anamorphic.
  81. ### [split](src/test/resources/tests/test_split.jvcl)
  82. Split an audio/video asset into multiple assets of equal time lengths.
  83. ### [trim](src/test/resources/tests/test_trim.jvcl)
  84. Trim audio/video; crop a section of an asset, becomes a new asset.
  85. ## Complex Example
  86. Here is a [long, complex example](docs/complex_example.md) that uses
  87. every operation.
  88. ## What's with the name?
  89. A cross between a javelin and an icicle?
  90. Does that have any positive connotations?
  91. I really don't like naming things.