{"id":9338,"date":"2024-06-23T23:45:34","date_gmt":"2024-06-23T15:45:34","guid":{"rendered":"\/?p=9338"},"modified":"2024-06-23T23:45:34","modified_gmt":"2024-06-23T15:45:34","slug":"linux-%e5%ae%89%e8%a3%85-ffmpeg-%e5%8c%85%e6%8b%ac%e9%9d%99%e6%80%81%e5%8c%85%e5%92%8c%e7%bc%96%e8%af%91%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"\/?p=9338","title":{"rendered":"linux \u5b89\u88c5 ffmpeg \u5305\u62ec\u9759\u6001\u5305\u548c\u7f16\u8bd1\u5b89\u88c5"},"content":{"rendered":"<h3>linux \u5b89\u88c5 <a href=\"https:\/\/so.csdn.net\/so\/search?q=ffmpeg&amp;spm=1001.2101.3001.7020\">ffmpeg<\/a><\/h3>\n<p>windows\u4e0a\u5b89\u88c5\uff0c\u76f4\u63a5\u4e0b\u8f7d\u538b\u7f29\u5305\u89e3\u538b\u3002linux\u5b89\u88c5\uff0c\u627e\u4e86\u534a\u5929\u5404\u79cd\u6280\u672f\u6587\u7ae0\uff0c\u8bf4\u6700\u597d\u7f16\u8bd1\u5b89\u88c5\uff0c\u6309\u7167\u6b65\u9aa4\u5b89\u88c5\u7f16\u8bd1\u73af\u5883\u7f16\u8bd1\u6210\u529f\u4e86\uff0c\u4f46\u662f\u4f7f\u7528\u7684\u65f6\u5019\u603b\u8981\u5b89\u88c5\u5404\u79cd\u5916\u90e8\u5e93\uff0c\u8f6c\u7801\u8f6c\u4e0d\u4e86\u7b49\u7b49\u95ee\u9898......<\/p>\n<p>\u6700\u540e\u65e0\u5948\uff0c\u5378\u8f7d\u6389ffmpeg,\u53bb\u5b98\u7f51\u4e0b\u8f7d\u7f16\u8bd1\u597d\u7684\u7a0b\u5e8f\uff0c\u5c1d\u8bd5\u4e86\u4e00\u4e0b\u3002\u6548\u679c\u6ee1\u610f\u3002\u6240\u4ee5\u5efa\u8bae0\u57fa\u7840\u5e95\u5b50\u8584\u7684\uff0c\u548c\u6211\u4e00\u6837\u4e0d\u8981\u7f16\u8bd1\u5b89\u88c5\u4e86\u3002<\/p>\n<p>\u5207\u8bb0\uff0c\u53bb\u5b98\u7f51\u4e0b\u8f7d\u6700\u65b0\u7248\u672cffmpeg\u3002\u907f\u514d\u8e29\u5751\uff01<\/p>\n<h3><strong>ffmpeg\u7684\u5378\u8f7d<\/strong><\/h3>\n<p>\u5982\u679c\u77e5\u9053\u7f16\u8bd1\u5b89\u88c5\u7684\u4f4d\u7f6e\uff0c\u76f4\u63a5\u5220\u9664\u6587\u4ef6\u5939\u5373\u53ef\uff1b<\/p>\n<p>\u4e0d\u77e5\u9053\u4f4d\u7f6e\uff0c\u91c7\u7528\u4ee5\u4e0b\u65b9\u5f0f\u91cd\u65b0\u7f16\u8bd1\u5b89\u88c5\uff1a<a href=\"https:\/\/www.linuxidc.com\/Linux\/2019-03\/157703.htm\">https:\/\/www.linuxidc.com\/Linux\/2019-03\/157703.htm<\/a><\/p>\n<p>\u6700\u540e\uff0c\u5220\u9664\/usr\/local\/bin\/ffmpeg\u6267\u884c\u7a0b\u5e8f\uff0c\u4f60\u7684\u53ef\u80fd\u4e0d\u5728\u8fd9\u4e2a\u5730\u65b9\uff0c\u53ef\u4ee5\u81ea\u5df1\u67e5\u770b\u5177\u4f53\u4f4d\u7f6e\uff0cwhereis ffmpeg<\/p>\n<p>\u9996\u5148\u8bf4\u4e00\u4e0b<strong>\u9759\u6001\u5b89\u88c5\u5305<\/strong> \u5b89\u88c5\u65b9\u6cd5 \u6b64\u65b9\u6cd5\u9002\u5408\u5c0f\u767d <\/p>\n<h4>1. \u4e0b\u8f7d<\/h4>\n<p>\u6253\u5f00\u5b98\u7f51\u5730\u5740\uff0c\u8fdb\u5165\u4e0b\u8f7d\u9875\uff1a<a href=\"https:\/\/ffmpeg.org\/download.html\">Download FFmpeg<\/a>*<\/p>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/222d1f03b8845a62cb619418c6f269e6-1719157161209-16.png\" alt=\"img\" \/><\/p>\n<p>\u9009\u62e9Linux Static Builds\u4e0b\u7684\u6784\u5efa\u9009\u9879\uff0c\u8fdb\u5165\u8be6\u60c5\u9875<\/p>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/4f9611303b4a5a4ae8250edb073229d8-1719157161209-18.png\" alt=\"img\" \/><\/p>\n<p>\u5728\u5217\u8868\u4e2d\u9009\u62e9\u9002\u5408\u81ea\u5df1\u7684\u7248\u672c\uff0c\u9f20\u6807\u53f3\u952e\uff0c\u590d\u5236\u94fe\u63a5\u5730\u5740\u3002\u8fd9\u91cc\u6211\u9009\u62e9\u4e86release5.1.1\u6700\u65b0\u7248\u672c ffmpeg-release-amd64-static.tar.xz\u3002<\/p>\n<p>\u6253\u5f00Linux\u4e2d\u8981\u5b89\u88c5ffmpeg\u7684\u76ee\u5f55\uff0c\u4f7f\u7528wget\u547d\u4ee4\u4e0b\u8f7d\u6587\u4ef6\uff1a<\/p>\n<pre><code class=\"language-cobol\">wget https:\/\/johnvansickle.com\/ffmpeg\/builds\/ffmpeg-release-amd64-static.tar.xz<\/code><\/pre>\n<h4>2.\u89e3\u538b<\/h4>\n<p>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u5982\u56fe\uff1a<\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u4e0b\u8f7d\u5b8c\u6210\u7684\u6587\u4ef6\u540e\u7f00\u540d\u4e3a .tar.xz \uff0c\u6267\u884c\u5bf9\u5e94\u89e3\u538b\u547d\u4ee4\u89e3\u538b\u6587\u4ef6\uff1a<\/p>\n<pre><code class=\"language-bash\">xz -d ffmpeg-release-amd64-static.tar.xz<\/code><\/pre>\n<p>\u7ecf\u8fc7\u4e00\u6b21\u89e3\u538b\uff0c.xz \u540e\u7f00\u540d\u5df2\u7ecf\u88ab\u53bb\u6389\u3002\u63a5\u4e0b\u6765\u6267\u884c\uff1a<\/p>\n<pre><code class=\"language-bash\">tar -xvf ffmpeg-release-amd64-static.tar<\/code><\/pre>\n<p><em>\u89e3\u538b\u5b8c\u6210\u540e\u8fdb\u5165\u89e3\u538b\u51fa\u6765\u7684\u8fd9\u4e2a\u76ee\u5f55 ffmpeg-5.1.1-amd64-static<\/em><\/p>\n<p>ffmpeg \u548c ffprobe \u90fd\u5728\u8fd9\u91cc\u3002<\/p>\n<h4>3.\u8fd0\u884c<\/h4>\n<p>\u63a5\u4e0b\u6765\u6267\u884c\u4e0b\u547d\u4ee4\u8bd5\u8bd5\uff1a<\/p>\n<pre><code class=\"language-bash\">.\/ffmpeg<\/code><\/pre>\n<p><em>\u5b89\u88c5\u6210\u529f\uff0c\u63a5\u4e0b\u6765\u53ef\u4ee5\u968f\u610f\u505a\u5a92\u4f53\u5904\u7406\u5566\uff0c\u662f\u4e0d\u662f so easy!<\/em><\/p>\n<p>\u5907\u6ce8<br \/>\n\u5f53\u7136\uff0c\u5982\u679c\u60f3\u8981ffmpeg\u547d\u4ee4\u5168\u5c40\u53ef\u7528\uff0c\u53ef\u4ee5\u5728bin\u76ee\u5f55\u52a0\u4e2a\u94fe\u63a5\u3002\u6bd4\u5982\uff0c\u5206\u522b\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff0c\u5373\u53ef\u5728\/usr\/bin\u76ee\u5f55\u4e0b\u521b\u5efaffmpeg\u548cffprobe\u8f6f\u94fe\u63a5\u3002<\/p>\n<pre><code class=\"language-bash\">cd \/usr\/bin\nln -s \/data\/software\/ffmpeg-5.1.1-amd64-static\/ffmpeg ffmpeg\nln -s \/data\/software\/ffmpeg-5.1.1-amd64-static\/ffprobe ffprobe<\/code><\/pre>\n<p>\u8fd9\u6837\u5728\u5176\u4ed6\u76ee\u5f55\u4e5f\u90fd\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 ffmpeg \u548c ffprobe \u800c\u4e0d\u7528\u52a0\u76ee\u5f55\u524d\u7f00\u4e86\u3002<\/p>\n<p>\u5728\u547d\u4ee4\u884c\u8f93\u5165ffmpeg \u5982\u4e0b \u5c31\u8bf4\u660e\u6b63\u5e38\u4e86 <\/p>\n<p><img src=\"https:\/\/lemon-guess.oss-cn-hangzhou.aliyuncs.com\/img\/9560a8c053e144abb9799a998c143c02-1719157161209-20.png\" alt=\"img\" \/><\/p>\n<hr \/>\n<h3>\u7f16\u8bd1\u7684\u5b89\u88c5\u65b9\u6cd5<\/h3>\n<p>\u4e0b\u9762\u6765\u4ecb\u7ecd\u4e00\u4e0b <strong>\u7f16\u8bd1\u7684\u5b89\u88c5\u65b9\u6cd5<\/strong><\/p>\n<p>\uff08\u5982\u679c\u4e0d\u60f3\u770b\u7f57\u91cc\u5427\u55e6\u4e00\u5927\u987f\u6709\u7528\u7684\u8bdd\uff0c\u53ef\u4ee5\u8df3\u5230\u6587\u7ae0\u672b\u5c3e\u76f4\u63a5\u62ff\u5199\u597d\u7684\u811a\u672c\u7528\u3002\u3002\uff09<\/p>\n<p>\u6e90\u7801\u5b89\u88c5\u4e0e\u4e8c\u8fdb\u5236\u5b89\u88c5\u6700\u5927\u7684\u4e0d\u540c\u662f\uff0c\u4f60\u53ef\u4ee5\u5f97\u5230ffmpeg\u7684<code>libav*<\/code>\u7684\u4e00\u7cfb\u5217\u5e93\u3002\u5982\u4f55\u4f60\u9700\u8981\u57fa\u4e8e\u8fd9\u4e9b\u5e93\u505a\u5f00\u53d1\uff0c\u90a3\u4e48\u57fa\u672c\u4e0a\u4f60\u53ea\u80fd\u6e90\u7801\u5b89\u88c5\u3002\u53e6\u5916\uff0c\u5047\u5982\u4f60\u9700\u8981\u5bf9ffmpeg\u7684\u6e90\u7801\u6216\u8005\u5b83\u4f9d\u8d56\u7684\u7b2c\u4e09\u65b9\u5e93\u7684\u6e90\u7801\u505a\u5b9a\u5236\u5316\u4fee\u6539\uff0c\u90a3\u4e5f\u9700\u8981\u6e90\u7801\u5b89\u88c5\u3002<\/p>\n<p>\u6211\u7684\u73af\u5883\u662f\u4e00\u53f0\u963f\u91cc\u4e91\u7684\u4e91\u4e3b\u673a\uff0c\u7cfb\u7edf\u662f<code>CentOS 6.5<\/code>\uff0clinux\u5185\u6838\u7248\u672c\u662f<code>2.6.32<\/code>\uff0cgcc\u7248\u672c\u662f<code>4.4.7 20120313 (Red Hat 4.4.7-23)<\/code><\/p>\n<p>\u4e0a <a href=\"http:\/\/www.ffmpeg.org\/download.html\">Download FFmpeg<\/a> \u8fd9\u4e2a\u7f51\u9875\u627e\u5230\u6700\u65b0\u7a33\u5b9a\u7248\u672c\u7684ffmpeg\u6e90\u7801\u4e0b\u8f7d\uff1a<\/p>\n<pre><code class=\"language-bash\">$wget https:\/\/ffmpeg.org\/releases\/ffmpeg-4.2.2.tar.bz2\n$tar xvf ffmpeg-4.2.2.tar.bz2\n$cd ffmpeg-4.2.2\n$.\/configure<\/code><\/pre>\n<p>\u62a5\u9519\uff1a<\/p>\n<pre><code class=\"language-bash\">nasm\/yasm not found or too old. Use --disable-x86asm for a crippled build.\n...<\/code><\/pre>\n<p>yasm\u53ef\u4ee5\u7406\u89e3\u4e3a\u662f\u4e00\u4e2a\u9488\u5bf9\u6c47\u7f16\u505a\u4f18\u5316\u7684\u5e93\uff0c\u6240\u4ee5\u6211\u4eec\u9009\u62e9\u5148\u5b89\u88c5yasm\u800c\u4e0d\u662f\u7b80\u5355\u7c97\u66b4\u7684\u4f7f\u7528<code>--disable-x86asm<\/code>\u7981\u7528\u5b83\u3002<\/p>\n<p>\u4e0a <a href=\"http:\/\/www.tortall.net\/projects\/yasm\/releases\/\">Index of \/projects\/yasm\/releases\/<\/a> \u8fd9\u4e2a\u7f51\u9875\u627eyasm\u7684\u6e90\u7801\u4e0b\u8f7d\uff1a<\/p>\n<pre><code class=\"language-bash\">$wget http:\/\/www.tortall.net\/projects\/yasm\/releases\/yasm-1.3.0.tar.gz\n$tar xvf yasm-1.3.0.tar.gz\n$cd yasm-1.3.0\/\n$.\/configure\n$make\n$make install<\/code><\/pre>\n<p>\u6210\u529f\u4e4b\u540e\uff0c\u518d\u56de\u5230ffmpeg\u7684\u6e90\u7801\u76ee\u5f55\uff1a<\/p>\n<pre><code class=\"language-bash\">$cd ffmpeg-4.2.2\n$.\/configure\n$make<\/code><\/pre>\n<p>\u7f16\u8bd1\u5b8c\u540e\u8bd5\u8bd5\u8fd0\u884cffmpeg\uff1a<\/p>\n<pre><code class=\"language-bash\">$.\/ffmpeg\nffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers\nbuilt with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-23)\nconfiguration:\nlibavutil      56. 31.100 \/ 56. 31.100\nlibavcodec     58. 54.100 \/ 58. 54.100\nlibavformat    58. 29.100 \/ 58. 29.100\nlibavdevice    58.  8.100 \/ 58.  8.100\nlibavfilter     7. 57.100 \/  7. 57.100\nlibswscale      5.  5.100 \/  5.  5.100\nlibswresample   3.  5.100 \/  3.  5.100\nHyper fast Audio and Video encoder\nusage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...<\/code><\/pre>\n<p>\u4f46\u662f\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6211\u4eec\u8fd9\u6837\u7f16\u8bd1\u51fa\u6765\u7684ffmpeg\uff0c\u7f3a\u5c11\u5f88\u591a\u7f16\u89e3\u7801\u5668\uff0c\u6bd4\u5982\u8bf4h264\u3002<\/p>\n<p>\u8fd9\u610f\u5473\u7740\uff0c\u4f60\u7528ffmpeg\u628a\u4e00\u4e2ah264\u7f16\u7801\u7684mp4\u6587\u4ef6\u8f6c\u6362\u6210flv\u6587\u4ef6\uff0c\u4e0d\u6539\u52a8\u91cc\u9762\u7684\u7f16\u7801\u6570\u636e\uff0c\u8fd9\u662fok\u7684\uff0c\u56e0\u4e3a\u53ea\u662f\u5916\u5c42\u5c01\u88c5\u683c\u5f0f\u7684\u8f6c\u6362\uff0c\u4f46\u662f\u5982\u679c\u6d89\u53ca\u5230h264\u7684\u7f16\u7801\u548c\u89e3\u7801\uff0c\u53ef\u80fd\u5c31\u778e\u4e86\u3002\u8fd9\u91cc\u4f8b\u5b50\u5c31\u4e0d\u4e0a\u4e86\u3002<\/p>\n<p>\u90a3\u600e\u4e48\u6dfb\u52a0\u9700\u8981\u7684\u5e93\u5462\uff0c\u5176\u5b9e\u4e5f\u5f88\u7b80\u5355\uff0c\u57fa\u672c\u5c31\u662f\u4e24\u6b65\uff0c\u5148\u6e90\u7801\u5b89\u88c5\u597d\u9700\u8981\u7684\u7f16\u89e3\u7801\u5e93\uff0c\u7136\u540e\u518d\u5728\u7f16\u8bd1ffmpeg\u6267\u884c<code>.\/configure<\/code>\u90a3\u4e00\u6b65\u65f6\u5c06\u5e93\u52a0\u4e0a\u3002<\/p>\n<p>configure\u6240\u6709\u7684\u53c2\u6570\u8bf4\u660e\u53ef\u4ee5\u901a\u8fc7<code>.\/configure -h<\/code>\u67e5\u770b\u3002<\/p>\n<p>\u6211\u4eec\u56de\u5934\u770b\u672c\u6587\u65b9\u5f0f\u4e00\u4e2d\uff0c\u76f4\u63a5\u8fd0\u884c\u4e0b\u8f7d\u5f97\u5230\u7684\u4e8c\u8fdb\u5236ffmpeg\uff0c\u5176\u4e2d\u6709\u4e00\u884c\u4fe1\u606f\uff1a<\/p>\n<pre><code>configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg<\/code><\/pre>\n<p>\u8fd9\u4e2a\u5c31\u662f\u8fd9\u4e2affmpeg\u5f53\u65f6<code>.\/configure<\/code>\u7684\u53c2\u6570\u3002\u53ef\u4ee5\u770b\u5230\u91cc\u9762\u5305\u542b\u4e86x264\u7684\u5e93<code>--enable-libx264<\/code>\u3002<\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u6f14\u793a\u5982\u4f55\u7f16\u8bd1\u5305\u542bx264\u7684ffmpeg\u3002<\/p>\n<p>\u9996\u5148\uff0c\u7f16\u8bd1x264\uff1a<\/p>\n<pre><code class=\"language-bash\">$wget https:\/\/code.videolan.org\/videolan\/x264\/-\/archive\/master\/x264-master.tar.bz2\n$tar xvf x264-master.tar.bz2\n$cd x264-master\/\n$.\/configure<\/code><\/pre>\n<p>\u62a5\u9519\uff1a<\/p>\n<pre><code class=\"language-bash\">Found no assembler\nMinimum version is nasm-2.13\nIf you really want to compile without asm, configure with --disable-asm.<\/code><\/pre>\n<p>\u5b89\u88c5nasm\uff1a<\/p>\n<pre><code class=\"language-bash\">$wget https:\/\/www.nasm.us\/pub\/nasm\/releasebuilds\/2.14.02\/nasm-2.14.02.tar.gz\n$tar xvf nasm-2.14.02.tar.gz\n$cd nasm-2.14.02\/\n$.\/configure\n$make\n$make install<\/code><\/pre>\n<p>\u6210\u529f\u540e\uff0c\u8fd4\u56dex264\u76ee\u5f55\uff0c\u7ee7\u7eed\u7f16\u8bd1\uff1a<\/p>\n<pre><code class=\"language-bash\">$cd x264-master\/\n$.\/configure\n$make\n# \u8fd9\u91cc\u9700\u8981\u6ce8\u610f\uff0c\u9ed8\u8ba4\u7684make install\u53ea\u4f1a\u5b89\u88c5x264\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5e76\u4e0d\u4f1a\u5b89\u88c5\u9759\u6001\u5e93\uff0c\n# \u6240\u4ee5\u6211\u4eec\u4f7f\u7528install-lib-static\n$make install-lib-static<\/code><\/pre>\n<p>\u56de\u5230ffmpeg\u6e90\u7801\u76ee\u5f55\uff0c\u91cd\u65b0\u7f16\u8bd1\u4e00\u4e2affmpeg\uff0c\u8fd9\u6b21\u6211\u4eec\u628adebug\u7981\u7528\u6389\uff0c\u628ax264\u5305\u542b\u4e0a\uff0c\u663e\u5f0f\u6307\u5b9a\u7f16\u8bd1\u9759\u6001\u5e93\uff08\u4e0d\u5199\u7684\u8bdd\u9ed8\u8ba4\u4e5f\u662f\u9759\u6001\u5e93\uff09<\/p>\n<pre><code class=\"language-bash\">$.\/configure --disable-debug --enable-static --enable-libx264<\/code><\/pre>\n<p>\u62a5\u9519\uff1a<\/p>\n<pre><code class=\"language-bash\">libx264 is gpl and --enable-gpl is not specified.<\/code><\/pre>\n<p>\u7ee7\u7eed\uff1a<\/p>\n<pre><code class=\"language-bash\">$.\/configure --disable-debug --enable-static --enable-libx264 --enable-gpl<\/code><\/pre>\n<p>\u62a5\u9519\uff1a<\/p>\n<pre><code class=\"language-bash\">ERROR: libx264 not found<\/code><\/pre>\n<p>\u6253\u5f00<code>ffbuild\/config.log<\/code>\u6587\u4ef6\u67e5\u770b\u9519\u8bef\u4fe1\u606f\uff1a<\/p>\n<pre><code class=\"language-bash\">\/usr\/local\/lib\/libx264.a(opencl-8.o): In function `x264_8_opencl_close_library&#039;:\nopencl.c:(.text+0x5dd): undefined reference to `dlclose&#039;\n\/usr\/local\/lib\/libx264.a(opencl-8.o): In function `x264_8_opencl_load_library&#039;:\nopencl.c:(.text+0x62f): undefined reference to `dlopen&#039;\nopencl.c:(.text+0x648): undefined reference to `dlsym&#039;\nopencl.c:(.text+0x662): undefined reference to `dlsym&#039;\nopencl.c:(.text+0x67c): undefined reference to `dlsym&#039;\nopencl.c:(.text+0x696): undefined reference to `dlsym&#039;\nopencl.c:(.text+0x6b0): undefined reference to `dlsym&#039;\n\/usr\/local\/lib\/libx264.a(opencl-8.o):opencl.c:(.text+0x6ca): more undefined references to `dlsym&#039; follow\n\/usr\/local\/lib\/libx264.a(opencl-8.o): In function `x264_8_opencl_load_library&#039;:\nopencl.c:(.text+0x934): undefined reference to `dlclose&#039;\n\/usr\/local\/lib\/libx264.a(opencl-8.o): In function `x264_8_opencl_lookahead_init&#039;:\nopencl.c:(.text+0x170c): undefined reference to `dlopen&#039;\nopencl.c:(.text+0x1727): undefined reference to `dlsym&#039;\nopencl.c:(.text+0x173b): undefined reference to `dlsym&#039;\nopencl.c:(.text+0x1752): undefined reference to `dlsym&#039;\nopencl.c:(.text+0x1766): undefined reference to `dlsym&#039;\nopencl.c:(.text+0x179c): undefined reference to `dlclose&#039;\ncollect2: ld returned 1 exit status<\/code><\/pre>\n<p>\u628adl\u5e93\u52a0\u4e0a\uff1a<\/p>\n<pre><code class=\"language-bash\">$.\/configure --disable-debug --enable-static --enable-libx264 --enable-gpl --extra-libs=-ldl\n$make\n$.\/ffmpeg\n\nffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers\n  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-23)\n  configuration: --disable-debug --enable-libx264 --enable-gpl --extra-libs=-ldl\n  libavutil      56. 31.100 \/ 56. 31.100\n  libavcodec     58. 54.100 \/ 58. 54.100\n  libavformat    58. 29.100 \/ 58. 29.100\n  libavdevice    58.  8.100 \/ 58.  8.100\n  libavfilter     7. 57.100 \/  7. 57.100\n  libswscale      5.  5.100 \/  5.  5.100\n  libswresample   3.  5.100 \/  3.  5.100\n  libpostproc    55.  5.100 \/ 55.  5.100\nHyper fast Audio and Video encoder\nusage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...\n\nUse -h to get full help or, even better, run &#039;man ffmpeg&#039;<\/code><\/pre>\n<p>\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u4e86\u3002<\/p>\n<p>\u6700\u540e\uff0c\u63d0\u4f9b\u4e00\u4e2a\u6211\u65e5\u540e\u6301\u7eed\u5728\u672c\u6587\u7ef4\u62a4\u7684\u5b89\u88c5\u811a\u672c\u3002<\/p>\n<pre><code class=\"language-bash\">#!\/usr\/bin\/env bash\n# \u6e90\u7801\u7f16\u8bd1ffmpeg\u9759\u6001\u5e93\u4ee5\u53ca\u53ef\u6267\u884c\u6587\u4ef6\n# \u9700\u8981root\u6743\u9650\n# \u672c\u811a\u672c\u7684\u6700\u65b0\u7248\u672c\u8bf7\u8bbf\u95ee  https:\/\/pengrl.com\/p\/20029\/\n\nset -x\n\n# \u7f16\u8bd1yasm\uff0cffmpeg\u4f9d\u8d56\u7684\u6c47\u7f16\u4f18\u5316\u7684\u5e93\nwget http:\/\/www.tortall.net\/projects\/yasm\/releases\/yasm-1.3.0.tar.gz\ntar xvf yasm-1.3.0.tar.gz\ncd yasm-1.3.0\/\n.\/configure\nmake\nmake install\ncd -\n\n# \u7f16\u8bd1nasm\uff0cx264\u4f9d\u8d56\u7684\u6c47\u7f16\u4f18\u5316\u7684\u5e93\nwget https:\/\/www.nasm.us\/pub\/nasm\/releasebuilds\/2.14.02\/nasm-2.14.02.tar.gz\ntar xvf nasm-2.14.02.tar.gz\ncd nasm-2.14.02\/\n.\/configure\nmake\nmake install\ncd -\n\n# \u7f16\u8bd1x264\nwget https:\/\/code.videolan.org\/videolan\/x264\/-\/archive\/master\/x264-master.tar.bz2\ntar xvf x264-master.tar.bz2\ncd x264-master\/\n.\/configure\nmake\nmake install-lib-static\ncd -\n\n# \u7f16\u8bd1ffmpeg\nwget https:\/\/ffmpeg.org\/releases\/ffmpeg-4.2.2.tar.bz2\ntar xvf ffmpeg-4.2.2.tar.bz2\ncd ffmpeg-4.2.2\n.\/configure --disable-debug --enable-static --enable-libx264 --enable-gpl --extra-libs=-ldl\nmake\nmake install\n.\/ffmpeg<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>linux \u5b89\u88c5 ffmpeg windows\u4e0a\u5b89\u88c5\uff0c\u76f4\u63a5\u4e0b\u8f7d\u538b\u7f29\u5305\u89e3\u538b\u3002linux\u5b89\u88c5\uff0c\u627e\u4e86\u534a\u5929\u5404\u79cd\u6280\u672f\u6587\u7ae0\uff0c\u8bf4\u6700\u597d\u7f16\u8bd1\u5b89\u88c5\uff0c\u6309\u7167\u6b65\u9aa4   \u2026 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[14],"tags":[],"_links":{"self":[{"href":"\/index.php?rest_route=\/wp\/v2\/posts\/9338"}],"collection":[{"href":"\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9338"}],"version-history":[{"count":1,"href":"\/index.php?rest_route=\/wp\/v2\/posts\/9338\/revisions"}],"predecessor-version":[{"id":9339,"href":"\/index.php?rest_route=\/wp\/v2\/posts\/9338\/revisions\/9339"}],"wp:attachment":[{"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9338"},{"taxonomy":"post_tag","embeddable":true,"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}