Javicle - a JSON Video Composition Language
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

43 строки
943 B

  1. #!/bin/bash
  2. #
  3. # Trim a media file
  4. #
  5. # Usage:
  6. #
  7. # jtrim in-file out-file [start] [end]
  8. #
  9. # in-file : file to trim
  10. # out-file : write trimmed file here
  11. # start : seconds to trim from the beginning. if omitted, default value is start of the file
  12. # end : retain the file until this number of seconds. if omitted, default is to end of file
  13. #
  14. SCRIPT="${0}"
  15. SCRIPT_DIR="$(cd "$(dirname "${SCRIPT}")" && pwd)"
  16. . "${SCRIPT_DIR}"/jvcl_common
  17. IN_FILE="${1?no in-file provided}"
  18. OUT_FILE="${2?no out-file provided}"
  19. T_START="${3}"
  20. T_END="${4}"
  21. echo "
  22. {
  23. \"assets\": [
  24. { \"name\": \"input\", \"path\": \"${IN_FILE}\" }
  25. ],
  26. \"operations\": [
  27. {
  28. \"operation\": \"trim\",
  29. \"creates\": {
  30. \"name\": \"trimmed\",
  31. \"dest\": \"${OUT_FILE}\"
  32. },
  33. \"perform\": {
  34. \"trim\": \"input\",
  35. \"start\": \"${T_START}s\",
  36. \"end\": \"${T_END}s\"
  37. }
  38. }
  39. ]
  40. }
  41. " | "${SCRIPT_DIR}"/jvcl