Javicle - a JSON Video Composition Language
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

43 linhas
1.2 KiB

  1. #!/bin/bash
  2. #
  3. # Add a silent audio track to a video asset
  4. #
  5. # Usage:
  6. #
  7. # jaddsilence [-n|--no-exec] in-file out-file [channel-mode] [sampling-rate]
  8. #
  9. # -n or --no-exec : if set, do not execute ffmpeg but print what would have run
  10. # in-file : input video file
  11. # out-file : write output file here
  12. # channel-mode : channel layout, usually 'mono' or 'stereo'. Default is stereo
  13. # sampling-rate : sampling rate, in Hz. Default is 48000
  14. #
  15. SCRIPT="${0}"
  16. SCRIPT_DIR="$(cd "$(dirname "${SCRIPT}")" && pwd)"
  17. . "${SCRIPT_DIR}"/jvc_common
  18. IN_FILE="${1?no video-file provided}"
  19. OUT_FILE="${2?no out-file provided}"
  20. CHANNEL_LAYOUT="${3}"
  21. SAMPLING_RATE="${4}"
  22. echo "
  23. {
  24. \"assets\": [
  25. { \"name\": \"input\", \"path\": \"${IN_FILE}\" }
  26. ],
  27. \"operations\": [
  28. {
  29. \"operation\": \"add-silence\",
  30. \"creates\": {
  31. \"name\": \"with_silence\",
  32. \"dest\": \"${OUT_FILE}\"
  33. },
  34. \"source\": \"input\"$(if [[ -n "${CHANNEL_LAYOUT}" ]] ; then echo ",
  35. \"channelLayout\": \"${CHANNEL_LAYOUT}\"" ; fi)$(if [[ -n "${SAMPLING_RATE}" ]] ; then echo ",
  36. \"samplingRate: \"${SAMPLING_RATE}\"" ; fi)
  37. }
  38. ]
  39. }
  40. " | "${SCRIPT_DIR}"/jvc ${JVC_OPTIONS}