Javicle - a JSON Video Composition Language
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

44 Zeilen
1.1 KiB

  1. #!/bin/bash
  2. #
  3. # Merge an audio asset into the audio track of a video asset
  4. #
  5. # Usage:
  6. #
  7. # jmergeaudio video-file audio-file out-file [at]
  8. #
  9. # video-file : input video file
  10. # audio-file : audio file to insert into video
  11. # out-file : write output file here
  12. # at : when (on the video timeline) to start playing the audio
  13. # If omitted, audio will start when video starts
  14. #
  15. SCRIPT="${0}"
  16. SCRIPT_DIR="$(cd "$(dirname "${SCRIPT}")" && pwd)"
  17. . "${SCRIPT_DIR}"/jvcl_common
  18. VIDEO_FILE="${1?no video-file provided}"
  19. AUDIO_FILE="${2?no audio-file provided}"
  20. OUT_FILE="${3?no out-file provided}"
  21. T_START="${4}"
  22. echo "
  23. {
  24. \"assets\": [
  25. { \"name\": \"video_file\", \"path\": \"${VIDEO_FILE}\" },
  26. { \"name\": \"audio_file\", \"path\": \"${AUDIO_FILE}\" }
  27. ],
  28. \"operations\": [
  29. {
  30. \"operation\": \"merge-audio\",
  31. \"creates\": {
  32. \"name\": \"with_audio\",
  33. \"dest\": \"${OUT_FILE}\"
  34. },
  35. \"source\": \"video_file\",
  36. \"audio\": \"audio_file\"$(if [[ -n "${T_START}" ]] ; then echo ",
  37. \"at\": \"${T_START}\""; fi)
  38. }
  39. ]
  40. }
  41. " | "${SCRIPT_DIR}"/jvcl ${JVCL_OPTIONS}