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.

running.md 2.8 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Running JVC
  2. ## The `jvc` Script
  3. The `bin/jvc` script is the primary way to transform video assets with JVC.
  4. ## Operation-specific scripts
  5. There are other scripts in [`bin`](../bin) that perform a single operation using
  6. command-line arguments. If you need to do a quick operation and don't want to write
  7. a JVC spec, use one of these tools.
  8. For example, to extract the first 5 seconds of a video:
  9. ```shell script
  10. jtrim /tmp/input-file.mp4 /tmp/output-5s.mp4 0 5
  11. ```
  12. All commands accept a `-h` / `--help` option, use this to print usage information:
  13. ```shell script
  14. jscale -h
  15. ```
  16. ## JVC Spec Files
  17. A JVC spec is just a regular JSON file that happens to contain a single JSON object,
  18. whose properties are `assets` and `operations`.
  19. When you run `jvc` on a spec file, it will load the `assets`, then perform the `operations` in order.
  20. Learn more about [Assets and Operations](concepts.md)
  21. Unlike most JSON, comments *are* allowed in JVC spec files:
  22. * A line comment starts with `//` and continue to the end of the line
  23. * A multi-line block starts with `/*` and ends with `*/`
  24. ## Writing a JVC Spec
  25. The easiest way to write a spec is to copy one of the
  26. [test specs](../src/test/resources/tests) and edit it.
  27. There examples for every JVC operation.
  28. ## Executing a JVC Spec
  29. To execute a spec stored in the file `my-spec.json`, you would run:
  30. ```shell script
  31. jvc my-spec.jvc
  32. ```
  33. or use stdin:
  34. ```shell script
  35. cat my-spec.jvc | jvc
  36. ```
  37. ## Command Line Options
  38. #### Scratch Directory
  39. Output assets will be placed in the scratch directory, unless otherwise specified
  40. in the spec file. By default, JVC will create a new temporary directory to use as the scratch
  41. directory. You can set the scratch directory explicitly using the `-t` or `--temp-dir` option:
  42. ```shell script
  43. jvc -t /some/tempdir my-spec.json
  44. ```
  45. When using the other tools in `bin`, you can set the scratch directory via the
  46. `JVC_SCRATCH_DIR` environment variable. If the `JVC_SCRATCH_DIR` references a
  47. directory that does not exist, it will be created.
  48. #### Dry Run
  49. Use the `-n` or `--no-exec` option to print out the commands that would have been run,
  50. but do not actually run anything.
  51. ```shell script
  52. jvc -n my-spec.json # will not run any ffmpeg commands
  53. ```
  54. Note that this breaks JVC operations that require information from any assets created by
  55. previous operations: since the command did not actually run, the intermediate asset was
  56. never created.
  57. When using the other tools in `bin`, you can set the "no exec" flag via the
  58. `JVC_NO_EXEC` environment variable. If the `JVC_NO_EXEC` is non-empty, then
  59. the script will pass the `-n` flag when it calls `jvc` and commands will
  60. be printed out instead of actually being run.
  61. #### Help
  62. To view a list of all `jvc` command-line options, run `jvc -h` or `jvc --help`
  63. # What's Next?
  64. Learn about [Assets and Operations](concepts.md), the core concepts of JVC.