{"id":723,"date":"2022-02-15T12:15:53","date_gmt":"2022-02-15T04:15:53","guid":{"rendered":"http:\/\/124.223.94.246\/?p=723"},"modified":"2022-06-11T02:52:45","modified_gmt":"2022-06-10T18:52:45","slug":"ffmpeg%e5%91%bd%e4%bb%a4%e5%88%86%e6%9e%90-filter_complex","status":"publish","type":"post","link":"https:\/\/www.xianwaizhiyin.net\/?p=723","title":{"rendered":"ffmpeg\u547d\u4ee4\u5206\u6790-filter_complex"},"content":{"rendered":"\n<p>\u672c\u6587 \u4ee5 ffmpeg4.4 \u6e90\u7801\u4e3a\u51c6\u3002<\/p>\n\n\n\n<p>a.mp4\u4e0b\u8f7d\u94fe\u63a5\uff1a<a href=\"https:\/\/pan.baidu.com\/s\/1RN1xRsQDGx65MGyB_T1IzA\">\u767e\u5ea6\u7f51\u76d8<\/a>\uff0c\u63d0\u53d6\u7801\uff1anl0s \u3002logo.jpg \u5730\u5740\uff1a<a href=\"\/wp-content\/uploads\/2022\/02\/logo.jpg\">\u70b9\u51fb\u67e5\u770b<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >ffmpeg.exe -i a.mp4 -i logo.jpg -filter_complex &quot;&#091;1:v]scale=176:144&#091;logo];&#091;0:v]&#091;logo]overlay=x=0:y=0&quot; output.mp4 -y<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"498\" src=\"\/wp-content\/uploads\/2022\/02\/filter_complex-1-1.png\" alt=\"\" class=\"wp-image-725\"\/><\/figure>\n\n\n\n<p>\u4e0a\u9762\u547d\u4ee4\u5b9e\u73b0\u7684\u529f\u80fd\u5c31\u662f \u628a \"\u5f26\u5916\u4e4b\u97f3\" \u7684 logo \u653e\u5728\u89c6\u9891\u5de6\u4e0a\u89d2\u3002<\/p>\n\n\n\n<p>ffmpeg \u547d\u4ee4\u884c\u6709\u4e24\u79cd filter \u7528\u6cd5\uff1a<\/p>\n\n\n\n<p>1\uff0c<code class=\"prettyprint\" >-vf<\/code>\uff0c\u666e\u901a\u6ee4\u955c\uff0c \u5728 \u300a<strong>ffmpeg\u547d\u4ee4\u5206\u6790-vf<\/strong>\u300b\u6709\u8fc7\u8bb2\u89e3\u3002<\/p>\n\n\n\n<p>\u4ec0\u4e48\u662f\u7b80\u5355\u6ee4\u955c\uff1f\u53ea\u6709\u4e00\u4e2a\u8f93\u5165\u6d41\u662f\u7b80\u5355\u6ee4\u955c<\/p>\n\n\n\n<p>2\uff0c<code class=\"prettyprint\" >-filter_complex<\/code>\uff0c<code>-lavfi<\/code> \u8fd9\u4e24\u4e2a\u547d\u4ee4\u53c2\u6570\u662f\u4e00\u6837\u7684\uff0c\u8fd9\u662f\u590d\u6742\u6ee4\u955c\uff0clavfi \u662f\u4f30\u8ba1\u662f libavfilter \u7684\u7f29\u5199\u3002<\/p>\n\n\n\n<p>\u4ec0\u4e48\u662f\u590d\u6742\u6ee4\u955c\uff1f\u6709\u591a\u4e2a\u8f93\u5165\u6d41\u7684\u5c31\u662f\u590d\u6742\u6ee4\u955c\uff0c\u672c\u6587\u547d\u4ee4\u67092\u4e2a\u8f93\u5165\u6d41\uff0c\u5c5e\u4e8e\u590d\u6742\u6ee4\u955c<\/p>\n\n\n\n<p>\u590d\u6742\u6ee4\u955c \u5c31\u662f\u672c\u6587\u7684\u5206\u6790\u91cd\u70b9\u3002<\/p>\n\n\n\n<p>\u9996\u5148 filter_complex \u5728 ffmpeg_opt.c \u7684\u5b9a\u4e49\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >{ &quot;filter_complex&quot;, HAS_ARG | OPT_EXPERT,                        { .func_arg = opt_filter_complex },\n        &quot;create a complex filtergraph&quot;, &quot;graph_description&quot; }<\/code><\/pre>\n\n\n\n<p>\u4ece\u5b9a\u4e49\u53ef\u4ee5\u770b\u51fa filter_complex \u4f1a\u8c03\u7528 opt_filter_complex \u51fd\u6570\u3002<\/p>\n\n\n\n<p>opt_filter_complex \u51fd\u6570\u7684\u5b9a\u4e49\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >static int opt_filter_complex(void *optctx, const char *opt, const char *arg)\n{\n    GROW_ARRAY(filtergraphs, nb_filtergraphs);\n    if (!(filtergraphs&#091;nb_filtergraphs - 1] = av_mallocz(sizeof(*filtergraphs&#091;0]))))\n        return AVERROR(ENOMEM);\n    filtergraphs&#091;nb_filtergraphs - 1]-&gt;index      = nb_filtergraphs - 1;\n    filtergraphs&#091;nb_filtergraphs - 1]-&gt;graph_desc = av_strdup(arg);\n    if (!filtergraphs&#091;nb_filtergraphs - 1]-&gt;graph_desc)\n        return AVERROR(ENOMEM);\n\u200b\n    input_stream_potentially_available = 1;\n\u200b\n    return 0;\n}<\/code><\/pre>\n\n\n\n<p>\u4ece\u4e0a\u9762\u7684\u4ee3\u7801\u53ef\u4ee5\u770b\u51fa\uff0c opt_filter_complex \u505a\u7684\u4e8b\u60c5\u975e\u5e38\u7b80\u5355\uff0c\u5c31\u662f malloc \u4e00\u4e2a <code class=\"prettyprint\" >struct FilterGraph<\/code>\uff0c\u7136\u540e\u653e\u8fdb\u884c \u5168\u5c40\u53d8\u91cf filtergraphs \u91cc\u9762\u3002<\/p>\n\n\n\n<p>-filter_complex \u540e\u9762\u7684\u53c2\u6570\u5b57\u7b26\u4e32 <code class=\"prettyprint\" >&quot;[1:v]scale=176:144[logo];[0:v][logo]overlay=x=0:y=0&quot;<\/code> \u5c31\u88ab\u653e\u8fdb\u884c graph_desc \u8fdb\u884c\u4fdd\u5b58\u3002<\/p>\n\n\n\n<p>ffmpeg \u4f1a\u901a\u8fc7 graph_desc \u8fd9\u4e2a\u53c2\u6570\u5224\u65ad\u8fd9\u4e2a FilterGraph \u662f\u4e0d\u662f\u4e00\u4e2a\u590d\u6742 FilterGraph \uff0c\u901a\u8fc7 <code class=\"prettyprint\" >filtergraph_is_simple()<\/code> \u51fd\u6570\u5b9e\u73b0\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>google_ads_content<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u5728\u4e4b\u524d\u6587\u7ae0 \u300a<strong>ffmpeg\u6e90\u7801\u5206\u6790-open_output_file<\/strong>\u300b\u91cc\uff0c\u6211\u4eec\u77e5\u9053 <code class=\"prettyprint\" >init_simple_filtergraph<\/code>\u51fd\u6570 \u662f\u5728 open_output_file \u91cc\u9762\u6267\u884c\u7684\u3002<\/p>\n\n\n\n<p>init_simple_filtergraph \u662f\u521d\u59cb\u5316 <strong>\u7b80\u5355filter<\/strong>\u3002init_complex_filters \u662f\u521d\u59cb\u5316 <strong>\u590d\u6742filter<\/strong>\uff0c\u4ed6\u4eec\u4e4b\u95f4\u7684\u8c03\u7528\u6d41\u7a0b\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"796\" height=\"402\" src=\"\/wp-content\/uploads\/2022\/02\/filter_complex-1-1-1.png\" alt=\"\" class=\"wp-image-726\"\/><\/figure>\n\n\n\n<p>\u6d41\u7a0b\u56fe\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"671\" height=\"873\" src=\"\/wp-content\/uploads\/2022\/02\/filter_complex-1-2.png\" alt=\"\" class=\"wp-image-727\"\/><\/figure>\n\n\n\n<p>\u4ece\u4e0a\u9762\u6d41\u7a0b\u56fe \u53ef\u4ee5\u770b\u51fa \uff0cinit_complex_filters \u662f\u5728 init_simple_filtergraph \u4e4b\u524d\u6267\u884c\u7684\uff0c\u5982\u679c\u6267\u884c\u4e86 init_complex_filters \u5c31\u4e0d\u4f1a\u6267\u884c init_simple_filtergraph\uff0c\u53ea\u6709\u4e00\u4e2a\u4f1a\u6267\u884c\uff0c\u4f8b\u5982 \u89c6\u9891 \u6ee4\u955c\u7528\u4e86 init_complex_filters\uff0c\u5c31\u4e0d\u4f1a\u6267\u884c init_simple_filtergraph\uff0c\u4f46\u662f\u672c\u547d\u4ee4\u4e2d \u97f3\u9891 \u4f1a\u7528 init_simple_filtergraph \u521d\u59cb\u5316\u6ee4\u955c\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u4ed4\u7ec6\u5206\u6790 init_complex_filters \u7684\u903b\u8f91\u3002<\/p>\n\n\n\n<p>init_complex_filters \u51fd\u6570\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >static int init_complex_filters(void)\n{\n    int i, ret = 0;\n\u200b\n    for (i = 0; i &lt; nb_filtergraphs; i++) {\n        ret = init_complex_filtergraph(filtergraphs&#091;i]);\n        if (ret &lt; 0)\n            return ret;\n    }\n    return 0;\n}<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e2a\u51fd\u6570\u6bd4\u8f83\u7b80\u5355\uff0c\u5c31\u662f\u5faa\u73af\u6267\u884c init_complex_filtergraph\uff0c\u672c\u6587\u547d\u4ee4\u53ea\u6709\u4e00\u4e2a \u590d\u6742 filter\uff0c\u6240\u4ee5\u53ea\u80fd\u5faa\u73af\u4e00\u6b21\uff0c\u8fd9\u91cc\u7684\u5faa\u73af\u5176\u5b9e\u4e3a\u4e86\u5904\u7406\u90a3\u79cd\u5f88\u590d\u6742\u7684filter\u7684\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u63a5\u7740\u5206\u6790 init_complex_filtergraph \u51fd\u6570\u7684\u903b\u8f91\uff0c\u91cd\u70b9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1210\" height=\"784\" src=\"\/wp-content\/uploads\/2022\/02\/filter_complex-1-3-1.png\" alt=\"\" class=\"wp-image-728\"\/><\/figure>\n\n\n\n<p>\u4ece\u4e0a\u56fe\u53ef\u4ee5\u770b\u5230\uff0cinit_complex_filtergraph() \u51fd\u6570\u91cc\u9762 \u8c03 avfilter_graph_parse2() \u6765\u89e3\u6790 <code class=\"prettyprint\" >&quot;[1:v]scale=176:144[logo];[0:v][logo]overlay=x=0:y=0&quot;<\/code> \u3002<\/p>\n\n\n\n<p>\u8fd9\u91cc\u6ce8\u610f \u7b2c\u4e09\u4e2a\u53c2\u6570 inputs \u53d8\u91cf\u662f\u4e00\u4e2a <code class=\"prettyprint\" >struct AVFilterInOut<\/code> \u6570\u7ec4 \uff0c\u4ece debug \u5668\u53ef\u4ee5\u770b\u51fa inputs \u6570\u7ec4\u6709\u4e24\u4e2a\u503c\uff0c<code>1:v<\/code> \u8ddf <code>0:v<\/code>\uff0c\u8ddf\u547d\u4ee4\u884c\u53c2\u6570\u662f\u5bf9\u5f97\u4e0a\u7684\u3002<\/p>\n\n\n\n<p>\u4ee3\u8868\u8fd9\u4e2a filter-graph \u6709\u4e24\u4e2a\u8f93\u5165\u6d41\uff0c\u8fd9\u91cc\u8ddf\u4ee5\u5f80\u7684\u6587\u7ae0\u5206\u6790\u4e0d\u540c\uff0c\u4ee5\u524d\u7684filter\u6587\u7ae0\u5206\u6790\u90fd\u53ea\u8bb2\u4e86\u4e00\u4e2a\u8f93\u5165\u6d41\u7684\u60c5\u51b5\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u63a5\u7740 \u5206\u6790 init_input_filter() \u51fd\u6570\u91cc\u9762\u505a\u4e86\u4ec0\u4e48\u4e8b\u60c5\uff0c\u6d41\u7a0b\u56fe\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"654\" height=\"627\" src=\"\/wp-content\/uploads\/2022\/02\/filter_complex-1-3-2.png\" alt=\"\" class=\"wp-image-729\"\/><\/figure>\n\n\n\n<p>init_input_filter \u7684\u4ee3\u7801\u6709\u70b9\u957f\uff0c\u53ea\u8d34\u90e8\u5206\u91cd\u70b9\u4ee3\u7801\u8fdb\u884c\u8bb2\u89e3\u3002<\/p>\n\n\n\n<p>\u4ece\u6d41\u7a0b\u56fe\u8ddf\u4ee3\u7801\u4e2d\u53ef\u4ee5\u5206\u6790\u51fa\u6765\uff0cinit_input_filter \u51fd\u6570\u524d\u534a\u90e8\u5206\u90fd\u662f\u4e3a\u4e86\u627e\u51fa ist\uff0cist \u662f\u4e00\u4e2a <code class=\"prettyprint\" >struct InputStream<\/code>\uff0c\u653e\u5728\u5168\u5c40\u53d8\u91cf input_streams \u91cc\u9762\u3002<\/p>\n\n\n\n<p>\u91cd\u70b9\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >\/\/\u627e\u51fa \u6587\u4ef6 ctx\ns = input_files&#091;file_idx]-&gt;ctx;\n\u200b\nfor (i = 0; i &lt; s-&gt;nb_streams; i++) {\n    enum AVMediaType stream_type = s-&gt;streams&#091;i]-&gt;codecpar-&gt;codec_type;\n    if (stream_type != type &amp;&amp;\n        !(stream_type == AVMEDIA_TYPE_SUBTITLE &amp;&amp;\n          type == AVMEDIA_TYPE_VIDEO \/* sub2video hack *\/))\n        continue;\n    if (check_stream_specifier(s, s-&gt;streams&#091;i], *p == &#039;:&#039; ? p + 1 : p) == 1) {\n        \/\/\u627e\u51fa \u6307\u5b9a\u6d41\uff0c\u91cd\u70b9\n        st = s-&gt;streams&#091;i];\n        break;\n    }\n}\n\u200b\n\/\/\u627e\u51fa InputStream\nist = input_streams&#091;input_files&#091;file_idx]-&gt;ist_index + st-&gt;index];<\/code><\/pre>\n\n\n\n<p>init_input_filter \u51fd\u6570\u4e00\u5f00\u59cb \u5c31\u4f1a\u628a in-&gt;name \u8fdb\u884c\u63d0\u53d6\uff0c\u672c\u547d\u4ee4\u4e2d in-&gt;name \u662f <code class=\"prettyprint\" >1:v<\/code> \uff0c\u5b83\u7684\u903b\u8f91\u4f1a\u628a 1 \u63d0\u53d6\u51fa\u6765 \u8d4b\u503c\u7ed9 file_idx \uff0c\u56e0\u4e3a\u4e0b\u6807\u662f0\u5f00\u59cb\u7684\uff0c\u6240\u4ee5\u8fd9\u91cc\u7684 1 \u662f\u6307\u5b9a\u7b2c\u4e8c\u4e2a\u6587\u4ef6\uff0c\u7136\u540e\u628a \":v\" \u4e5f\u63d0\u53d6\u51fa\u6765\uff0c\u7528 check_stream_specifier \u6765\u83b7\u53d6\u5230\u6307\u5b9a\u7684\u6d41\uff0cv \u4ee3\u8868\u662f\u89c6\u9891\u6d41\uff0c\u53d6\u6587\u4ef6\u7684\u7b2c\u4e00\u4e2a\u89c6\u9891\u6d41 \u8d4b\u503c\u7ed9 st\uff0c\u5982\u679c\u6587\u4ef6\u6709\u591a\u4e2a\u89c6\u9891\u6d41\uff0c\u53ea\u53d6\u7b2c\u4e00\u4e2a\u89c6\u9891\u6d41\uff0c\u5176\u4ed6\u4e0d\u7ba1\u3002<\/p>\n\n\n\n<p><strong>\u6240\u4ee5 \u547d\u4ee4\u884c\u53c2\u6570 \u4e2d\u7684 [1:v] \uff0c\u5c31\u662f\u6307\u5b9a\u7b2c\u4e8c\u4e2a\u8f93\u5165\u6587\u4ef6 \u7684 \u7b2c\u4e00\u4e2a\u89c6\u9891\u6d41 \u3002<\/strong><\/p>\n\n\n\n<p>\u6700\u540e\u901a\u8fc7 <code class=\"prettyprint\" >st = input_streams[input_files[file_idx]-&gt;ist_index + st-&gt;index]<\/code> \u83b7\u53d6\u7684 InputStream\u3002<\/p>\n\n\n\n<p>\u7ee7\u7eed\u5206\u6790\uff0c\u540e\u9762\u5c31\u662f\u6dfb\u52a0\u4ee5\u53ca\u521d\u59cb\u5316 fg-&gt;inputs\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >GROW_ARRAY(fg-&gt;inputs, fg-&gt;nb_inputs);\nif (!(fg-&gt;inputs&#091;fg-&gt;nb_inputs - 1] = av_mallocz(sizeof(*fg-&gt;inputs&#091;0]))))\n    exit_program(1);\n\/\/\u91cd\u70b9\u4ee3\u7801\nfg-&gt;inputs&#091;fg-&gt;nb_inputs - 1]-&gt;ist   = ist;\nfg-&gt;inputs&#091;fg-&gt;nb_inputs - 1]-&gt;graph = fg;\nfg-&gt;inputs&#091;fg-&gt;nb_inputs - 1]-&gt;format = -1;\nfg-&gt;inputs&#091;fg-&gt;nb_inputs - 1]-&gt;type = ist-&gt;st-&gt;codecpar-&gt;codec_type;\nfg-&gt;inputs&#091;fg-&gt;nb_inputs - 1]-&gt;name = describe_filter_link(fg, in, 1);\n\u200b\nfg-&gt;inputs&#091;fg-&gt;nb_inputs - 1]-&gt;frame_queue = av_fifo_alloc(8 * sizeof(AVFrame*));\nif (!fg-&gt;inputs&#091;fg-&gt;nb_inputs - 1]-&gt;frame_queue)\n    exit_program(1);<\/code><\/pre>\n\n\n\n<p>\u4e0a\u9762\u8fd9\u6bb5\u4ee3\u7801\u6709\u4e09\u4e2a\u91cd\u70b9\uff1a<\/p>\n\n\n\n<p>1\uff0c\u8fd9\u4e2a filter \u6709\u4e24\u4e2a\u8f93\u5165\u6d41\uff0c\u4f46\u662f\u5e76\u6ca1\u6709\u5148\u540e\u987a\u5e8f\u7684\u533a\u5206\uff0c\u6ca1\u6709\u5b57\u6bb5\u5b58\u50a8\u54ea\u4e2a\u662f0\uff0c\u54ea\u4e2a\u662f1\u3002<\/p>\n\n\n\n<p>2\uff0c<code class=\"prettyprint\" >fg-&gt;inputs[fg-&gt;nb_inputs - 1]-&gt;ist = ist;<\/code> \u8fd9\u53e5\u662f\u91cd\u70b9\u4ee3\u7801\u3002\u8fd9\u91cc\u5173\u8054\u4e86 InputFilter \u8ddf InputStream\u3002<\/p>\n\n\n\n<p>3\uff0cstrcut InputFilter \u91cc\u9762\u7684 frame_queue \u662f\u4e00\u4e2a AVFrame \u7684\u4e34\u65f6\u5b58\u50a8\u533a\uff0c\u4e3a\u4ec0\u4e48\u8981\u4e34\u65f6\u5b58\u50a8\uff0c\u662f\u56e0\u4e3a FilterGraph \u91cc\u9762\u7684\u6240\u6709 InputFilter \u90fd\u521d\u59cb\u5316\u5b8c\u6210\u624d\u80fd \u5f80 \u67d0\u4e2afilter \u91cc\u9762\u5199 AVframe \uff0cffmpeg \u662f\u8fd9\u6837\u5224\u65ad InputFilter\u662f\u5426\u521d\u59cb\u5316\u5b8c\u6210\u7684\uff0cInputFilter::format \u4e0d\u7b49\u4e8e -1 \u5c31\u662f \u521d\u59cb\u5316\u5b8c\u6210\u4e86\u3002\u5177\u4f53\u5b9e\u73b0\u5728 ifilter_has_all_input_formats() \u51fd\u6570\u91cc\u3002\u5982\u679c A InputFilter \u521d\u59cb\u5316\u5b8c\u6210\u4e86\uff0cB InputFilter \u6ca1\u521d\u59cb\u5316\u5b8c\u6210\uff0c\u5c31\u4e0d\u4f1a\u5f80 A \u7684 InputFilter::filter \u5199\u6570\u636e\uff0c\u800c\u662f\u5148\u5199\u5230 A \u7684 InputFilter::frame_queue\uff0c\u540e\u9762\u518d\u4ece InputFilter::frame_queue \u91cc\u62ff\u51fa\u6765\uff0c\u5199\u5230 InputFilter::filter\u3002\u90e8\u5206\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >\/\/ffmpeg.c 2213\u884c\nif (!ifilter_has_all_input_formats(fg)) {\n    AVFrame *tmp = av_frame_clone(frame);\n    if (!tmp)\n        return AVERROR(ENOMEM);\n    av_frame_unref(frame);\n\u200b\n    if (!av_fifo_space(ifilter-&gt;frame_queue)) {\n        ret = av_fifo_realloc2(ifilter-&gt;frame_queue, 2 * av_fifo_size(ifilter-&gt;frame_queue));\n        if (ret &lt; 0) {\n            av_frame_free(&amp;tmp);\n            return ret;\n        }\n    }\n    av_fifo_generic_write(ifilter-&gt;frame_queue, &amp;tmp, sizeof(tmp), NULL);\n    return 0;\n}<\/code><\/pre>\n\n\n\n<p>PS\uff1a\u4e0a\u9762\u8fd9\u6bb5\u4ee3\u7801\u7684\u547d\u4ee4\u573a\u666f\u6211\u4e5f\u6ca1\u6709\uff0c\u5177\u4f53\u4ec0\u4e48\u6837\u7684\u547d\u4ee4\u4f1a\u8dd1\u4e0a\u9762\u8fd9\u79cd\u4e34\u65f6\u5b58\u50a8\u903b\u8f91\uff0c\u57cb\u4e2a\u5751\uff0c\u540e\u7eed\u586b\uff0c\u6709\u670b\u53cb\u77e5\u9053\u7684\uff0c\u53ef\u4ee5\u5728\u6587\u7ae0\u8bc4\u4ef7\u7559\u610f\u3002<\/p>\n\n\n\n<p>init_input_filter \u51fd\u6570\u542b\u6709\u4e00\u4e2a\u91cd\u70b9\uff0c\u6700\u540e\u4e24\u53e5\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >GROW_ARRAY(ist-&gt;filters, ist-&gt;nb_filters);\nist-&gt;filters&#091;ist-&gt;nb_filters - 1] = fg-&gt;inputs&#091;fg-&gt;nb_inputs - 1];<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc\u662f\u628a InputStream \u91cc\u9762\u7684 filters \u540c\u6b65\u4e86\uff0c\u4e3a\u4ec0\u4e48\u8fd9\u6837\u505a\u6211\u4e5f\u4e0d\u592a\u6e05\u695a\uff0c\u60f3\u8bb0\u4e00\u4e0b\uff0c\u5e94\u8be5\u6709\u5730\u65b9\u7528\u5230\u3002<\/p>\n\n\n\n<p>\u81f3\u6b64\uff0cinit_input_filter \u51fd\u6570\u5206\u6790\u5b8c\u6bd5\uff0c\u63a5\u7740\u5206\u6790\u4e0a\u5c42\u51fd\u6570 init_complex_filtergraph \u540e\u9762\u7684\u903b\u8f91\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >for (cur = outputs; cur;) {\n    GROW_ARRAY(fg-&gt;outputs, fg-&gt;nb_outputs);\n    fg-&gt;outputs&#091;fg-&gt;nb_outputs - 1] = av_mallocz(sizeof(*fg-&gt;outputs&#091;0]));\n    if (!fg-&gt;outputs&#091;fg-&gt;nb_outputs - 1])\n        exit_program(1);\n\u200b\n    fg-&gt;outputs&#091;fg-&gt;nb_outputs - 1]-&gt;graph   = fg;\n    fg-&gt;outputs&#091;fg-&gt;nb_outputs - 1]-&gt;out_tmp = cur;\n    fg-&gt;outputs&#091;fg-&gt;nb_outputs - 1]-&gt;type    = avfilter_pad_get_type(cur-&gt;filter_ctx-&gt;output_pads,\n                                                                     cur-&gt;pad_idx);\n    fg-&gt;outputs&#091;fg-&gt;nb_outputs - 1]-&gt;name = describe_filter_link(fg, cur, 0);\n    cur = cur-&gt;next;\n    fg-&gt;outputs&#091;fg-&gt;nb_outputs - 1]-&gt;out_tmp-&gt;next = NULL;\n}<\/code><\/pre>\n\n\n\n<p>\u4e0a\u9762\u7684\u4ee3\u7801\u5b9e\u9645\u4e0a \u5c31\u662f\u64cd\u4f5c\u5904\u7406 fg-&gt;outputs\uff0c\u672c\u6587\u7684\u547d\u4ee4 outputs \u6570\u7ec4\u53ea\u6709\u4e00\u4e2a\u503c\uff0c\u6240\u4ee5\u53ea\u4f1a\u5faa\u73af\u4e00\u6b21\u3002\u8fd9\u6bb5\u4ee3\u7801\u6bd4\u8f83\u6613\u61c2\uff0c\u4e0d\u9700\u8981\u505a\u592a\u591a\u5206\u6790\u3002<\/p>\n\n\n\n<p>\u81f3\u6b64\uff0cinit_complex_filtergraph \u51fd\u6570\u5206\u6790\u5b8c\u6bd5\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>google_ads_content<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u4ece\u4e4b\u524d\u7684\u6d41\u7a0b\u56fe\u53ef\u4ee5\u770b\u51fa\uff0cinit_complex_filters \u662f\u5728 init_simple_filtergraph \u524d\u9762\u8c03\u7528\u7684\uff0c\u8fd9\u91cc\u8981\u7740\u91cd\u8bb2\u89e3\u4e00\u4e0b init_complex_filters \u8ddf init_simple_filtergraph \u7684\u533a\u522b\u3002<\/p>\n\n\n\n<p>init_complex_filters \u662f\u7528\u6765\u521d\u59cb\u5316\u590d\u6742\u6ee4\u955c\u7684\uff0c\u4ec0\u4e48\u662f\u590d\u6742\u6ee4\u955c\uff1f\u6709\u591a\u4e2a\u8f93\u5165\u6d41\u7684\u5c31\u662f\u590d\u6742\u6ee4\u955c\u3002<\/p>\n\n\n\n<p>init_simple_filtergraph \u662f\u7528\u6765\u521d\u59cb\u5316\u7b80\u5355\u6ee4\u955c\u7684\uff0c\u4ec0\u4e48\u662f\u7b80\u5355\u6ee4\u955c\uff0c\u53ea\u6709\u4e00\u4e2a\u8f93\u5165\u6d41\u5c31\u662f\u7b80\u5355\u6ee4\u955c\u3002<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u89c6\u9891\u800c\u8a00\uff0c\u5982\u679c\u7528\u4e86 init_complex_filters \u6765\u521d\u59cb\u5316\u6ee4\u955c\uff0c\u4ee3\u7801 \u5c31\u4e0d\u4f1a\u6267\u884c init_simple_filtergraph \uff0c\u4e24\u8005\u53ea\u6709\u4e00\u4e2a\u6267\u884c\u3002<\/p>\n\n\n\n<p>\u4f8b\u5982\uff0c\u672c\u547d\u4ee4\u4e2d\uff0c\u89c6\u9891\u6ee4\u955c\u662f\u7528 init_complex_filters \u5b9e\u73b0\uff0c\u97f3\u9891\u6ee4\u955c\u662f\u8c03 init_simple_filtergraph \u5b9e\u73b0\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >\/* create streams for all unlabeled output pads *\/\nfor (i = 0; i &lt; nb_filtergraphs; i++) {\n    FilterGraph *fg = filtergraphs&#091;i];\n    for (j = 0; j &lt; fg-&gt;nb_outputs; j++) {\n        OutputFilter *ofilter = fg-&gt;outputs&#091;j];\n\u200b\n        if (!ofilter-&gt;out_tmp || ofilter-&gt;out_tmp-&gt;name)\n            continue;\n\u200b\n        switch (ofilter-&gt;type) {\n        case AVMEDIA_TYPE_VIDEO:    o-&gt;video_disable    = 1; break;\n        case AVMEDIA_TYPE_AUDIO:    o-&gt;audio_disable    = 1; break;\n        case AVMEDIA_TYPE_SUBTITLE: o-&gt;subtitle_disable = 1; break;\n        }\n        init_output_filter(ofilter, o, oc);\n    }\n}<\/code><\/pre>\n\n\n\n<p>\u4e0a\u9762\u7684\u4ee3\u7801\u4f1a\u628a o-&gt;video_disable \u8bbe\u4e3a 1\uff0c\u5bfc\u81f4 init_simple_filtergraph \u6ca1\u6709\u6267\u884c\u3002<\/p>\n\n\n\n<p>\u8fd9\u91cc\u8bf4\u4e2a\u91cd\u70b9\uff0c\u56e0\u4e3a \u89c6\u9891\u8f93\u51fa\u6d41 \u5bf9\u5e94\u591a\u4e2a\u8f93\u5165\u6d41\uff0c\u5982\u4e0b\u56fe\uff0c\u6240\u4ee5 <code class=\"prettyprint\" >ost-&gt;source_index<\/code> \u4f1a\u5728 init_output_filter \u51fd\u6570\u91cc\u9762\u8bbe\u7f6e\u4e3a -1\uff0c\u56e0\u4e3a\u4e0d\u662f\u5355\u4e2a\u8f93\u5165\u6d41\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"715\" height=\"211\" src=\"\/wp-content\/uploads\/2022\/02\/filter_complex-1-3-4.png\" alt=\"\" class=\"wp-image-724\"\/><\/figure>\n\n\n\n<p>\u4e00\u5f00\u59cb\u89e3\u6790\u590d\u6742\u6ee4\u955c\u53c2\u6570\u7684\u65f6\u5019\uff0c\u5df2\u7ecf\u5f80 \u5168\u5c40\u53d8\u91cf filtergraphs \u6570\u7ec4 \u63d2\u5165\u4e86\u4e00\u4e2a FilterGraph \uff0c\u7136\u540e\u5728 open_output_file \u51fd\u6570\u91cc\u9762\u5904\u7406\u97f3\u9891\u65f6\uff0c\u6267\u884c\u4e86 init_simple_filtergraph \uff0c\u53c8\u63d2\u5165\u4e86\u4e00\u4e2a FilterGraph \u3002\u6240\u4ee5\u73b0\u5728\u6570\u636e\u7ed3\u6784\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n\n\n\n<p>PS\uff1ainit_simple_filtergraph \u5728\u300a<strong>ffmpeg\u6e90\u7801\u5206\u6790-open_output_file<\/strong>\u300b\u6709\u8bb2\u89e3\u3002\u672c\u547d\u4ee4\u91cc\uff0c\u97f3\u9891\u6ee4\u955c\u662f\u4e00\u4e2a\u7a7a\u7684FilterGraph\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"971\" height=\"1147\" src=\"\/wp-content\/uploads\/2022\/02\/filter_complex-1-3-3.png\" alt=\"\" class=\"wp-image-730\"\/><\/figure>\n\n\n\n<p>\u6ce8\u610f\u4e0a\u9762\u7684\u7ed3\u6784\u56fe\uff0c\u590d\u6742 filter \u662f\u6709 nb_input \u7b49\u4e8e 2\uff0c\u4ee3\u8868\u6709\u4e24\u4e2a\u8f93\u5165\u6d41\u7684\u3002<\/p>\n\n\n\n<p>\u6267\u884c init_complex_filters \u8ddf init_simple_filtergraph \u521d\u59cb\u5316 \u7b80\u5355\u8ddf\u590d\u6742\u7684 filtergraph \u4e4b\u540e\uff0c \u540e\u9762\u4f1a\u6267\u884c configure_filtergraph() \u51fd\u6570\uff0c\u4e0b\u9762\u5c31\u6765\u5206\u6790 <strong>configure_filtergraph<\/strong> \u5728\u672c\u547d\u4ee4\u4e2d\u7684\u903b\u8f91\uff0c\u4ee3\u7801\u5982\u4e0b\u56fe\u6240\u793a\uff1a\u91cd\u70b9\u5df2\u5708\u51fa\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"788\" height=\"745\" src=\"\/wp-content\/uploads\/2022\/02\/filter_complex-1-3-5.png\" alt=\"\" class=\"wp-image-731\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >if (simple) {\n    \/\/\u7b80\u5355 filter \u5904\u7406 \u7701\u7565\n} else {\n    fg-&gt;graph-&gt;nb_threads = filter_complex_nbthreads;\n}<\/code><\/pre>\n\n\n\n<p>\u4ece\u4e0a\u7684\u4ee3\u7801\u53ef\u4ee5\u770b\u51fa\uff0c configure_filtergraph \u5165\u53e3\u4e00\u5f00\u59cb\u5c31\u662f\u5bf9 \u7b80\u5355\u8ddf\u590d\u6742 filter \u7684\u533a\u522b\u5904\u7406\uff0c\u5728\u8fd9\u91cc\u590d\u6742\u6ee4\u955c \u7684\u903b\u8f91\u6bd4\u8f83\u7b80\u5355\u3002<\/p>\n\n\n\n<p>\u7136\u540e\u5c31\u53c8\u6267\u884c\u4e86 avfilter_graph_parse2 \uff0c\u6211\u4e3a\u4ec0\u4e48\u8bf4 <strong>\u201c\u53c8\u201d<\/strong>\uff0c\u5927\u5bb6\u6ce8\u610f\u770b\uff0c\u5728\u5f00\u59cb\u7684\u65f6\u5019 init_complex_filtergraph \u51fd\u6570\u91cc\u9762\u5df2\u7ecf\u6267\u884c\u8fc7\u4e00\u6b21 avfilter_graph_parse2 \u3002\u5bf9\u4e8e\u590d\u6742 filter \u800c\u5df2\uff0c\u8fd9\u4e2a\u6982\u5ff5\u662f\u91cd\u4e2d\u4e4b\u91cd\u3002<\/p>\n\n\n\n<p>\u590d\u6742\u6ee4\u955c \u4e4b\u6240\u4ee5 \u4f1a\u6267\u884c\u4e24\u6b21 avfilter_graph_parse2 \uff0c\u4e0d\u662f\u56e0\u4e3a\u5199\u9519\u4ee3\u7801\uff0c\u800c\u662f\u6709\u5fc5\u8981\u7684\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e00\u6b21 avfilter_graph_parse2 \u662f\u4e3a\u4e86\u5f04\u51fa\u6765 FilterGraph::InputFilter \u8ddf FilterGraph::OutputFilter\uff0c\u628a\u8fd9\u4e24\u4e2a\u4e1c\u897f\u5f04\u597d\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e8c\u6b21 avfilter_graph_parse2 \u662f\u4e3a\u4e86 \u7ed9\u540e\u9762\u7684 configure_input_filter \uff08\u7b2c\u4e09\u4e2a\u7ea2\u5708\uff09\u7528\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e8c\u6b21 avfilter_graph_parse2 \u662f \u7b80\u5355\u6ee4\u955c \u8ddf \u590d\u6742\u6ee4\u955c\u901a\u7528\u7684\uff0c\u6240\u4ee5\u4ed6\u6267\u884c\u4e24\u6b21\uff0c\u5b9e\u9645\u4e0a\u662f\u4e3a\u4e86\u901a\u7528\uff0c\u6211\u4eec\u5982\u679c\u8c03 API \u51fd\u6570\uff0c\u5373\u4f7f\u662f\u590d\u6742\u6ee4\u955c\uff0c\u4e5f\u53ef\u4ee5\u53ea\u8c03\u4e00\u6b21avfilter_graph_parse2 \u641e\u5b9a\u3002<\/p>\n\n\n\n<p>\u8fd8\u6709\u4e00\u4e2a\u91cd\u70b9\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >for (cur = inputs, i = 0; cur; cur = cur-&gt;next, i++)\n    if ((ret = configure_input_filter(fg, fg-&gt;inputs&#091;i], cur)) &lt; 0) {\n        avfilter_inout_free(&amp;inputs);\n        avfilter_inout_free(&amp;outputs);\n        goto fail;\n    }<\/code><\/pre>\n\n\n\n<p>\u4e0a\u9762\u7684 for \u5faa\u73af\u4f1a\u5faa\u73af\u4e24\u6b21\uff0c\u4ed6\u6ca1\u6709\u7528 \u4e0b\u6807\u4e4b\u7c7b\u7684\u5b9a\u4f4d\uff0c\u662f\u56e0\u4e3a \u4e24\u6b21 avfilter_graph_parse2 \u8fd4\u56de\u7684 inputs \u6570\u7ec4\u987a\u5e8f\u90fd\u662f\u4e00\u6837\u7684\u3002<\/p>\n\n\n\n<p>configure_input_filter \u51fd\u6570\u7684\u91cd\u70b9\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >if ((ret = avfilter_graph_create_filter(&amp;ifilter-&gt;filter, buffer_filt, name,\n                                        args.str, NULL, fg-&gt;graph)) &lt; 0)\n    goto fail;<\/code><\/pre>\n\n\n\n<p>\u628a ifilter-&gt;filter \u521d\u59cb\u5316\u4e3a buffer filter \uff08\u5165\u53e3 filter\uff09\uff0c\u7136\u540e\u63d2\u5165\u4e00\u4e9b\u9ed8\u8ba4\u7684 filter\uff0c\u4f8b\u5982 trim filter\uff0c\u6700\u540e \u5173\u8054 \u5230\u4f20\u8fdb\u6765\u7684 cur \u53d8\u91cf\u3002<\/p>\n\n\n\n<p>configure_filtergraph \u51fd\u6570\u5206\u6790\u5b8c\u6bd5\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230 \u590d\u6742\u6ee4\u955c \u5728 ffmpeg.c \u7684\u5b9e\u73b0\u786e\u5b9e\u6bd4\u8f83\u590d\u6742\u3002\u4f46\u662f\u5728 API \u51fd\u6570\u7684\u89d2\u5ea6\u770b\u6765\uff0c\u590d\u6742\u6ee4\u955c \u8ddf \u7b80\u5355\u6ee4\u955c\u4f7f\u7528\u7684 api \u51fd\u6570\u662f\u4e00\u6837\u7684\uff0c\u90fd\u662f\u7528 avfilter_graph_parse2 \u3002<\/p>\n\n\n\n<p>\u590d\u6742\u6ee4\u955c\u91cc\u9762\u7684\u590d\u6742\u6027\u662f\u4e3a\u4e86 \u547d\u4ee4\u884c\u53c2\u6570\u66f4 \u6613\u7528\u4e00\u4e9b\u3002<\/p>\n\n\n\n<p>\u590d\u6742\u6ee4\u955c \u7b2c\u4e00\u6b21\u8c03 avfilter_graph_parse2 \u662f\u4e3a\u4e86\u5904\u7406\u597d filter \u8ddf stream \u7684\u5173\u8054\uff0c\u5728\u7a0b\u5e8f\u91cc\u5199\u660e\uff0c\u67d0\u4e2a InputStream \u9700\u8981\u53d1\u5f80 \u67d0\u4e2a InputFilter \u3002<\/p>\n\n\n\n<p>\u7b2c\u4e8c\u6b21\u8c03 avfilter_graph_parse2 \u624d\u771f\u6b63\u5f00\u59cb\u5173\u8054 InputFilter \u8ddf OutputFilter \uff0c\u56e0\u4e3a\u4e2d\u95f4\u53ef\u80fd\u9700\u8981\u63d2\u5165\u4e00\u4e9b\u5176\u4ed6 filter\uff0c\u4f8b\u5982 trim filter\uff0crotate filter \u7b49\u7b49\u3002<\/p>\n\n\n\n<p>\u5982\u679c \u81ea\u5df1\u8c03 api \u51fd\u6570\uff0c \u6211\u4eec\u4ee3\u7801\u91cc\uff0c\u54ea\u4e2a InputStream \u9700\u8981\u53d1\u5f80 \u54ea\u4e2a InputFilter \u5df2\u7ecf\u786e\u5b9a\u4e86\uff0c\u4e0d\u9700\u8981\u901a\u8fc7\u547d\u4ee4\u53c2\u6570\u6539\u53d8\uff0c\u5c31\u53ef\u4ee5\u8c03\u4e00\u6b21 avfilter_graph_parse2 \uff0c\u5c31\u641e\u5b9a\u4e86\uff0c\u7136\u540e\u4ece\u4e0d\u540c\u7684\u6d41\u8bfbAVFrame\uff0c\u7136\u540e \u5f80\u4e0d\u540c\u7684 buffer filter\u53d1\u9001 AVFrame \u5373\u53ef\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u7248\u6743\u6240\u5c5e\uff1a\u77e5\u8bc6\u661f\u7403\uff1a\u5f26\u5916\u4e4b\u97f3\uff0cQQ\uff1a2338195090\u3002 \u7531\u4e8e\u7b14\u8005\u7684\u6c34\u5e73\u6709\u9650\uff0c \u52a0\u4e4b\u7f16\u5199\u7684\u540c\u65f6\u8fd8\u8981\u53c2\u4e0e\u5f00\u53d1\u5de5\u4f5c\uff0c\u6587\u4e2d\u96be\u514d\u4f1a\u51fa\u73b0\u4e00\u4e9b\u9519\u8bef\u6216\u8005\u4e0d\u51c6\u786e\u7684\u5730\u65b9\uff0c\u6073\u8bf7\u8bfb\u8005\u6279\u8bc4\u6307\u6b63\u3002\u5982\u679c\u8bfb\u8005\u6709\u4efb\u4f55\u5b9d\u8d35\u610f\u89c1\uff0c\u53ef\u4ee5\u52a0\u6211\u5fae\u4fe1 Loken1\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587 \u4ee5 ffmpeg4.4 \u6e90\u7801\u4e3a\u51c6\u3002 a.mp4\u4e0b\u8f7d\u94fe\u63a5\uff1a\u767e\u5ea6\u7f51\u76d8\uff0c\u63d0\u53d6\u7801\uff1anl0s \u3002logo.jpg  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,17],"tags":[],"class_list":["post-723","post","type-post","status-publish","format-standard","hentry","category-ffmpeg","category-ffmpeg-cmds"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>ffmpeg\u547d\u4ee4\u5206\u6790-filter_complex - \u5f26\u5916\u4e4b\u97f3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.xianwaizhiyin.net\/?p=723\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ffmpeg\u547d\u4ee4\u5206\u6790-filter_complex - \u5f26\u5916\u4e4b\u97f3\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6587 \u4ee5 ffmpeg4.4 \u6e90\u7801\u4e3a\u51c6\u3002 a.mp4\u4e0b\u8f7d\u94fe\u63a5\uff1a\u767e\u5ea6\u7f51\u76d8\uff0c\u63d0\u53d6\u7801\uff1anl0s \u3002logo.jpg [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.xianwaizhiyin.net\/?p=723\" \/>\n<meta property=\"og:site_name\" content=\"\u5f26\u5916\u4e4b\u97f3\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-15T04:15:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-10T18:52:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.xianwaizhiyin.net\/wp-content\/uploads\/2022\/02\/filter_complex-1-1.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"loken\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.xianwaizhiyin.net\/#website\",\"url\":\"https:\/\/www.xianwaizhiyin.net\/\",\"name\":\"\u5f26\u5916\u4e4b\u97f3\",\"description\":\"FFmpeg\u3001WebRTC\uff0cSRS \u97f3\u89c6\u9891\u3001\u6d41\u5a92\u4f53\u6280\u672f\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.xianwaizhiyin.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.xianwaizhiyin.net\/?p=723#primaryimage\",\"inLanguage\":\"zh-Hans\",\"url\":\"\/wp-content\/uploads\/2022\/02\/filter_complex-1-1.png\",\"contentUrl\":\"\/wp-content\/uploads\/2022\/02\/filter_complex-1-1.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.xianwaizhiyin.net\/?p=723#webpage\",\"url\":\"https:\/\/www.xianwaizhiyin.net\/?p=723\",\"name\":\"ffmpeg\u547d\u4ee4\u5206\u6790-filter_complex - \u5f26\u5916\u4e4b\u97f3\",\"isPartOf\":{\"@id\":\"https:\/\/www.xianwaizhiyin.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.xianwaizhiyin.net\/?p=723#primaryimage\"},\"datePublished\":\"2022-02-15T04:15:53+00:00\",\"dateModified\":\"2022-06-10T18:52:45+00:00\",\"author\":{\"@id\":\"https:\/\/www.xianwaizhiyin.net\/#\/schema\/person\/6605a70af752697df6b62f77c53298a3\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.xianwaizhiyin.net\/?p=723#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.xianwaizhiyin.net\/?p=723\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.xianwaizhiyin.net\/?p=723#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.xianwaizhiyin.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ffmpeg\u547d\u4ee4\u5206\u6790-filter_complex\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.xianwaizhiyin.net\/#\/schema\/person\/6605a70af752697df6b62f77c53298a3\",\"name\":\"loken\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.xianwaizhiyin.net\/#personlogo\",\"inLanguage\":\"zh-Hans\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f6320b5256dc36ef4243e0acf26144b8ac2668b478302ad154e95ce3202bc421?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f6320b5256dc36ef4243e0acf26144b8ac2668b478302ad154e95ce3202bc421?s=96&d=mm&r=g\",\"caption\":\"loken\"},\"sameAs\":[\"https:\/\/www.xianwaizhiyin.net\/\"],\"url\":\"https:\/\/www.xianwaizhiyin.net\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ffmpeg\u547d\u4ee4\u5206\u6790-filter_complex - \u5f26\u5916\u4e4b\u97f3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.xianwaizhiyin.net\/?p=723","og_locale":"zh_CN","og_type":"article","og_title":"ffmpeg\u547d\u4ee4\u5206\u6790-filter_complex - \u5f26\u5916\u4e4b\u97f3","og_description":"\u672c\u6587 \u4ee5 ffmpeg4.4 \u6e90\u7801\u4e3a\u51c6\u3002 a.mp4\u4e0b\u8f7d\u94fe\u63a5\uff1a\u767e\u5ea6\u7f51\u76d8\uff0c\u63d0\u53d6\u7801\uff1anl0s \u3002logo.jpg [&hellip;]","og_url":"https:\/\/www.xianwaizhiyin.net\/?p=723","og_site_name":"\u5f26\u5916\u4e4b\u97f3","article_published_time":"2022-02-15T04:15:53+00:00","article_modified_time":"2022-06-10T18:52:45+00:00","og_image":[{"url":"https:\/\/www.xianwaizhiyin.net\/wp-content\/uploads\/2022\/02\/filter_complex-1-1.png"}],"twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"loken","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.xianwaizhiyin.net\/#website","url":"https:\/\/www.xianwaizhiyin.net\/","name":"\u5f26\u5916\u4e4b\u97f3","description":"FFmpeg\u3001WebRTC\uff0cSRS \u97f3\u89c6\u9891\u3001\u6d41\u5a92\u4f53\u6280\u672f","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.xianwaizhiyin.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"ImageObject","@id":"https:\/\/www.xianwaizhiyin.net\/?p=723#primaryimage","inLanguage":"zh-Hans","url":"\/wp-content\/uploads\/2022\/02\/filter_complex-1-1.png","contentUrl":"\/wp-content\/uploads\/2022\/02\/filter_complex-1-1.png"},{"@type":"WebPage","@id":"https:\/\/www.xianwaizhiyin.net\/?p=723#webpage","url":"https:\/\/www.xianwaizhiyin.net\/?p=723","name":"ffmpeg\u547d\u4ee4\u5206\u6790-filter_complex - \u5f26\u5916\u4e4b\u97f3","isPartOf":{"@id":"https:\/\/www.xianwaizhiyin.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.xianwaizhiyin.net\/?p=723#primaryimage"},"datePublished":"2022-02-15T04:15:53+00:00","dateModified":"2022-06-10T18:52:45+00:00","author":{"@id":"https:\/\/www.xianwaizhiyin.net\/#\/schema\/person\/6605a70af752697df6b62f77c53298a3"},"breadcrumb":{"@id":"https:\/\/www.xianwaizhiyin.net\/?p=723#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.xianwaizhiyin.net\/?p=723"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.xianwaizhiyin.net\/?p=723#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.xianwaizhiyin.net\/"},{"@type":"ListItem","position":2,"name":"ffmpeg\u547d\u4ee4\u5206\u6790-filter_complex"}]},{"@type":"Person","@id":"https:\/\/www.xianwaizhiyin.net\/#\/schema\/person\/6605a70af752697df6b62f77c53298a3","name":"loken","image":{"@type":"ImageObject","@id":"https:\/\/www.xianwaizhiyin.net\/#personlogo","inLanguage":"zh-Hans","url":"https:\/\/secure.gravatar.com\/avatar\/f6320b5256dc36ef4243e0acf26144b8ac2668b478302ad154e95ce3202bc421?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f6320b5256dc36ef4243e0acf26144b8ac2668b478302ad154e95ce3202bc421?s=96&d=mm&r=g","caption":"loken"},"sameAs":["https:\/\/www.xianwaizhiyin.net\/"],"url":"https:\/\/www.xianwaizhiyin.net\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=\/wp\/v2\/posts\/723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=723"}],"version-history":[{"count":9,"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=\/wp\/v2\/posts\/723\/revisions"}],"predecessor-version":[{"id":2654,"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=\/wp\/v2\/posts\/723\/revisions\/2654"}],"wp:attachment":[{"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}