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.

202 lines
5.9 KiB

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