Javicle - a JSON Video Composition Language
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

45 rader
1.1 KiB

  1. #!/bin/bash
  2. #
  3. # Remove a track from a video file
  4. #
  5. # Usage:
  6. #
  7. # jrmtrack in-file out-file track-type [track-number]
  8. #
  9. # in-file : file to trim
  10. # out-file : write output file here
  11. # track-type : the track type to remove. Usually 'audio' or 'video'
  12. # track-number : the track number to remove. If omitted, all tracks whose
  13. # type matches `track-type` will be removed
  14. #
  15. SCRIPT="${0}"
  16. SCRIPT_DIR="$(cd "$(dirname "${SCRIPT}")" && pwd)"
  17. . "${SCRIPT_DIR}"/jvc_common
  18. IN_FILE="${1?no in-file provided}"
  19. OUT_FILE="${2?no out-file provided}"
  20. TRACK_TYPE="${3?no track-type provided}"
  21. TRACK_NUMBER="${4}"
  22. echo "
  23. {
  24. \"assets\": [
  25. { \"name\": \"input\", \"path\": \"${IN_FILE}\" }
  26. ],
  27. \"operations\": [
  28. {
  29. \"operation\": \"remove-track\",
  30. \"creates\": {
  31. \"name\": \"removed_track\",
  32. \"dest\": \"${OUT_FILE}\"
  33. },
  34. \"source\": \"input\",
  35. \"track\": {
  36. \"type\": \"${TRACK_TYPE}\"$(if [[ -n "${TRACK_NUMBER}" ]] ; then echo ",
  37. \"number\": \"${TRACK_NUMBER}\""; fi)
  38. }
  39. }
  40. ]
  41. }
  42. " | "${SCRIPT_DIR}"/jvc ${JVC_OPTIONS}