Javicle - a JSON Video Composition Language
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

jscale 1.2 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash
  2. #
  3. # Scale a media file
  4. #
  5. # Usage:
  6. #
  7. # jscale in-file out-file factor
  8. # or
  9. # jscale in-file out-file width height
  10. #
  11. # in-file : file to trim
  12. # out-file : write scaled file here
  13. # factor : scale factor
  14. # width : output width
  15. # height : output height
  16. #
  17. SCRIPT="${0}"
  18. SCRIPT_DIR="$(cd "$(dirname "${SCRIPT}")" && pwd)"
  19. . "${SCRIPT_DIR}"/jvc_common
  20. IN_FILE="${1?no in-file provided}"
  21. OUT_FILE="${2?no out-file provided}"
  22. WIDTH="${3}"
  23. HEIGHT="${4}"
  24. FACTOR=""
  25. if [[ -z "${HEIGHT}" ]] ; then
  26. FACTOR=${WIDTH}
  27. echo "
  28. {
  29. \"assets\": [
  30. { \"name\": \"input\", \"path\": \"${IN_FILE}\" }
  31. ],
  32. \"operations\": [
  33. {
  34. \"operation\": \"scale\",
  35. \"creates\": {
  36. \"name\": \"scaled\",
  37. \"dest\": \"${OUT_FILE}\"
  38. },
  39. \"source\": \"input\",
  40. \"factor\": \"${FACTOR}\"
  41. }
  42. ]
  43. }
  44. " | "${SCRIPT_DIR}"/jvc ${JVC_OPTIONS}
  45. else
  46. echo "
  47. {
  48. \"assets\": [
  49. { \"name\": \"input\", \"path\": \"${IN_FILE}\" }
  50. ],
  51. \"operations\": [
  52. {
  53. \"operation\": \"scale\",
  54. \"creates\": {
  55. \"name\": \"scaled\",
  56. \"dest\": \"${OUT_FILE}\"
  57. },
  58. \"source\": \"input\",
  59. \"width\": \"${WIDTH}\",
  60. \"height\": \"${HEIGHT}\"
  61. }
  62. ]
  63. }
  64. " | "${SCRIPT_DIR}"/jvc ${JVC_OPTIONS}
  65. fi