
{"id":2027,"date":"2022-08-06T17:20:23","date_gmt":"2022-08-06T09:20:23","guid":{"rendered":"http:\/\/dba.qishuo.xin\/?p=2027"},"modified":"2022-08-06T17:39:24","modified_gmt":"2022-08-06T09:39:24","slug":"%e5%a6%82%e4%bd%95%e5%88%b6%e4%bd%9cwebp%e6%a0%bc%e5%bc%8f%e7%9a%84%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"http:\/\/dba.qishuo.xin\/?p=2027","title":{"rendered":"\u5982\u4f55\u5236\u4f5cWebP\u683c\u5f0f\u7684\u6587\u4ef6"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_76 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<label for=\"ez-toc-cssicon-toggle-item-69e5f104328b7\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e5f104328b7\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#1_%E4%BB%80%E4%B9%88%E6%98%AFWebP\" >1. \u4ec0\u4e48\u662fWebP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#2_WebP%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8\" >2. WebP\u5982\u4f55\u4f7f\u7528<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#21_%E4%B8%8B%E8%BD%BD\" >2.1. \u4e0b\u8f7d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#22_%E5%AE%89%E8%A3%85\" >2.2. \u5b89\u88c5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#23_%E5%B7%A5%E5%85%B7%E4%BB%8B%E7%BB%8D\" >2.3. \u5de5\u5177\u4ecb\u7ecd<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#24_pngjpg_%E4%B8%8E_Webp_%E7%9B%B8%E4%BA%92%E8%BD%AC%E6%8D%A2\" >2.4. png\/jpg \u4e0e Webp \u76f8\u4e92\u8f6c\u6362<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#3_%E5%B0%86%E5%A4%9A%E5%BC%A0%E5%9B%BE%E7%89%87%E5%88%B6%E4%BD%9C%E6%88%90WebP\" >3. \u5c06\u591a\u5f20\u56fe\u7247\u5236\u4f5c\u6210WebP<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#31_%E4%B8%8B%E8%BD%BDimagemagic\" >3.1. \u4e0b\u8f7dimagemagic<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#32_%E5%AE%89%E8%A3%85imagemagic\" >3.2. \u5b89\u88c5imagemagic<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#33_%E4%BD%BF%E7%94%A8_magick_mogrify_%E5%91%BD%E4%BB%A4%E4%BF%AE%E6%94%B9%E5%9B%BE%E7%89%87%E5%B0%BA%E5%AF%B8\" >3.3. \u4f7f\u7528 magick mogrify \u547d\u4ee4\u4fee\u6539\u56fe\u7247\u5c3a\u5bf8<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#34_%E4%BD%BF%E7%94%A8_img2webp_%E5%91%BD%E4%BB%A4%E5%B0%86%E5%9B%BE%E7%89%87%E5%90%88%E5%B9%B6%E6%88%90%E5%8A%A8%E5%9B%BE\" >3.4. \u4f7f\u7528 img2webp \u547d\u4ee4\u5c06\u56fe\u7247\u5408\u5e76\u6210\u52a8\u56fe<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#4_%E5%B0%86%E8%A7%86%E9%A2%91%E6%96%87%E4%BB%B6%E5%88%B6%E4%BD%9C%E6%88%90webP\" >4. \u5c06\u89c6\u9891\u6587\u4ef6\u5236\u4f5c\u6210webP<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#41_ffmpeg%E5%B7%A5%E5%85%B7%E4%B8%8B%E8%BD%BD%E4%B8%8E%E5%AE%89%E8%A3%85\" >4.1. ffmpeg\u5de5\u5177\u4e0b\u8f7d\u4e0e\u5b89\u88c5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#42_%E4%BD%BF%E7%94%A8_ffmpeg_%E5%B0%86%E8%A7%86%E9%A2%91%E5%88%86%E5%89%B2%E6%88%90%E5%9B%BE%E7%89%87\" >4.2. \u4f7f\u7528 ffmpeg \u5c06\u89c6\u9891\u5206\u5272\u6210\u56fe\u7247<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#43_%E6%9C%80%E5%90%8E%E5%86%8D%E5%88%A9%E7%94%A8_img2webp_%E5%91%BD%E4%BB%A4%E5%B0%86%E5%9B%BE%E7%89%87%E5%90%88%E5%B9%B6%E6%88%90%E5%8A%A8%E5%9B%BE\" >4.3. \u6700\u540e\u518d\u5229\u7528 img2webp \u547d\u4ee4\u5c06\u56fe\u7247\u5408\u5e76\u6210\u52a8\u56fe<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#44_Windows%E7%94%9F%E6%88%90%E5%8A%A8%E5%9B%BE%E7%9A%84Bat%E8%84%9A%E6%9C%AC\" >4.4. Windows\u751f\u6210\u52a8\u56fe\u7684Bat\u811a\u672c<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"http:\/\/dba.qishuo.xin\/?p=2027\/#%E9%99%84%E5%BD%95%EF%BC%9AWebP%E5%9B%BE%E7%89%87%E5%B1%95%E7%A4%BA\" >\u9644\u5f55\uff1aWebP\u56fe\u7247\u5c55\u793a<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"1_%E4%BB%80%E4%B9%88%E6%98%AFWebP\"><\/span>1. \u4ec0\u4e48\u662fWebP<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>WebP\uff08\u53d1\u97f3\uff1a weppy \uff09\u662f\u8c37\u6b4c2010\u5e74\u53d1\u5e03\u7684\u4e00\u79cd\u65b0\u7684\u56fe\u7247\u683c\u5f0f\uff0c\u53ef\u4e3a Web \u4e0a\u7684\u56fe\u50cf\u63d0\u4f9b\u5353\u8d8a\u7684\u65e0\u635f\u548c\u6709\u635f\u538b\u7f29\u3002 \u4f7f\u7528 WebP\uff0c\u7f51\u7ad9\u7ba1\u7406\u5458\u548c Web \u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u521b\u5efa\u66f4\u5c0f\u3001\u66f4\u4e30\u5bcc\u7684\u56fe\u50cf\uff0c\u4ece\u800c\u4f7f Web \u66f4\u5feb\u3002<\/p>\n<ul>\n<li>\u540c\u6837\u7684\u5206\u8fa8\u7387\uff0c\u5927\u5c0f\u6bd4 jpg\u3001png \u5c0f 25% \u4ee5\u4e0a\uff1b<\/li>\n<li>Chrome\u3001Firefox\u3001Edge\u3001Opera \u7b49\u90fd\u652f\u6301\u6b64\u683c\u5f0f\u3002<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"2_WebP%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8\"><\/span>2. WebP\u5982\u4f55\u4f7f\u7528<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"21_%E4%B8%8B%E8%BD%BD\"><\/span>2.1. \u4e0b\u8f7d<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u4e0b\u8f7d\u5bf9\u5e94\u5e73\u53f0\u8f6f\u4ef6\u5305\uff0c\u8f6f\u4ef6\u5305\u4e2d\u5305\u542b png\/jpg \u4e0e webp \u76f8\u4e92\u8f6c\u6362\u7684\u5de5\u5177\u4ee5\u53ca\u5f00\u53d1\u6240\u9700\u7684\u5e93\u548c\u5934\u6587\u4ef6\u3002<br \/>\n\u4e0b\u8f7d\u94fe\u63a5\u5730\u5740\u4e3a\uff1a<a target=\"_blank\" href=\"https:\/\/storage.googleapis.com\/downloads.webmproject.org\/releases\/webp\/index.html\">https:\/\/storage.googleapis.com\/downloads.webmproject.org\/releases\/webp\/index.html<\/a><\/p>\n<ul>\n<li>Windows\u7248\u672c\uff1alibwebp-1.2.3-windows-x64.zip<\/li>\n<li>Linux\u7248\u672c\uff1alibwebp-1.2.3-linux-x86-64.tar.gz<\/li>\n<li>Mac\u7248\u672c\uff1alibwebp-1.2.3-mac-x86-64.tar.gz<\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"22_%E5%AE%89%E8%A3%85\"><\/span>2.2. \u5b89\u88c5<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u4ee5Windows\u7248\u672c\u4e3a\u4f8b\uff0c\u4e0b\u8f7d\u5b8c\u6210\u540e\u89e3\u538b\u81f3\u67d0\u4e2a\u8def\u5f84\u4e0b\uff0c\u7136\u540e\u5c06\u5176\u4e2d\u7684bin\u76ee\u5f55\u8def\u5f84\u6dfb\u52a0\u81f3\u73af\u5883\u53d8\u91cfpath\u4e0b\u5373\u53ef\uff1a<br \/>\n<a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/08\/image-1659764219522.png\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/08\/image-1659764219522.png\" alt=\"file\" \/><\/a><\/p>\n<p><strong>bin\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u6709\uff1a<\/strong><br \/>\n<a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/08\/image-1659764458113.png\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/08\/image-1659764458113.png\" alt=\"file\" \/><\/a><\/p>\n<h4><span class=\"ez-toc-section\" id=\"23_%E5%B7%A5%E5%85%B7%E4%BB%8B%E7%BB%8D\"><\/span>2.3. \u5de5\u5177\u4ecb\u7ecd<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>1) cwebp<br \/>\n\u7528\u4e8e\u5c06\u5176\u4ed6\u683c\u5f0f\u56fe\u7247\u8f6c\u6362\u4e3a WebP\uff0c\u652f\u6301\u7684\u683c\u5f0f\u6709\uff1aPNG\u3001JPEG\u3001TIFF\u3001WebP \u6216\u539f\u59cb Y'CbCr \u6837\u672c\u3002<\/p>\n<pre><code>cwebp [options] -q quality input.png -o output.webp\n\u5176\u4e2doption\u53ef\u9009\uff1a-loss(\u6709\u635f\u538b\u7f29\uff0c\u9ed8\u8ba4\uff09\uff0c-lossless(\u65e0\u635f\u538b\u7f29\uff09\n-q\uff1a\u8d28\u91cf\u6307\u6570\uff08\u538b\u7f29\u7387\uff09\uff0c\u6709\u635f\u538b\u7f29\u6709\u6548\uff0c\u65e0\u635f\u538b\u7f29\u5ffd\u7565\ninput.png\uff1a\u5f85\u8f6c\u6362\u56fe\u7247\n-o\uff1a\u8f93\u5165\u56fe\u7247\u540d\u79f0\u683c\u5f0f\u3002<\/code><\/pre>\n<p>2) dwebp<br \/>\n\u5c06 WebP \u8f6c\u6362\u4e3a\u56fe\u50cf\uff0c\u652f\u6301\u7684\u683c\u5f0f\u6709\uff1aJPG\u3001PNG\u3001PAM\u3001PPM \u6216 PGM \u56fe\u50cf\u3002<\/p>\n<pre><code>dwebp input.webp -o output.png -quiet\n\u5176\u4e2dinput.webp\u8868\u793a\u8f93\u5165webp\u6587\u4ef6\uff0coutput.png\u8868\u793a\u8f93\u51fapng\u6587\u4ef6\uff0c-quiet\u8868\u793a\u9759\u9ed8\u6a21\u5f0f\uff08\u4e0d\u8f93\u51fa\u6253\u5370\u4fe1\u606f\uff09<\/code><\/pre>\n<p>3\uff09gif2webp<br \/>\n\u5c06 GIF \u56fe\u50cf\u8f6c\u6362\u4e3a WebP\u3002<\/p>\n<pre><code>gif2webp picture.gif -o picture.webp<\/code><\/pre>\n<p>4) img2webp<br \/>\n\u4ece\u8f93\u5165\u56fe\u50cf\u5e8f\u5217\u521b\u5efa\u52a8\u753b WebP \u6587\u4ef6\uff0c\u652f\u6301\u7684\u683c\u5f0f\u6709\uff1aPNG\u3001JPEG\u3001TIFF \u6216 WebP\u3002<\/p>\n<pre><code>img2webp -loop 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp<\/code><\/pre>\n<p>\u5177\u4f53\u7528\u6cd5\u53c2\u89c1\uff1a\u7b2c\u4e09\u7ae0\u8282\u3002<\/p>\n<p>4) vwebp<br \/>\n\u89e3\u538b\u7f29 WebP \u6587\u4ef6\u5e76\u4f7f\u7528 OpenGL \u5728\u7a97\u53e3\u4e2d\u663e\u793a\u5b83\u3002<\/p>\n<pre><code>vwebp input.webp \u6216\u8005 vwebp input.webp -info\n\u5176\u4e2dinput.webp\u8868\u793a\u8f93\u5165webp\u6587\u4ef6\uff0c-info\u8868\u793a\u6253\u5370\u4fe1\u606f\u3002<\/code><\/pre>\n<p>5) webpinfo<br \/>\n\u7528\u4e8e\u8f93\u51fawebp\u6587\u4ef6\u4fe1\u606f<\/p>\n<pre><code>webpinfo input.webp\n\u5176\u4e2dinput.webp\u8868\u793a\u8f93\u5165webp\u6587\u4ef6\u3002<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"24_pngjpg_%E4%B8%8E_Webp_%E7%9B%B8%E4%BA%92%E8%BD%AC%E6%8D%A2\"><\/span>2.4. png\/jpg \u4e0e Webp \u76f8\u4e92\u8f6c\u6362<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li>\n<p>webp \u8f6c png\/jpg<\/p>\n<pre><code>dwebp xxx.webp -o xxx.png\ndwebp xxx.webp -o xxx.jpg<\/code><\/pre>\n<\/li>\n<li>\n<p>3\u3001png\/jpg \u8f6c webp<\/p>\n<pre><code>cwebp -q 100 xxx.png -o xxx.webp\ncwebp -q 100 xxx.jpg -o xxx.webp<\/code><\/pre>\n<\/li>\n<li>\n<p>\u6279\u91cf webp \u8f6c png<\/p>\n<pre><code>find .\/ -name &quot;*.webp&quot; -exec dwebp {} -o {}.png;<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"3_%E5%B0%86%E5%A4%9A%E5%BC%A0%E5%9B%BE%E7%89%87%E5%88%B6%E4%BD%9C%E6%88%90WebP\"><\/span>3. \u5c06\u591a\u5f20\u56fe\u7247\u5236\u4f5c\u6210WebP<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/08\/image-1659769091612.png\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/08\/image-1659769091612.png\" alt=\"file\" \/><\/a><br \/>\n\u539f\u56e0\uff1a\u6709\u56fe\u7247\u5c3a\u5bf8\u4e0d\u4e00\u81f4\uff0c\u662f\u65e0\u6cd5\u8f6c\u6362\u6210\u529f\u7684\uff0c\u9700\u8981\u627e\u8bbe\u8ba1\u91cd\u65b0\u7ed9\u56fe\uff0c\u5c3a\u5bf8\u5927\u5c0f\u9700\u8981\u4e00\u6a21\u4e00\u6837\u3002<\/p>\n<h4><span class=\"ez-toc-section\" id=\"31_%E4%B8%8B%E8%BD%BDimagemagic\"><\/span>3.1. \u4e0b\u8f7dimagemagic<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u4e0b\u8f7d\u5730\u5740\uff1a<a target=\"_blank\" href=\"https:\/\/imagemagick.org\/script\/download.php#windows\">https:\/\/imagemagick.org\/script\/download.php#windows<\/a><\/p>\n<p><a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/08\/image-1659771949610.png\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/08\/image-1659771949610.png\" alt=\"file\" \/><\/a><\/p>\n<h4><span class=\"ez-toc-section\" id=\"32_%E5%AE%89%E8%A3%85imagemagic\"><\/span>3.2. \u5b89\u88c5imagemagic<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u70b9\u51fbexe\u7a0b\u5e8f\u8fdb\u884c\u5b89\u88c5<\/p>\n<h4><span class=\"ez-toc-section\" id=\"33_%E4%BD%BF%E7%94%A8_magick_mogrify_%E5%91%BD%E4%BB%A4%E4%BF%AE%E6%94%B9%E5%9B%BE%E7%89%87%E5%B0%BA%E5%AF%B8\"><\/span>3.3. \u4f7f\u7528 <code>magick mogrify<\/code> \u547d\u4ee4\u4fee\u6539\u56fe\u7247\u5c3a\u5bf8<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code>D:\\tools\\ImageMagick-7.1.0-Q16-HDRI\\magick.exe mogrify -resize 1910x930! *.png<\/code><\/pre>\n<p><span style='color:red'>\u6ce8\u610f1910x930\u4e2d\u95f4\u662f\u5c0f\u5199\u5b57\u6bcdx\uff0c\u4e0d\u662f*\u53f7\u3002!\u8868\u793a\u8981\u5c06\u56fe\u50cf\u8c03\u6574\u4e3a\u7279\u5b9a\u5c3a\u5bf8\u800c\u53c8\u4e0d\u4fdd\u6301\u539f\u59cb\u56fe\u50cf\u7684\u5bbd\u9ad8\u6bd4\u3002<\/span><\/p>\n<p>\u5177\u4f53\u7528\u6cd5\u53c2\u89c1\u5b98\u65b9\u7f51\u7ad9\uff1a<a target=\"_blank\" href=\"https:\/\/imagemagick.org\/script\/mogrify.php\">https:\/\/imagemagick.org\/script\/mogrify.php<\/a><br \/>\n\u4f7f\u7528ImageMagick\u8c03\u6574\u56fe\u50cf\u5927\u5c0f\uff1a<a target=\"_blank\" href=\"https:\/\/blog.csdn.net\/cukw6666\/article\/details\/107984135\">https:\/\/blog.csdn.net\/cukw6666\/article\/details\/107984135<\/a><\/p>\n<h4><span class=\"ez-toc-section\" id=\"34_%E4%BD%BF%E7%94%A8_img2webp_%E5%91%BD%E4%BB%A4%E5%B0%86%E5%9B%BE%E7%89%87%E5%90%88%E5%B9%B6%E6%88%90%E5%8A%A8%E5%9B%BE\"><\/span>3.4. \u4f7f\u7528 <code>img2webp<\/code> \u547d\u4ee4\u5c06\u56fe\u7247\u5408\u5e76\u6210\u52a8\u56fe<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code>img2webp -loop -0 -lossy  1.png  -d 1000 2.png  -d 1000 3.png  -d 1000 4.png  -d 1000 5.png  -d 1000 6.png  -d 1000 7.png  -d 1000 8.png  -d 1000 9.png  -d 1000 10.png  -d 1000 11.png  -d 1000 12.png  -d 1000 13.png  -d 1000 -o output.webp<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"4_%E5%B0%86%E8%A7%86%E9%A2%91%E6%96%87%E4%BB%B6%E5%88%B6%E4%BD%9C%E6%88%90webP\"><\/span>4. \u5c06\u89c6\u9891\u6587\u4ef6\u5236\u4f5c\u6210webP<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u4e3b\u8981\u4f7f\u7528 ffmpeg \u5de5\u5177\u5c06\u89c6\u9891<\/p>\n<h4><span class=\"ez-toc-section\" id=\"41_ffmpeg%E5%B7%A5%E5%85%B7%E4%B8%8B%E8%BD%BD%E4%B8%8E%E5%AE%89%E8%A3%85\"><\/span>4.1. ffmpeg\u5de5\u5177\u4e0b\u8f7d\u4e0e\u5b89\u88c5<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u4e0b\u8f7d\u5730\u5740\uff1a<a target=\"_blank\" href=\"https:\/\/github.com\/BtbN\/FFmpeg-Builds\/releases\/tag\/latest\">https:\/\/github.com\/BtbN\/FFmpeg-Builds\/releases\/tag\/latest<\/a><\/p>\n<ul>\n<li>Linux\u7248\u672c\uff1affmpeg-master-latest-linux64-gpl-shared.tar.xz<\/li>\n<li>Windows\u7248\u672c\uff1affmpeg-n5.1-latest-win64-gpl-shared-5.1.zip<\/li>\n<\/ul>\n<p>windows\u5b89\u88c5\u65b9\u6cd5\u662f\uff1a\u4e0b\u8f7d\u89e3\u538b\u81f3\u672c\u5730\u6587\u4ef6\uff0c\u7136\u540e\u6dfb\u52a0\u5230\u73af\u5883\u53d8\u91cf<br \/>\n<a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/08\/image-1659774272558.png\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/08\/image-1659774272558.png\" alt=\"file\" \/><\/a><\/p>\n<p>\u6253\u5f00cmd\u7a97\u53e3\uff0c\u8f93\u5165ffmepg\u5373\u53ef\u5f00\u542f\u3002<br \/>\n\u5176\u4ed6\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u65b9\u6cd5\u89c1\uff1a<a target=\"_blank\" href=\"https:\/\/blog.csdn.net\/weixin_44704985\/article\/details\/109532224\">https:\/\/blog.csdn.net\/weixin_44704985\/article\/details\/109532224<\/a><\/p>\n<h4><span class=\"ez-toc-section\" id=\"42_%E4%BD%BF%E7%94%A8_ffmpeg_%E5%B0%86%E8%A7%86%E9%A2%91%E5%88%86%E5%89%B2%E6%88%90%E5%9B%BE%E7%89%87\"><\/span>4.2. \u4f7f\u7528 <code>ffmpeg<\/code> \u5c06\u89c6\u9891\u5206\u5272\u6210\u56fe\u7247<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code>D:\\tools\\ffmpeg\\bin\\ffmpeg.exe -i 20220805_181425.mp4 -ss 00:00:00 -y -f image2 -vf fps=1.6 -s 1920*1080 -qscale:v 4 .\\images\\%d.jpg<\/code><\/pre>\n<p>\u53c2\u6570\u542b\u4e49\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u53c2\u6570<\/th>\n<th style=\"text-align: left;\">\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">-i<\/td>\n<td style=\"text-align: left;\">\u8868\u793a\u62bd\u5e27\u7684\u89c6\u9891<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">-ss<\/td>\n<td style=\"text-align: left;\">\u8868\u793a\u62bd\u53d6\u89c6\u9891\u7684\u5f00\u59cb\u65f6\u95f4<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">-t<\/td>\n<td style=\"text-align: left;\">\u8868\u793a\u62bd\u53d6\u7684\u65f6\u95f4\u957f\u5ea6<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">fps<\/td>\n<td style=\"text-align: left;\"><span style='color:red'>\u5e27\u7387\uff0c\u8868\u793a\u6bcf\u79d2\u949f\u4ece\u89c6\u9891\u4e2d\u62bd\u53d6\u591a\u5c11\u5e27\u5f62\u6210\u56fe\u7247<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">-s<\/td>\n<td style=\"text-align: left;\">\u8868\u793a\u89c6\u9891\u7684\u957f\u5bbd<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">-y<\/td>\n<td style=\"text-align: left;\">\u8986\u76d6\u8f93\u51fa\u6587\u4ef6\uff0c\u5373\u5982\u679c\u6587\u4ef6\u5df2\u7ecf\u5b58\u5728\u7684\u8bdd\uff0c\u4e0d\u7ecf\u63d0\u793a\u5c31\u8986\u76d6\u6389\u4e86<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">-f  fmt<\/td>\n<td style=\"text-align: left;\">\u6307\u5b9a\u683c\u5f0f(\u97f3\u9891\u6216\u89c6\u9891\u683c\u5f0f)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5176\u4ed6\u53c2\u6570\u89c1\uff1a<a target=\"_blank\" href=\"https:\/\/www.jianshu.com\/p\/049d03705a81\">https:\/\/www.jianshu.com\/p\/049d03705a81<\/a><\/p>\n<h4><span class=\"ez-toc-section\" id=\"43_%E6%9C%80%E5%90%8E%E5%86%8D%E5%88%A9%E7%94%A8_img2webp_%E5%91%BD%E4%BB%A4%E5%B0%86%E5%9B%BE%E7%89%87%E5%90%88%E5%B9%B6%E6%88%90%E5%8A%A8%E5%9B%BE\"><\/span>4.3. \u6700\u540e\u518d\u5229\u7528 <code>img2webp<\/code> \u547d\u4ee4\u5c06\u56fe\u7247\u5408\u5e76\u6210\u52a8\u56fe<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code>img2webp -loop 0 -lossy  1.jpg  -d 300 2.jpg  -d 300 3.jpg  -d 300 4.jpg  -d 300 5.jpg  -d 300 6.jpg  -d 300 7.jpg  -d 300 8.jpg  -d 300 9.jpg  -d 300 10.jpg  -d 300 11.jpg  -d 300 12.jpg  -d 300 13.jpg  -o output.webp<\/code><\/pre>\n<p>\u53c2\u6570\u542b\u4e49\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u53c2\u6570<\/th>\n<th style=\"text-align: left;\">\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">-loop<\/td>\n<td style=\"text-align: left;\">\u4ee3\u8868\u5faa\u73af\uff0c0\u5c31\u662f\u4e00\u76f4\u5faa\u73af\uff0c1\u662f\u91cd\u590d1\u904d<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">-d<\/td>\n<td style=\"text-align: left;\">\u8868\u793a\u6bcf\u5f20\u56fe\u7247\u5c55\u793a\u7684\u65f6\u95f4\u957f\u5ea6\uff0c\u5355\u4f4d\uff1a\u6beb\u79d2<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">-lossless, -lossy<\/td>\n<td style=\"text-align: left;\">\u4f7f\u7528\u65e0\u635f\u6216\u6709\u635f\u538b\u7f29\u6a21\u5f0f\u538b\u7f29\u4e0b\u4e00\u4e2a\u56fe\u50cf\u3002\u9ed8\u8ba4\u6a21\u5f0f\u662f\u65e0\u635f\u7684\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">-o<\/td>\n<td style=\"text-align: left;\">\u8f93\u51fa\u5230\u6587\u4ef6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4><span class=\"ez-toc-section\" id=\"44_Windows%E7%94%9F%E6%88%90%E5%8A%A8%E5%9B%BE%E7%9A%84Bat%E8%84%9A%E6%9C%AC\"><\/span>4.4. Windows\u751f\u6210\u52a8\u56fe\u7684Bat\u811a\u672c<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-bat\">@echo off &amp; setlocal EnableDelayedExpansion\nset path=%~dp0\nset file_name_str=\n\ncd %path%\nmkdir \\images\nD:\\tools\\ffmpeg\\bin\\ffmpeg.exe -i 20220805_181425.mp4 -ss 00:00:00 -y -f image2 -vf fps=4 -s 1920*1080 -qscale:v 4 .\\images\\%%d.jpg\n\nrem Create an array with filenames in right order\ncd %path%images\nfor %%f in (*.jpg) do (\n   for \/F &quot;delims=-&quot; %%n in (&quot;%%f&quot;) do (\n      set &quot;number=00000%%n&quot;\n      set &quot;file[!number:~-6!]=%%f&quot;\n   )\n)\n\nrem Process the filenames in right order\nfor \/F &quot;tokens=2 delims==&quot; %%f in (&#039;set file[&#039;) do (\n  set  file_name_str=!file_name_str! %%f, -d 300\n)\n\nset &quot;file_name_str=%file_name_str:,= %&quot;\n\nD:\\tools\\libwebp\\bin\\img2webp.exe -loop 0 -lossy %file_name_str% -o output.webp\n\npause<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E9%99%84%E5%BD%95%EF%BC%9AWebP%E5%9B%BE%E7%89%87%E5%B1%95%E7%A4%BA\"><\/span>\u9644\u5f55\uff1aWebP\u56fe\u7247\u5c55\u793a<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/08\/demo01.webp\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/08\/demo01.webp\" alt=\"file\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u4ec0\u4e48\u662fWebP WebP\uff08\u53d1\u97f3\uff1a weppy&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[224],"tags":[225],"class_list":["post-2027","post","type-post","status-publish","format-standard","hentry","category-224","tag-webp"],"_links":{"self":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/2027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2027"}],"version-history":[{"count":27,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/2027\/revisions"}],"predecessor-version":[{"id":2061,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/2027\/revisions\/2061"}],"wp:attachment":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2027"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}