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.

241 lines
6.3 KiB

4 years ago
4 years ago
  1. {
  2. "concurrency": 0,
  3. "profiles": {
  4. "default": {
  5. "jpeg": {
  6. "version": "1.5.0",
  7. "processors": [
  8. "cjpeg"
  9. ],
  10. "extensions": [
  11. "jpg",
  12. "jpeg"
  13. ],
  14. "outputExtension": "jpg",
  15. "forcePreserveSmallerInput": true,
  16. "command": "cjpeg -optimize -quality 90 -progressive -outfile {output_file} {input_file}"
  17. },
  18. "png": {
  19. "version": "1.5.0",
  20. "processors": [
  21. "optipng"
  22. ],
  23. "extensions": [
  24. "png"
  25. ],
  26. "outputExtension": "png",
  27. "forcePreserveSmallerInput": true,
  28. "command": "optipng -o2 -strip all -out {output_file} {input_file}"
  29. },
  30. "video": {
  31. "version": "1.5.0",
  32. "processors": [
  33. "ffmpeg"
  34. ],
  35. "extensions": [
  36. "mp4",
  37. "webm"
  38. ],
  39. "outputExtension": "webm",
  40. "command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -c:v libvpx-vp9 -b:v 0 -crf 29 -c:a libopus {output_file}"
  41. },
  42. "audio": {
  43. "version": "1.5.0",
  44. "processors": [
  45. "ffmpeg",
  46. "opusenc"
  47. ],
  48. "extensions": [
  49. "wav",
  50. "mp3"
  51. ],
  52. "outputExtension": "ogg",
  53. "command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -f wav -| opusenc --bitrate 64 --vbr --downmix-stereo --discard-comments --discard-pictures - {output_file}"
  54. }
  55. },
  56. "placebo": {
  57. "jpeg": {
  58. "version": "1.5.0",
  59. "processors": [
  60. "cp"
  61. ],
  62. "extensions": [
  63. "jpg",
  64. "jpeg"
  65. ],
  66. "outputExtension": "jpg",
  67. "preserveInputExtension": true,
  68. "preserveSmallerInput": false,
  69. "command": "cp {input_file} {output_file}"
  70. },
  71. "png": {
  72. "version": "1.5.0",
  73. "processors": [
  74. "cp"
  75. ],
  76. "extensions": [
  77. "png"
  78. ],
  79. "outputExtension": "png",
  80. "preserveInputExtension": true,
  81. "preserveSmallerInput": false,
  82. "command": "cp {input_file} {output_file}"
  83. },
  84. "video": {
  85. "version": "1.5.0",
  86. "processors": [
  87. "cp"
  88. ],
  89. "extensions": [
  90. "mp4",
  91. "webm"
  92. ],
  93. "outputExtension": "mp4",
  94. "preserveInputExtension": true,
  95. "preserveSmallerInput": false,
  96. "command": "cp {input_file} {output_file}"
  97. },
  98. "audio": {
  99. "version": "1.5.0",
  100. "processors": [
  101. "cp"
  102. ],
  103. "extensions": [
  104. "wav",
  105. "mp3"
  106. ],
  107. "outputExtension": "ogg",
  108. "preserveInputExtension": true,
  109. "preserveSmallerInput": false,
  110. "command": "cp {input_file} {output_file}"
  111. }
  112. },
  113. "webp": {
  114. "jpeg": {
  115. "version": "1.5.0",
  116. "processors": [
  117. "cwebp"
  118. ],
  119. "extensions": [
  120. "jpg",
  121. "jpeg"
  122. ],
  123. "outputExtension": "webp",
  124. "command": "cwebp -jpeg_like -q 90 -o {output_file} {input_file}"
  125. },
  126. "png": {
  127. "version": "1.5.0",
  128. "processors": [
  129. "cwebp"
  130. ],
  131. "extensions": [
  132. "png"
  133. ],
  134. "outputExtension": "webp",
  135. "command": "cwebp -lossless -o {output_file} {input_file}"
  136. }
  137. },
  138. "aggressive": {
  139. "jpeg": {
  140. "version": "1.5.0",
  141. "processors": [
  142. "ffmpeg",
  143. "cjpeg"
  144. ],
  145. "extensions": [
  146. "jpg",
  147. "jpeg"
  148. ],
  149. "outputExtension": "jpg",
  150. "forcePreserveSmallerInput": true,
  151. "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}"
  152. },
  153. "png": {
  154. "version": "1.5.0",
  155. "processors": [
  156. "optipng"
  157. ],
  158. "extensions": [
  159. "png"
  160. ],
  161. "outputExtension": "png",
  162. "forcePreserveSmallerInput": true,
  163. "command": "optipng -o2 -strip all -out {output_file} {input_file}"
  164. },
  165. "video": {
  166. "version": "1.5.0",
  167. "processors": [
  168. "ffmpeg"
  169. ],
  170. "extensions": [
  171. "mp4",
  172. "webm"
  173. ],
  174. "outputExtension": "webm",
  175. "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}"
  176. },
  177. "audio": {
  178. "version": "1.5.0",
  179. "processors": [
  180. "ffmpeg",
  181. "opusenc"
  182. ],
  183. "extensions": [
  184. "wav",
  185. "mp3"
  186. ],
  187. "outputExtension": "ogg",
  188. "command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -f wav -| opusenc --bitrate 64 --vbr --downmix-stereo --discard-comments --discard-pictures - {output_file}"
  189. }
  190. },
  191. "aggressive-webp": {
  192. "jpeg": {
  193. "version": "1.5.0",
  194. "processors": [
  195. "cwebp"
  196. ],
  197. "extensions": [
  198. "jpg",
  199. "jpeg"
  200. ],
  201. "outputExtension": "webp",
  202. "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}"
  203. },
  204. "png": {
  205. "version": "1.5.0",
  206. "processors": [
  207. "cwebp"
  208. ],
  209. "extensions": [
  210. "png"
  211. ],
  212. "outputExtension": "webp",
  213. "command": "cwebp -o {output_file} ${input_file}"
  214. },
  215. "video": {
  216. "version": "1.5.0",
  217. "processors": [
  218. "ffmpeg"
  219. ],
  220. "extensions": [
  221. "mp4",
  222. "webm"
  223. ],
  224. "outputExtension": "webm",
  225. "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}"
  226. },
  227. "audio": {
  228. "version": "1.5.0",
  229. "processors": [
  230. "ffmpeg",
  231. "opusenc"
  232. ],
  233. "extensions": [
  234. "wav",
  235. "mp3"
  236. ],
  237. "outputExtension": "ogg",
  238. "command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -f wav -| opusenc --bitrate 64 --vbr --downmix-stereo --discard-comments --discard-pictures - {output_file}"
  239. }
  240. }
  241. }
  242. }