Javicle - a JSON Video Composition Language
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
Jonathan Cobb d2357da203 don't print assets 3年前
bin add adjust-speed operation, refactor 3年前
docs WIP. adding support for validations 3年前
src don't print assets 3年前
utils add cobbzilla-parent submodule 3年前
.gitignore ignore test script, adjust log output 3年前
.gitmodules add cobbzilla-parent submodule 3年前
LICENSE.txt add license 3年前
README.md WIP. adding support for validations 3年前
pom.xml rename jvcl -> jvc 3年前

README.md

Javicle - a JSON Video Composition Language

Javicle (JVC for short) is a JSON DSL for audio/video transformations.

Under the hood, it’s all shell commands: ffmpeg, mediainfo and so on.

JVC provides higher-level semantics for working with these lower level tools.

Motivation

I infrequently find myself doing video editing, so I’ve never bothered to learn iMovie or any graphical video editor.

My editing needs are usually pretty simple, so I bust out ffmpeg and get the job done.

But it seems like every time, there is at least one wrinkle in the requirements that requires some deep research into ffmpeg filter arcana.

Hours later, before I know it, the day has gone by.

I created JVC to make it really easy to do the most common things people usually do to videos: splitting, concatenating, letterboxing, overlaying one video onto another, and so on.

A Quick Example

Suppose you have one video that is five minutes long, and you want to split it into five videos, each one minute long.

With ffmpeg and bash, you might do something like this:

    INCR=60
    for ((i=0;i<300;i=(i+INCR))); do
      ffmpeg -i /tmp/my/source.mp4 -ss ${i} -t $((i+INCR)) /tmp/my/slice_${i}_$((i+INCR)).mp4
    done

With JVC, you’d write this spec file and save it to a file (for example my-spec.jvc):

{
  "assets": [ {"name": "src", "path": "/tmp/my/source.mp4"} ],
  "operations": [{
      "operation": "split",
      "creates": "src_split_files",
      "source": "src",
      "interval": "60",
      "validate": [{ "comment": "expected 12 files", "test": "output.length === 12" }]
  }]
}

and then run it like this:

jvc my-spec.jvc

Yes, the JVC is longer, but I think many would agree it is easier to read and maintain.

As you can see above, JVC can also validate your operations to ensure that the output assets are what you expect them to be.

As the number of media assets and operations grows, hand-crafted shell scripts with magical ffmpeg incantations become ever more inscrutable.

JVC is designed for readability and maintainability. JVC will continue to evolve towards greater coverage of the full capabilities of ffmpeg.

Who is JVC not for?

If you like GUIs, JVC is probably not for you.

JVC is not a replacement for Final Cut Pro or even iMovie.

Who is JVC for?

JVC is for people who like CLIs and automation.

JVC is for people with relatively simple video composition needs (for now), since the range of operations supported is limited.

JVC is for people who have used ffmpeg filters before and had flashbacks of editing Sendmail configs, debugging PostScript, or maintaining a legacy Perl system.

Caveat Emptor

Obligatory Disclaimer: JVC is still relatively new software and lots of stuff might not work right, ffmpeg could crap out on bad arguments, encodings, formats, filter syntax errors, or whatever.

In any case, JVC should never overwrite your source files, since all output goes to new files.

Requirements

  • Java 11
  • Maven 3

The first time you run jvc, it will automatically build the JVC jar file from sources, using maven and javac. This takes a little time but only needs to be done once.

Running JVC

Learn more about running jvc and other useful tools.

JVC Concepts

Learn about Assets and Operations, the core concepts of JVC.

Supported Operations

Today, JVC supports several basic operations.

For each operation listed below, the header links to an example from the JVC test suite.

add-silence

Add a silent audio track to a video asset.

adjust-speed

Speed up or slow down a video asset. Sound can be silenced, played at regular speed, or sped up/slowed down to match the video.

concat

Concatenate audio/video assets together into one asset.

ken-burns

Transform a still image into video via a zoom-pan (aka Ken Burns) effect.

letterbox

Resize a video, maintaining the aspect ratio and adding letterboxes on the sides or top/bottom.

merge-audio

Merge an audio asset into the audio track of a video asset.

overlay

Overlay one video onto another.

remove-track

Remove a track from a video asset.

scale

Scale a video asset from one size to another. Scaling can be proportional or anamorphic.

split

Split an audio/video asset into multiple assets of equal time lengths.

trim

Trim audio/video; crop a section of an asset, becomes a new asset.

Complex Example

Here is a long, complex example that uses every operation.

JVC JavaScript Expressions

There are actually two DSLs in JVC. One is the JSON format for JVC files, which tells jvc where the assets are and what to do with them.

The second DSL is not really a full DSL, it’s more a JavaScript context in which you can evaluate expressions.

What’s with the name?

A cross between a javelin and an icicle? JSON and a miracle? Something with positive connotations? I really don’t like naming things.