<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>FFMPEG on 清雨影的Blog</title><link>http://blog.tsingjyujing.com/tech/ffmpeg/</link><description>Recent content in FFMPEG on 清雨影的Blog</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sat, 09 Apr 2022 00:00:00 +0900</lastBuildDate><atom:link href="http://blog.tsingjyujing.com/tech/ffmpeg/index.xml" rel="self" type="application/rss+xml"/><item><title>为FFMPEG添加Intel QSV支持</title><link>http://blog.tsingjyujing.com/tech/ffmpeg/ffmpeg_qsv/</link><pubDate>Fri, 14 Jan 2022 00:00:00 +0900</pubDate><guid>http://blog.tsingjyujing.com/tech/ffmpeg/ffmpeg_qsv/</guid><description>&lt;h1 id="为ffmpeg添加intel-qsv支持"&gt;为FFMPEG添加Intel QSV支持&lt;a class="anchor" href="#%e4%b8%baffmpeg%e6%b7%bb%e5%8a%a0intel-qsv%e6%94%af%e6%8c%81"&gt;&lt;/a&gt;&lt;/h1&gt;&#10;&lt;h2 id="简介"&gt;简介&lt;a class="anchor" href="#%e7%ae%80%e4%bb%8b"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;使用CPU转码的速度过于慢，在使用12核心的i7-10710U CPU全力转码也只有75fps的情况下，使用自带的Mesa Intel® UHD Graphics (CML GT2)进行转码在CPU占用率只有1/3的情况下，就可以达到400+fps的转码速度，速度提升了6倍。&lt;/p&gt;</description></item><item><title>视频压制技术笔记</title><link>http://blog.tsingjyujing.com/tech/ffmpeg/video-compress/</link><pubDate>Sat, 09 Apr 2022 00:00:00 +0900</pubDate><guid>http://blog.tsingjyujing.com/tech/ffmpeg/video-compress/</guid><description>&lt;h1 id="视频压制技术笔记"&gt;视频压制技术笔记&lt;a class="anchor" href="#%e8%a7%86%e9%a2%91%e5%8e%8b%e5%88%b6%e6%8a%80%e6%9c%af%e7%ac%94%e8%ae%b0"&gt;&lt;/a&gt;&lt;/h1&gt;&#10;&lt;h2 id="不同视频网站的不同标准"&gt;不同视频网站的不同标准&lt;a class="anchor" href="#%e4%b8%8d%e5%90%8c%e8%a7%86%e9%a2%91%e7%bd%91%e7%ab%99%e7%9a%84%e4%b8%8d%e5%90%8c%e6%a0%87%e5%87%86"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://support.google.com/youtube/answer/1722171"&gt;Youtube&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="youtube"&gt;Youtube&lt;a class="anchor" href="#youtube"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Progressive scan (no interlacing)&#10;&lt;ul&gt;&#10;&lt;li&gt;Default: &lt;a href="https://blog.p2hp.com/archives/7328"&gt;https://blog.p2hp.com/archives/7328&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;High Profile&lt;/li&gt;&#10;&lt;li&gt;2 consecutive B frames&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://www.reddit.com/r/ffmpeg/comments/g708bz/show_the_consecutive_bframes_before_encoding/"&gt;https://www.reddit.com/r/ffmpeg/comments/g708bz/show_the_consecutive_bframes_before_encoding/&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping"&gt;https://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Closed GOP. GOP of half the frame rate.&#10;&lt;ul&gt;&#10;&lt;li&gt;Default: &lt;a href="https://streaminglearningcenter.com/blogs/open-and-closed-gops-all-you-need-to-know.html"&gt;https://streaminglearningcenter.com/blogs/open-and-closed-gops-all-you-need-to-know.html&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;CABAC&#10;&lt;ul&gt;&#10;&lt;li&gt;Default: &lt;a href="https://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping"&gt;https://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Variable bitrate. No bitrate limit required, though we offer recommended bit rates below for reference&#10;&lt;ul&gt;&#10;&lt;li&gt;Default&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Chroma subsampling: 4:2:0&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://trac.ffmpeg.org/wiki/Chroma%20Subsampling"&gt;https://trac.ffmpeg.org/wiki/Chroma%20Subsampling&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Test commands:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ffmpeg -hwaccel_output_format qsv -hwaccel qsv -i input.mp4 -c:v h264_qsv -bf &lt;span style="color:#b48ead"&gt;2&lt;/span&gt; -b:v 6M -maxrate 24M -global_quality &lt;span style="color:#b48ead"&gt;25&lt;/span&gt; -look_ahead &lt;span style="color:#b48ead"&gt;1&lt;/span&gt; -pix_fmt yuv420p output.mp4&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ffmpeg -i input.mp4 -c:v libx264 -bf &lt;span style="color:#b48ead"&gt;2&lt;/span&gt; -b:v 7M -maxrate 24M -crf &lt;span style="color:#b48ead"&gt;30&lt;/span&gt; -movflags +faststart -pix_fmt yuv420p output.mp4&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#616e87;font-style:italic"&gt;# Youtube compress&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ffmpeg -i input.mp4 -vf yadif,format&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;yuv422p -force_key_frames &lt;span style="color:#a3be8c"&gt;&amp;#39;expr:gte(t,n_forced/2)&amp;#39;&lt;/span&gt; -c:v libx264 -crf &lt;span style="color:#a3be8c"&gt;${&lt;/span&gt;CRF_VALUE&lt;span style="color:#a3be8c"&gt;}&lt;/span&gt; -maxrate 12M -bf &lt;span style="color:#b48ead"&gt;2&lt;/span&gt; -c:a aac -ac &lt;span style="color:#b48ead"&gt;2&lt;/span&gt; -ar &lt;span style="color:#b48ead"&gt;44100&lt;/span&gt; -use_editlist &lt;span style="color:#b48ead"&gt;0&lt;/span&gt; -movflags +faststart output.mp4&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="bilibili"&gt;Bilibili&lt;a class="anchor" href="#bilibili"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;h2 id="references"&gt;References&lt;a class="anchor" href="#references"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://trac.ffmpeg.org/wiki/Encode/H.264"&gt;https://trac.ffmpeg.org/wiki/Encode/H.264&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item></channel></rss>