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.

1234567891011121314151617181920212223242526272829303132333435363738394041
  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}"/jvc_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. \"source\": \"input\",
  34. \"start\": \"${T_START}\",
  35. \"end\": \"${T_END}\"
  36. }
  37. ]
  38. }
  39. " | "${SCRIPT_DIR}"/jvc ${JVC_OPTIONS}