Tooling for managing asset compression, storage, and retrieval
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.

194 lines
5.6 KiB

5 years ago
5 years ago
  1. {
  2. "concurrency": 0,
  3. "profiles": {
  4. "default": {
  5. "jpeg": {
  6. "version": "1.2.1",
  7. "processors": ["cjpeg"],
  8. "extensions": [
  9. "jpg",
  10. "jpeg"
  11. ],
  12. "outputExtension": "jpg",
  13. "command": "cjpeg -optimize -quality 90 -progressive -outfile {output_file} {input_file}"
  14. },
  15. "png": {
  16. "version": "1.2.1",
  17. "processors": ["optipng"],
  18. "extensions": [
  19. "png"
  20. ],
  21. "outputExtension": "png",
  22. "command": "optipng -o2 -strip all -out {output_file} {input_file}"
  23. },
  24. "video": {
  25. "version": "1.2.1",
  26. "processors": ["ffmpeg"],
  27. "extensions": [
  28. "mp4",
  29. "webm"
  30. ],
  31. "outputExtension": "webm",
  32. "command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -c:v libvpx-vp9 -b:v 0 -crf 29 -c:a libopus {output_file}"
  33. },
  34. "audio": {
  35. "version": "1.2.1",
  36. "processors": ["ffmpeg", "opusenc"],
  37. "extensions": [
  38. "wav",
  39. "mp3"
  40. ],
  41. "outputExtension": "ogg",
  42. "command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -f wav -| opusenc --bitrate 64 --vbr --downmix-stereo --discard-comments --discard-pictures - {output_file}"
  43. }
  44. },
  45. "placebo": {
  46. "jpeg": {
  47. "version": "1.2.1",
  48. "processors": ["cp"],
  49. "extensions": [
  50. "jpg",
  51. "jpeg"
  52. ],
  53. "outputExtension": "jpg",
  54. "preserveInputExtension": true,
  55. "command": "cp {input_file} {output_file}"
  56. },
  57. "png": {
  58. "version": "1.2.1",
  59. "processors": ["cp"],
  60. "extensions": [
  61. "png"
  62. ],
  63. "outputExtension": "png",
  64. "preserveInputExtension": true,
  65. "command": "cp {input_file} {output_file}"
  66. },
  67. "video": {
  68. "version": "1.2.1",
  69. "processors": ["cp"],
  70. "extensions": [
  71. "mp4",
  72. "webm"
  73. ],
  74. "outputExtension": "mp4",
  75. "preserveInputExtension": true,
  76. "command": "cp {input_file} {output_file}"
  77. },
  78. "audio": {
  79. "version": "1.2.1",
  80. "processors": ["cp"],
  81. "extensions": [
  82. "wav",
  83. "mp3"
  84. ],
  85. "outputExtension": "ogg",
  86. "preserveInputExtension": true,
  87. "command": "cp {input_file} {output_file}"
  88. }
  89. },
  90. "webp": {
  91. "jpeg": {
  92. "version": "1.2.1",
  93. "processors": ["cwebp"],
  94. "extensions": [
  95. "jpg",
  96. "jpeg"
  97. ],
  98. "outputExtension": "webp",
  99. "command": "cwebp -jpeg_like -q 90 -o {output_file} {input_file}"
  100. },
  101. "png": {
  102. "version": "1.2.1",
  103. "processors": ["cwebp"],
  104. "extensions": [
  105. "png"
  106. ],
  107. "outputExtension": "webp",
  108. "command": "cwebp -lossless -o {output_file} {input_file}"
  109. }
  110. },
  111. "aggressive": {
  112. "jpeg": {
  113. "version": "1.2.1",
  114. "processors": ["ffmpeg", "cjpeg"],
  115. "extensions": [
  116. "jpg",
  117. "jpeg"
  118. ],
  119. "outputExtension": "jpg",
  120. "command": "export FILE={output_file} && export TEMP_FILE=${FILE}_tmp.jpg && ffmpeg -i {input_file} -vf scale=-1:720 ${TEMP_FILE} && cjpeg -optimize -quality 75 -progressive -outfile {output_file} ${TEMP_FILE} && rm ${TEMP_FILE}"
  121. },
  122. "png": {
  123. "version": "1.2.1",
  124. "processors": ["optipng"],
  125. "extensions": [
  126. "png"
  127. ],
  128. "outputExtension": "png",
  129. "command": "optipng -o2 -strip all -out {output_file} {input_file}"
  130. },
  131. "video": {
  132. "version": "1.2.1",
  133. "processors": ["ffmpeg"],
  134. "extensions": [
  135. "mp4",
  136. "webm"
  137. ],
  138. "outputExtension": "webm",
  139. "command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -vf scale=-1:720 -c:v libvpx-vp9 -b:v 0 -crf 38 -c:a libopus {output_file}"
  140. },
  141. "audio": {
  142. "version": "1.2.1",
  143. "processors": ["ffmpeg", "opusenc"],
  144. "extensions": [
  145. "wav",
  146. "mp3"
  147. ],
  148. "outputExtension": "ogg",
  149. "command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -f wav -| opusenc --bitrate 64 --vbr --downmix-stereo --discard-comments --discard-pictures - {output_file}"
  150. }
  151. },
  152. "aggressive-webp": {
  153. "jpeg": {
  154. "version": "1.2.1",
  155. "processors": ["cwebp"],
  156. "extensions": [
  157. "jpg",
  158. "jpeg"
  159. ],
  160. "outputExtension": "webp",
  161. "command": "export FILE={output_file} && export TEMP_FILE=${FILE}_tmp.jpg && ffmpeg -i {input_file} -vf scale=-1:720 ${TEMP_FILE} && cwebp -jpeg_like -q 75 -o {output_file} ${TEMP_FILE} && rm ${TEMP_FILE}"
  162. },
  163. "png": {
  164. "version": "1.2.1",
  165. "processors": ["cwebp"],
  166. "extensions": [
  167. "png"
  168. ],
  169. "outputExtension": "webp",
  170. "command": "cwebp -o {output_file} ${input_file}"
  171. },
  172. "video": {
  173. "version": "1.2.1",
  174. "processors": ["ffmpeg"],
  175. "extensions": [
  176. "mp4",
  177. "webm"
  178. ],
  179. "outputExtension": "webm",
  180. "command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -vf scale=-1:720 -c:v libvpx-vp9 -b:v 0 -crf 38 -c:a libopus {output_file}"
  181. },
  182. "audio": {
  183. "version": "1.2.1",
  184. "processors": ["ffmpeg", "opusenc"],
  185. "extensions": [
  186. "wav",
  187. "mp3"
  188. ],
  189. "outputExtension": "ogg",
  190. "command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -f wav -| opusenc --bitrate 64 --vbr --downmix-stereo --discard-comments --discard-pictures - {output_file}"
  191. }
  192. }
  193. }
  194. }