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.

преди 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 години
преди 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 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # Running JVC
  2. ## The `jvc` Script
  3. The `jvc` script (in the `bin` directory) is the primary way to transform video
  4. assets with JVC.
  5. `jvc` is a swiss army knife that can read a spec file and perform any number
  6. of operations on any number of assets.
  7. ## Operation-specific scripts
  8. There are other scripts in [`bin`](../bin) that perform a single operation using
  9. command-line arguments, without requiring you to write a spec file.
  10. If you need to do a quick operation and don't feel like writing a JSON
  11. spec file, use one of [these tools](../bin).
  12. For example, to extract the first 5 seconds of a video:
  13. ```shell script
  14. jtrim /tmp/input-file.mp4 /tmp/output-5s.mp4 0 5
  15. ```
  16. There is a command-line tool for every operation except for `overlay` and
  17. `ken-burns`, which are more complex. Pull requests welcome.
  18. ## Help
  19. All commands accept a `-h` / `--help` option, this will print information about
  20. how to use the command, and what arguments it takes.
  21. To view help for a command, just run the command with `-h` or `--help` as the
  22. first option:
  23. ```shell script
  24. jvc -h
  25. jscale -h
  26. jtrim -h
  27. ...
  28. ```
  29. ## JVC Spec Files
  30. A JVC spec is just a regular JSON file that happens to contain a single JSON object,
  31. whose properties are `assets` and `operations`.
  32. When you run `jvc` on a spec file, it will load the `assets`, then perform the `operations` in order.
  33. Learn more about [Assets and Operations](concepts.md)
  34. Unlike most JSON, comments *are* allowed in JVC spec files:
  35. * A line comment starts with `//` and continue to the end of the line
  36. * A multi-line block starts with `/*` and ends with `*/`
  37. <sub><sup>Doug C: I promise that in jvc comments will always be just comments;
  38. jvc will never use
  39. [comments as parsing directives or otherwise break interoperability](https://web.archive.org/web/20120507155137/https://plus.google.com/118095276221607585885/posts/RK8qyGVaGSr)
  40. (note: disabling javascript required to view link)</sup></sub>
  41. ## Writing a JVC Spec
  42. The easiest way to write a spec is to copy one of the
  43. [test specs](../src/test/resources/tests) and edit it.
  44. There examples for every JVC operation.
  45. Or read through the [complex example](complex_example.md) and adapt as needed.
  46. ## Executing a JVC Spec
  47. To execute a spec stored in the file `my-spec.json`, you would run:
  48. ```shell script
  49. jvc my-spec.jvc
  50. ```
  51. or use stdin:
  52. ```shell script
  53. cat my-spec.jvc | jvc
  54. ```
  55. ## Command Line Options
  56. The command line options described below are for `jvc` only, not for the
  57. single-operation scripts.
  58. For the other scripts, you can use environment variables
  59. to pass options to `jvc`, as described below.
  60. #### Scratch Directory: `-t` or `--temp-dir`
  61. Output assets will be placed in the scratch directory, unless otherwise specified
  62. in the spec file. By default, JVC will create a new temporary directory to use as the scratch
  63. directory. You can set the scratch directory explicitly using the `-t` or `--temp-dir` option:
  64. ```shell script
  65. jvc -t /some/tempdir my-spec.json
  66. ```
  67. ##### Environment Variable: `JVC_SCRATCH_DIR`
  68. When using the other tools in `bin`, you can set the scratch directory via the
  69. `JVC_SCRATCH_DIR` environment variable. If the `JVC_SCRATCH_DIR` references a
  70. directory that does not exist, it will be created.
  71. #### Dry Run: `-n` or `--no-exec`
  72. Use the `-n` or `--no-exec` option to print out the commands that would have been run,
  73. but do not actually run anything.
  74. ```shell script
  75. jvc -n my-spec.json # will not run any ffmpeg commands
  76. ```
  77. Note that this breaks JVC operations that require information from any assets created by
  78. previous operations: since the command did not actually run, the intermediate asset was
  79. never created.
  80. ##### Environment Variable: `JVC_NO_EXEC`
  81. When using the other tools in `bin`, you can set the "no exec" flag via the
  82. `JVC_NO_EXEC` environment variable. If the `JVC_NO_EXEC` is non-empty, then
  83. the script will pass the `-n` flag when it calls `jvc` and commands will
  84. be printed out instead of actually being run.
  85. #### Help
  86. To view a list of all `jvc` command-line options, run `jvc -h` or `jvc --help`
  87. # What's Next?
  88. Learn about [Assets and Operations](concepts.md), the core concepts of JVC.