{"id":10743,"date":"2023-08-08T14:08:23","date_gmt":"2023-08-08T06:08:23","guid":{"rendered":"https:\/\/blog.iyatt.com\/?p=10743"},"modified":"2024-05-05T23:20:47","modified_gmt":"2024-05-05T15:20:47","slug":"%e8%a7%86%e9%a2%91%e9%87%8d%e6%96%b0%e7%bc%96%e7%a0%81-%e5%8e%8b%e7%bc%a9%e4%bd%93%e7%a7%af","status":"publish","type":"post","link":"https:\/\/blog.iyatt.com\/?p=10743","title":{"rendered":"\u89c6\u9891\u91cd\u65b0\u7f16\u7801\uff0c\u7f29\u5c0f\u89c6\u9891\u6587\u4ef6"},"content":{"rendered":"<p>\u76ee\u524d\u6700\u901a\u7528\u7684\u89c6\u9891\u7f16\u7801\u5668\u662f H.264\/AVC\uff0c\u5b83\u7684\u65b0\u7248 H.265\/HEVC \u76f8\u6bd4\u4e8e\u524d\u8005\u53ef\u4ee5\u5728<strong>\u76f8\u540c\u89c6\u9891\u8d28\u91cf<\/strong>\u7684\u60c5\u51b5\u4e0b\u5c06<strong>\u7801\u7387\u7f29\u5c0f\u4e00\u534a<\/strong>\uff0c<code class=\"katex-inline\">\u89c6\u9891\u6587\u4ef6\u5927\u5c0f=\u7801\u7387\\times\u89c6\u9891\u65f6\u957f<\/code>\u3002<br \/>\n\u6bd4\u5982\uff0c\u6211\u8fd9\u91cc\u7528\u624b\u673a\u62cd\u6444\u7684\u4e24\u6bb5\u89c6\u9891\uff08Redmi Note 12 Pro &#8211; MIUI 14.0.2 &#8211;  Android 13 &#8211; 1920&#215;1080\uff09\uff0c\u4e00\u6bb5 5 \u79d2\u949f\u7684\u89c6\u9891 15.6 MB\uff0c\u53e6\u5916\u4e00\u6bb5 3 \u79d2\u949f\u7684\u89c6\u9891 9.42 MB<\/p>\n<p>\u7528 FFmpeg \u5de5\u5177\u67e5\u770b\u4e86\u7f16\u7801\u5668\u662f h264<\/p>\n<pre><code class=\"language-bash\">ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 &lt;\u89c6\u9891\u6587\u4ef6\u540d&gt;<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2023\/08\/image-1691472558688.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 682px; --smush-placeholder-aspect-ratio: 682\/60;\" \/><\/p>\n<p>\u7136\u540e\u6211\u7528 FFmpeg \u5c06\u89c6\u9891\u91cd\u65b0\u7f16\u7801\u4e3a h265 \u540e\uff0c\u6587\u4ef6\u5927\u5c0f\u5c31\u5206\u522b\u53ea\u6709 1.48 MB \u548c 844 KB\u3002<\/p>\n<p>\u597d\u591a\u7535\u5f71\u52a8\u4e0d\u52a8\u51e0 GB \u751a\u81f3\u5341\u591a GB \u7684\uff0c\u901a\u8fc7\u91cd\u65b0\u7f16\u7801\u540e\u5927\u5927\u7f29\u5c0f\u3002<br \/>\n\u8fd9\u91cc\u4e24\u767e\u591a\u90e8\u7535\u5f71\u90fd\u662f\u7ecf\u8fc7\u91cd\u65b0\u538b\u7f29\u7684\uff0c\u603b\u4f53\u79ef\u4e5f\u624d 105 GB\u3002<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2023\/08\/image-1691472941203.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 305px; --smush-placeholder-aspect-ratio: 305\/173;\" \/><br \/>\n\u53e6\u5916\u8fd8\u6709\u4e94\u767e\u591a\u96c6\u7684\u52a8\u6f2b\uff0c\u5360\u7528\u53ea\u6709 44.3 GB\uff0c\u90fd\u662f\u91cd\u65b0\u7f16\u7801\u8fc7\u7684<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2023\/08\/image-1691473015304.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 323px; --smush-placeholder-aspect-ratio: 323\/174;\" \/><\/p>\n<p>\u6211\u4e4b\u524d\u5199\u4e86\u4e00\u4e2a PowerShell \u7684\u811a\u672c\u4e13\u95e8\u7528\u6765\u6279\u91cf\u7f16\u7801\u89c6\u9891\uff0c\u7f16\u7801\u540e\u7edf\u4e00\u8f93\u51fa\u89c6\u9891\u683c\u5f0f\u4e3a <code>.mp4<\/code>\u3002<br \/>\n\u8fd9\u4e2a\u811a\u672c\u4f9d\u8d56\u4e8e FFmpeg\uff0c\u7528\u4e8e\u7f16\u7801\uff0c\u914d\u7f6e\u53c2\u8003\uff1a<a href=\"https:\/\/blog.iyatt.com\/?p=8613\">https:\/\/blog.iyatt.com\/?p=8613<\/a><br \/>\n\u53e6\u5916\uff0cWindows \u9ed8\u8ba4\u7981\u6b62 PowerShell \u7684\u811a\u672c\u8fd0\u884c\uff0c\u9700\u8981\u4fee\u6539\u6267\u884c\u7b56\u7565\uff0c\u914d\u7f6e\u53c2\u8003\uff1a<a href=\"https:\/\/blog.iyatt.com\/?p=10735\">https:\/\/blog.iyatt.com\/?p=10735<\/a><\/p>\n<pre><code class=\"language-powershell\">if (-not (Test-Path -Path &quot;dest&quot;)) {\n    New-Item -ItemType Directory -Path &quot;dest&quot;, &quot;src&quot;\n}\n\n$video_formats = @(&quot;*.mp4&quot;, &quot;*.avi&quot;, &quot;*.mkv&quot;, &quot;*.mov&quot;, &quot;*.wmv&quot;, &quot;*.flv&quot;, &quot;*.mpg&quot;, &quot;*.rmvb&quot;, &quot;*.rm&quot;, &quot;*.dat&quot;, &quot;*.ts&quot;) # \u8981\u5339\u914d\u7684\u89c6\u9891\u683c\u5f0f\n$processed = @{}\n\ndo {\n    $new_video = $false\n    foreach ($format in $video_formats) {\n        $videos = Get-ChildItem -Path &quot;.&quot; -Filter $format\n\n        foreach ($video in $videos) {\n            $name = $video.BaseName\n            if (-not $processed.ContainsKey($name)) {\n                $source_video = $video.FullName\n                $dest_video = &quot;dest\\$name.mp4&quot;\n                # \u4f7f\u7528 NVIDIA \u663e\u5361\u89e3\u7801\uff0c\u5e76\u4f7f\u7528 CPU \u8f6f\u4ef6\u7f16\u7801\u4e3a H.265\n                ffmpeg.exe -hwaccel cuda -i &quot;$source_video&quot;  -c:v libx265 &quot;$dest_video&quot;\n                $processed[$name] = $true\n                Start-Sleep -Seconds 2\n                Move-Item -Path &quot;$source_video&quot; -Destination &quot;src\\&quot;\n                $new_video = $true\n            }\n        }\n    }\n} while ($new_video)<\/code><\/pre>\n<p>\u5c06\u4ee3\u7801\u590d\u5236\u4fdd\u5b58\u4e3a\u6269\u5c55\u540d\u4e3a .ps1 \u7684\u6587\u4ef6\uff0c\u7528 PowerShell \u8fd0\u884c\u5c31\u884c\uff0c\u811a\u672c\u4f1a\u904d\u5386\u6240\u5728\u76ee\u5f55\u7684\u89c6\u9891\u6587\u4ef6\uff0c\u518d\u8fdb\u884c\u7f16\u7801\uff0c\u7f16\u7801\u540e\u7684\u89c6\u9891\u8f93\u51fa\u5230 dest \u76ee\u5f55\u4e0b\uff0c\u539f\u89c6\u9891\u79fb\u52a8\u5230 src \u76ee\u5f55\u4e0b\u3002<\/p>\n<p>\u57fa\u4e8e PowerShell 7.x \u6d4b\u8bd5<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2023\/08\/image-1691474747931.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 626px; --smush-placeholder-aspect-ratio: 626\/323;\" \/><\/p>\n<p>\u7f16\u89e3\u7801\u5668\u53ef\u4ee5\u53c2\u8003\uff1a<a href=\"https:\/\/blog.iyatt.com\/?p=13203\">https:\/\/blog.iyatt.com\/?p=13203<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u524d\u6700\u901a\u7528\u7684\u89c6\u9891\u7f16\u7801\u5668\u662f H.264\/AVC\uff0c\u5b83\u7684\u65b0\u7248 H.265\/HEVC \u76f8\u6bd4\u4e8e\u524d\u8005\u53ef\u4ee5\u5728\u76f8\u540c\u89c6\u9891\u8d28\u91cf\u7684\u60c5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":"","zakra_menu_item_active_color":"","zakra_menu_active_style":"","zakra_page_header":true,"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[1,609],"tags":[],"class_list":["post-10743","post","type-post","status-publish","format-standard","hentry","category-all","category-ffmpeg"],"modified_by":"IYATT-yx","_links":{"self":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/10743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10743"}],"version-history":[{"count":0,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/10743\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}