{"id":474,"date":"2022-01-31T19:04:45","date_gmt":"2022-01-31T11:04:45","guid":{"rendered":"http:\/\/192.168.0.122:8088\/?p=474"},"modified":"2022-06-11T03:05:52","modified_gmt":"2022-06-10T19:05:52","slug":"ffplay%e6%ba%90%e7%a0%81%e5%88%86%e6%9e%90-%e9%9f%b3%e8%a7%86%e9%a2%91%e5%90%8c%e6%ad%a51","status":"publish","type":"post","link":"https:\/\/www.xianwaizhiyin.net\/?p=474","title":{"rendered":"FFplay\u6e90\u7801\u5206\u6790-\u97f3\u89c6\u9891\u540c\u6b651"},"content":{"rendered":"\n<p>\u672c\u7cfb\u5217 \u4ee5 ffmpeg4.2 \u6e90\u7801\u4e3a\u51c6\uff0c\u4e0b\u8f7d\u5730\u5740\uff1a\u94fe\u63a5\uff1a<a href=\"https:\/\/pan.baidu.com\/s\/1VpUvpLhew-nuq4Dns80mOw\">\u767e\u5ea6\u7f51\u76d8<\/a> \u63d0\u53d6\u7801\uff1ag3k8<\/p>\n\n\n\n<p>FFplay \u6e90\u7801\u5206\u6790\u7cfb\u5217\u4ee5\u4e00\u6761\u7b80\u5355\u7684\u547d\u4ee4\u5f00\u59cb\uff0c<code class=\"prettyprint\" >ffplay -i a.mp4<\/code>\u3002a.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 \u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u4e4b\u524d\u7684\u6587\u7ae0\u5df2\u7ecf\u8bb2\u89e3\u5b8c 3 \u4e2a\u7ebf\u7a0b\u7684\u5185\u90e8\u903b\u8f91\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>read_thread()\uff0cpacket \u8bfb\u53d6\u7ebf\u7a0b\uff0c\u4e0d\u65ad\u5f80 PacketQueue \u5199\u6570\u636e\uff0c\u76f4\u81f3\u961f\u5217\u5199\u6ee1\u3002<\/li><li>audio_thread()\uff0c\u97f3\u9891\u89e3\u7801\u7ebf\u7a0b\uff0c\u4ece \u97f3\u9891PacketQueue \u62ff\u6570\u636e\uff0c\u89e3\u7801\u51faFrame\uff0c\u4e0d\u65ad\u5f80 FrameQueue\u5199\u6570\u636e\uff0c\u76f4\u81f3\u961f\u5217\u5199\u6ee1\u3002<\/li><li>video_thread()\uff0c\u89c6\u9891\u89e3\u7801\u7ebf\u7a0b\uff0c\u4ece \u89c6\u9891PacketQueue \u62ff\u6570\u636e\uff0c\u89e3\u7801\u51faFrame\uff0c\u4e0d\u65ad\u5f80 FrameQueue\u5199\u6570\u636e\uff0c\u76f4\u81f3\u961f\u5217\u5199\u6ee1\u3002<\/li><\/ul>\n\n\n\n<p>3\u4e2a\u7ebf\u7a0b\u7684\u903b\u8f91\u5df2\u7ecf\u8bb2\u5b8c\uff0c\u540e\u7eed\u7684\u6587\u7ae0\u4f1a\u5f00\u59cb\u8bb2\u64ad\u653e\u7ebf\u7a0b \u8ddf \u97f3\u89c6\u9891\u540c\u6b65\u7b97\u6cd5\u3002<\/p>\n\n\n\n<p>\u672c\u6587\u5148\u4ece \u97f3\u9891\u64ad\u653e\u7ebf\u7a0b\u8bb2\u8d77\uff0c\u97f3\u89c6\u9891\u540c\u6b65\u65b9\u5f0f\u662f AV_SYNC_AUDIO_MASTER\uff0c\u4ee5\u97f3\u9891\u4e3a\u4e3b\u65f6\u949f\u3002<\/p>\n\n\n\n<p><strong>\u97f3\u9891\u64ad\u653e\u7ebf\u7a0b\u5206\u6790\u5f00\u59cb\uff1a<\/strong><\/p>\n\n\n\n<p>\u97f3\u9891\u64ad\u653e\u7ebf\u7a0b\u51fd\u6570 \u662f sdl_audio_callback() \uff0c\u5728 audio_open() \u7684\u65f6\u5019\u7528 wanted_spec.callback \u6307\u5b9a\u4e86 SDL \u7684\u97f3\u9891\u56de\u8c03\u51fd\u6570\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >wanted_spec.samples = FFMAX(SDL_AUDIO_MIN_BUFFER_SIZE, 2 &lt;&lt; av_log2(wanted_spec.freq \/ SDL_AUDIO_MAX_CALLBACKS_PER_SEC));\nwanted_spec.callback = sdl_audio_callback; \/\/\u6307\u5b9a\u56de\u8c03\u51fd\u6570\u3002\nwanted_spec.userdata = opaque;<\/code><\/pre>\n\n\n\n<p>ffpaly \u9650\u5236\u4e86 sdl_audio_callbakc() \u6bcf\u79d2\u56de\u8c03\u6b21\u6570\u4e0d\u8d85\u8fc7 SDL_AUDIO_MAX_CALLBACKS_PER_SEC\uff0c\u4e5f\u5c31\u662f\u4e0d\u8d85\u8fc730\u6b21\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u5bf9 sdl_audio_callback() \u7684\u53c2\u6570\u505a\u4e00\u4e9b\u8bb2\u89e3\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >static void sdl_audio_callback(void *opaque, Uint8 *stream, int len){...}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>void *opaque \uff0c\u8c03\u7528\u5c42\u53c2\u6570\uff0cffpaly\u662f\u4f20\u4e86\u4e00\u4e2a struct VideoState \u8fdb\u53bb\u3002\u5728 wanted_spec.userdata \u91cc\u6307\u5b9a\u7684\u3002<\/li><li>Uint8 *stream\uff0cSDL \u64ad\u653e\u5185\u5b58\u7684\u6307\u9488\uff0c\u5f80\u8fd9\u4e2a\u6307\u9488\u5199\u6570\u636e\uff0cSDL \u5c31\u80fd\u64ad\u653e\u6570\u636e\u3002<\/li><li>int len \uff0c\u9700\u8981\u5199\u591a\u5c11\u6570\u636e\u8fdb\u53bb stream \u6307\u9488\u3002<\/li><\/ul>\n\n\n\n<p>len\u7684\u8ba1\u7b97\u65b9\u5f0f\u5176\u5b9e\u975e\u5e38\u6709\u8da3\uff0c\u5c31\u662f\u6839\u636e wanted_spec.samples \u8ba1\u7b97\u6765\u7684\u3002\u5728\u672c\u6587\u547d\u4ee4\u91cc\u9762\uff0cwanted_spec.samples \u8d4b\u503c\u4e3a 2048\uff0c\u6bcf\u6b21\u56de\u8c03callback\uff0c\u9700\u8981\u5f80 stream \u6307\u9488\u5199 2048\u4e2a\u91c7\u6837\u3002\u90a32048\u4e2a\u6837\u672c\u53c8\u662f\u591a\u5c11\u5b57\u8282\uff1f<\/p>\n\n\n\n<p>\u7531\u4e8e audio_open() \u6253\u5f00\u97f3\u9891\u8bbe\u5907\u7684\u65f6\u5019\u6307\u5b9a\u7528 16\u4f4d\u7684\u683c\u5f0f AUDIO_S16SYS \u5b58\u50a8\u4e00\u4e2a\u91c7\u6837\uff0c\u6240\u4ee5\u4e00\u4e2a\u91c7\u6837\u662f2\u4e2a\u5b57\u8282\u3002\u7136\u540e\u56e0\u4e3a\u6587\u4ef6\u97f3\u9891\u662f\u53cc\u58f0\u9053\u7684\uff0c\u6bcf\u4e2a\u58f0\u9053\u90fd\u53d62048\u4e2a\u6837\u672c\uff0c\u90a3\u5c31\u662f 2048 * 2 * 2 = 8196 \u5b57\u8282\u3002\u6709\u5174\u8da3\u53ef\u4ee5\u6253\u5370\u4e00\u4e0b callback \u91cc\u9762\u7684len\u53d8\u91cf\uff0c\u5728\u672c\u6587\u547d\u4ee4\u4e0b\uff0c\u4e00\u76f4\u90fd\u662f8196\u5b57\u8282\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>sdl_audio_callback() \u7684\u6d41\u7a0b\u56fe\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"511\" height=\"567\" src=\".\/wp-content\/uploads\/2022\/01\/ffplay-8-1.png\" alt=\"\" class=\"wp-image-476\"\/><\/figure>\n\n\n\n<p>\u6d41\u7a0b\u56fe\u975e\u5e38\u7b80\u6d01\uff0c\u4f46\u5176\u5b9e sdl_audio_callback() \u91cc\u7684\u903b\u8f91\u662f\u6bd4\u8f83\u590d\u6742\u7684\uff0c\u6d41\u7a0b\u56fe\u6211\u753b\u4e0d\u51fa\u6765\uff0c\u53ea\u80fd\u7b80\u6d01\uff0c\u7528\u6587\u5b57\u6765\u8865\u5145\u3002<\/p>\n\n\n\n<p>\u5728\u8bb2 callback \u7684\u5185\u90e8\u903b\u8f91\u4e4b\u524d\uff0c\u9700\u8981\u5148\u4ecb\u7ecd\u4e00\u4e0bstruct VideoState \u91cc\u9762\u97f3\u9891\u76f8\u5173\u7684\u4e00\u4e9b\u5b57\u6bb5\u3002<\/p>\n\n\n\n<p><strong>struct VideoState \u97f3\u9891\u64ad\u653e\u7ebf\u7a0b\u91cd\u8981\u5b57\u6bb5\u53d8\u91cf\uff1a<\/strong><\/p>\n\n\n\n<p>1\uff0caudio_hw_buf_size\uff1ahw\u662f\u786c\u4ef6\u7684\u610f\u601d\uff0c\u8fd9\u4e2a\u5b57\u6bb5\u4ee3\u8868SDL \u7ebf\u7a0b\u6267\u884c sdl_audio_callback() \u7684\u65f6\u5019\uff0cSDL \u786c\u4ef6\u5185\u90e8\u8fd8\u6709\u591a\u5c11\u5b57\u8282\u97f3\u9891\u7684\u6570\u636e\u6ca1\u6709\u64ad\u653e\u3002\u6ca1\u9519\uff0cSDL \u7ebf\u7a0b\u5e76\u4e0d\u662f\u6ca1\u6709\u97f3\u9891\u6570\u636e\u53ef\u4ee5\u64ad\u653e\u4e86\u624d\u8c03 sdl_audio_callback() \u6765\u62ff\u6570\u636e\uff0c\u800c\u662f\u4ed6\u5185\u90e8\u8fd8\u5269 audio_hw_buf_size \u957f\u5ea6\u7684\u6570\u636e\u5c31\u8c03 sdl_audio_callback() \u6765\u62ff\u6570\u636e\uff0c\u662f\u63d0\u524d\u62ff\u6570\u636e\u7684\uff0c\u8fd9\u4e2a\u6982\u5ff5\u7279\u522b\u91cd\u8981\u3002\u8fd9\u4e2a audio_hw_buf_size \u5176\u5b9e\u662f\u7b49\u4e8e sdl_audio_callback() \u91cc\u9762\u7684len\u53d8\u91cf\u7684\uff0c\u4e5f\u662f\u4e3a\u4ec0\u4e48\u540e\u9762set_clock_at() \u8bbe\u7f6e\u97f3\u9891\u65f6\u949fpts\u7684\u65f6\u5019\u4f1a\u7528 audio_hw_buf_size \u4e58\u4ee52 \u3002\u753b\u4e2a\u56fe\u52a0\u6df1\u7406\u89e3\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"50\" src=\".\/wp-content\/uploads\/2022\/01\/ffplay-8-2.png\" alt=\"\" class=\"wp-image-477\"\/><\/figure>\n\n\n\n<p>\u5982\u4e0a\u56fe\u6240\u793a\uff0cSDL \u5185\u90e8\u662f\u6709\u4e24\u5757\u5185\u5b58\u7684\uff0c\u4e00\u5757\u7ea2\u8272\u7684\u662f\u5b83\u5185\u90e8\u672a\u64ad\u653e\u7684\u97f3\u9891\u6570\u636e\uff0c\u7ea2\u8272\u90e8\u5206\u6211\u4eec\u7684\u7a0b\u5e8f\u662f\u65e0\u6cd5\u64cd\u4f5c\u90a3\u90e8\u5206\u5185\u5b58\u7684\uff0c\u7eff\u8272\u90e8\u5206\u5c31\u662f \u56de\u8c03\u51fd\u6570\u91cc\u9762\u7684 stream \u6307\u9488\uff0c\u7eff\u8272\u90e8\u5206\u7684\u6570\u636e\u6211\u4eec\u7a0b\u5e8f\u53ef\u4ee5\u64cd\u4f5c\u3002audio_hw_buf_size \u662f\u5728 audio_open() \u7684\u65f6\u5019\u8d4b\u503c\u7684\uff0c\u8bf7\u770b\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >if ((ret = audio_open(is, channel_layout, nb_channels, sample_rate, &amp;is-&gt;audio_tgt)) &lt; 0)\n    goto fail;\nis-&gt;audio_hw_buf_size = ret; \/\/\u6ce8\u610f\u8fd9\u91cc<\/code><\/pre>\n\n\n\n<p>2\uff0caudio_buf \uff1a\u97f3\u9891\u6570\u636e\uff0c\u4ece AVframe \u7684 data[] \u91cc\u9762\u5f97\u5230\uff0c\u4e3a\u4ec0\u4e48\u8981\u521b\u5efa\u8fd9\u6837\u4e00\u4e2a\u5b57\u6bb5\uff0c\u662f\u56e0\u4e3a\uff0c\u56de\u8c03\u51fd\u6570\u6709\u65f6\u5019\u5e76\u4e0d\u9700\u8981\u628a AVframe \u7684 data[] \u5168\u90e8\u5199\u5165\u5230 stream \u6307\u9488\u3002\u4f8b\u5982\u56de\u8c03\u7684\u65f6\u5019 SDL \u9700\u8981 1500 \u4e2a\u6837\u672c\uff0c\u4e00\u4e2aAVFrame\u91cc\u9762\u6709 1024 \u4e2a\u6837\u672c\uff0c\u90a3\u7b2c\u4e8c\u4e2aFrame\u53ea\u9700\u8981\u62ff476\u4e2a\u6837\u672c\u5c31\u884c\uff0c\u5269\u4e0b\u7684\u6837\u672c\u4f1a\u653e\u5728 audio_buf \u91cc\u9762\u7b49\u5f85\u4e0b\u6b21\u56de\u8c03\u518d\u7ee7\u7eed\u8bfb\u53d6\u3002<\/p>\n\n\n\n<p>3\uff0caudio_buf1 \uff1a \u91cd\u91c7\u6837\u4e34\u65f6\u5b58\u50a8\u5730\u5740\uff0c\u91cd\u91c7\u6837\u7684\u65f6\u5019\u4f7f\u7528\uff0c\u6682\u65f6\u4e0d\u9700\u8981\u5173\u6ce8\uff0c\u56e0\u4e3a\u672c\u6587\u547d\u4ee4\u6ca1\u6709\u8dd1\u8fdb\u53bb\u91cd\u91c7\u6837\u7684\u903b\u8f91\u3002\u540e\u7eed\u97f3\u9891\u5411\u89c6\u9891\u540c\u6b65\u4f1a\u91cd\u91c7\u6837\uff0c\u5230\u65f6\u5019\u518d\u4ed4\u7ec6\u8bb2\u89e3\u3002<\/p>\n\n\n\n<p>4\uff0caudio_buf_size\uff1a\u8868\u660e audio_buf \u91cc\u9762\u6709\u591a\u5c11\u5b57\u8282\u6570\u636e\u3002<\/p>\n\n\n\n<p>5\uff0caudio_buf_index\uff1aaudio_buf \u7684\u6570\u636e\u5df2\u7ecf\u4f7f\u7528\u4e86\u591a\u5c11\u3002<\/p>\n\n\n\n<p>6\uff0caudio_write_buf_size\uff1aaudio_buf \u7684\u6570\u636e\u8fd8\u5269\u4e0b\u591a\u5c11\u3002<\/p>\n\n\n\n<p><strong>struct VideoState<\/strong> \u91cc\u9762\u6709 \u8fd8\u6709\u4e24\u4e2a\u5b57\u6bb5\u6bd4\u8f83\u5bb9\u6613\u6df7\u6dc6\u3002\u9700\u8981\u91cd\u70b9\u8bb2\u89e3\u4ee5\u4e0b\u3002<\/p>\n\n\n\n<p>1\uff0caudio_filter_src\uff1a\u8fd9\u4e2a\u5b57\u6bb5\u5b58\u7684\u662f \u521a\u4ece\u89e3\u7801\u5668\u51fa\u6765\u7684 AVFrame \u7684\u91c7\u6837\u7387\uff0c\u683c\u5f0f\u7b49\u6570\u636e\u3002<\/p>\n\n\n\n<p>2\uff0caudio_src \uff1a\u8fd9\u4e2a\u5b57\u6bb5\u5b58\u7684\u662f \u521a\u4ece filter_graph \u51fa\u6765\u7684 AVFrame \u7684\u91c7\u6837\u7387\uff0c\u683c\u5f0f\u7b49\u6570\u636e\u3002\u56e0\u4e3a\u7ecf\u8fc7filter\u8f6c\u6362\u4e4b\u540e\uff0c\u91c7\u6837\u7387\u8ddf\u683c\u5f0f\u53ef\u80fd\u4f1a\u6539\u53d8\u3002<\/p>\n\n\n\n<p>audio_src \u662f \u5728 audio_open() \u4e4b\u540e\u8fdb\u884c\u7b2c\u4e00\u6b21\u8d4b\u503c\uff0c\u8d4b\u503c\u4e3a\u6253\u5f00\u7684\u97f3\u9891\u8bbe\u5907\u7684\u91c7\u6837\uff0c\u683c\u5f0f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" > if ((ret = audio_open(is, channel_layout, nb_channels, sample_rate, &amp;is-&gt;audio_tgt)) &lt; 0)\n    goto fail;\n is-&gt;audio_hw_buf_size = ret;\n is-&gt;audio_src = is-&gt;audio_tgt; \/\/\u6ce8\u610f\u8fd9\u91cc<\/code><\/pre>\n\n\n\n<p>\u7136\u540e audio_src \u4f1a\u8ddf \u4ece filter_graph \u51fa\u6765\u7684 frame\u7684\u91c7\u6837\u7387\u7b49\u505a\u6bd4\u8f83\uff0c\u5982\u679c\u4e0d\u4e00\u81f4\u5c31\u4f1a\u6267\u884c\u91cd\u91c7\u6837\uff0caudio_src \u7b2c\u4e8c\u6b21\u8d4b\u503c\u4e3a \u521a\u4ece filter_graph \u51fa\u6765\u7684 AVFrame \u7684\u91c7\u6837\u7387\uff0c\u683c\u5f0f\u7b49\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1008\" height=\"481\" src=\".\/wp-content\/uploads\/2022\/01\/ffplay-8-3.png\" alt=\"\" class=\"wp-image-475\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u7136\u540e\u56e0\u4e3a audio_decode_frame() \u51fd\u6570\u91cc\u9762\u7528\u4e86 AVFrame::extended_data \uff0c\u6240\u4ee5\u4ed4\u7ec6\u8bb2\u4e00\u4e0b\uff0c\u6211\u521a\u5b66ffmpeg\u7684\u65f6\u5019\u4e5f\u5f88\u8ff7\u60d1\uff0c\u7f51\u4e0a\u6709\u4e9b\u4ee3\u7801\u8bfb\u6570\u636e\u7528 extended_data \uff0c\u6709\u4e9b\u7528 data\u3002\u73b0\u5728\u5c31\u6765\u8bb2\u4e0b AVFrame \u91cc\u9762 extended_data \u8ddfdata\u7684\u533a\u522b\u3002<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u89c6\u9891\u5e27\u800c\u8a00\uff0cextended_data \u8ddf data\u662f\u5b8c\u5168\u4e00\u6837\u7684\uff0c\u6ca1\u6709\u533a\u522b\u3002<\/p>\n\n\n\n<p>extended_data \u662f\u4e3a\u97f3\u9891\u5e27\u51c6\u5907\u7684\uff0c\u56e0\u4e3a AVFrame::data \u662f\u4e00\u4e2a 8 \u957f\u5ea6\u7684\u6570\u7ec4\uff0c\u53ea\u80fd\u5b58\u5230 8\u4e2a\u58f0\u9053\uff0c\u5982\u679c\u97f3\u9891\u6d41\u662f9\u58f0\u9053\uff0c10\u58f0\u9053\u600e\u4e48\u529e\uff1f\u8fd9\u5c31\u662f extended_data\u7684\u4f5c\u7528\uff0c\u5b58\u50a8\u66f4\u591a\u7684\u58f0\u9053\u6570\u636e\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p><strong>sdl_audio_callback() \u7684\u6d41\u7a0b\u63cf\u8ff0\u5982\u4e0b\uff1a<\/strong><\/p>\n\n\n\n<p>1\uff0c\u4e00\u5f00\u59cb\u5c31\u662f\u4e00\u4e2a while\u5faa\u73af \uff0cwhile (len &gt; 0)\uff0c\u56de\u8c03\u7684\u65f6\u5019\u5fc5\u987b\u5f80 stream \u5199\u5165 len \u5927\u5c0f\u7684\u97f3\u9891\u6570\u636e\u3002<\/p>\n\n\n\n<p>2\uff0c\u8c03\u7528 audio_decode_frame() \u628a\u97f3\u9891\u6570\u636e\u8f6c\u79fb\u5230 is-&gt;audio_buf\u3002audio_decode_frame() \u51fd\u6570\u7684\u5185\u90e8\u903b\u8f91\u975e\u5e38\u590d\u6742\uff0c\u540e\u9762\u4f1a\u4ed4\u7ec6\u8bb2\u3002<\/p>\n\n\n\n<p>3\uff0c\u97f3\u9891\u6570\u636e\u8f6c\u79fb\u5230 is-&gt;audio_buf \u4e4b\u540e\uff0c\u7a0b\u5e8f\u5c31\u5f00\u59cb\u62f7\u8d1d\u6570\u636e\u4e86\uff0c\u4ee3\u7801\u91cc\u6709\u975e\u5e38\u591a\u7684\u96f6\u788e\u903b\u8f91\uff0c\u5b9e\u9645\u4e0a\u505a\u7684\u4e8b\u60c5\u5c31\u662f\uff0c\u5224\u65ad audio_buf \u7684\u97f3\u9891\u6570\u636e\u9700\u4e0d\u9700\u5168\u90e8\u62f7\u8d1d\u7ed9 SDL \u7684\u5185\u5b58\uff0c\u5982\u679c\u9700\u8981\uff0c\u5168\u90e8\u62f7\u8d1d\u5c31\u5b8c\u4e8b\u4e86\u3002\u5982\u679c\u53ea\u662f\u62f7\u8d1d\u4e00\u90e8\u5206\u5230 SDL \u7684\u5185\u5b58\u5c31\u591f\u7528\u4e86\uff0c\u5c31\u62f7\u8d1d\u4e00\u90e8\u5206\uff0c\u5269\u4e0b\u7684\u8fd8\u5728 audio_buf\u3002\u5982\u679c\u5168\u90e8\u62f7\u8d1d\u5b8c audio_buf \u8fd8\u62fc\u4e0d\u591f len \u957f\u5ea6\uff0c\u5c31\u4f1a\u7ee7\u7eed\u8c03 audio_decode_frame() \u8bfb\u53d6\u4e0b\u4e00\u5e27\u97f3\u9891\u6570\u636e\u8f6c\u79fb\u5230 is-&gt;audio_buf\uff0c\u7ee7\u7eed\u641e\u3002<\/p>\n\n\n\n<p>4\uff0c\u62f7\u8d1d\u5b8c len \u957f\u5ea6\u7684\u6570\u636e\u7ed9 SDL \u5185\u5b58 stream \u4e4b\u540e\uff0c\u5c31\u4f1a\u8c03 set_clock_at() \u8bbe\u7f6e\u5f53\u524d\u97f3\u9891\u6570\u636e\u64ad\u653e\u5230\u54ea\u91cc\u4e86\u3002\u8fd9\u4e2a set_clock_at() \u6bd4\u8f83\u96be\u61c2\uff0c\u9700\u8981\u4ed4\u7ec6\u8bb2\u89e3\uff0c\u8bf7\u770b\u4ee3\u7801\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >ffplay.c 2481\u884c\nset_clock_at(&amp;is-&gt;audclk,\n   is-&gt;audio_clock - (double)(2 * is-&gt;audio_hw_buf_size + is-&gt;audio_write_buf_size) \/ is-&gt;audio_tgt.bytes_per_sec\n                  ,is-&gt;audio_clock_serial, audio_callback_time \/ 1000000.0);<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc set_clock_at() \u51fd\u6570\u7684\u7b2c\u4e8c\u4e2a\u53c2\u6570 pts \u7684\u8ba1\u7b97\u975e\u5e38\u590d\u6742\u3002<\/p>\n\n\n\n<p><strong>pts = is-&gt;audio_clock - (double)(2 * is-&gt;audio_hw_buf_size + is-&gt;audio_write_buf_size) \/ is-&gt;audio_tgt.bytes_per_sec<\/strong><\/p>\n\n\n\n<p>\u9996\u5148\uff0cis-&gt;audio_clock \u662f\u4ece audio_decode_frame() \u91cc\u9762\u8ba1\u7b97\u5f97\u5230\u7684\uff0c\u56e0\u4e3a\u97f3\u9891\u662f\u4e3b\u65f6\u949f\uff0cis-&gt;audio_clock \u7684\u8ba1\u7b97\u65b9\u5f0f\u8fd8\u6ca1\u90a3\u4e48\u7ed5\uff0c\u540e\u7eed\u8bb2\u5230 \u89c6\u9891\u662f\u540c\u6b65\u4e3b\u65f6\u949f\u7684\u65f6\u5019\uff0cis-&gt;audio_clock \u4f1a\u66f4\u96be\u7406\u89e3\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >ffplay.c 2426\u884c\nis-&gt;audio_clock = af-&gt;pts + (double) af-&gt;frame-&gt;nb_samples \/ af-&gt;frame-&gt;sample_rate;<\/code><\/pre>\n\n\n\n<p>\u4ece\u4e0a\u9762\u7684\u4ee3\u7801\u53ef\u4ee5\u770b\u5230 is-&gt;audio_clock \u8d4b\u503c\u4e3a\u5f53\u524d\u5e27\u7684pts + duration\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u5f53SDL\u91cc\u9762 audio_hw_buf_size \u957f\u5ea6\u7684\u7ea2\u8272\u97f3\u9891\u6570\u636e \u8ddf \u6211\u4eec\u540e\u7eed\u5199\u5165 stream \u6307\u9488\u7684\u7eff\u8272\u97f3\u9891\u6570\u636e\uff0c\u518d\u52a0\u4e0a is-&gt;audio_write_buf_size \u7684\u6570\u636e\uff0c\u8fd9 3\u5757\u97f3\u9891\u6570\u636e\u90fd\u64ad\u653e\u5b8c\u7684\u65f6\u5019\uff0c\u97f3\u9891\u65f6\u949f\u7684 pts \u5c31\u7b49\u4e8e \u5f53\u524d\u5e27\u7684pts + duration\uff0c\u4e3a\u4ec0\u4e48\u8981\u52a0\u4e0a audio_write_buf_size \uff0c\u662f\u56e0\u4e3a\u5f53\u524d\u5e27\u7684 \u6570\u636e\u4e0d\u4e00\u5b9a\u5168\u90e8\u4f1a\u62f7\u8d1d\u5230\u7eff\u8272\u5185\u5b58\uff0c\u53ef\u80fd\u585e\u4e0d\u4e0b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"50\" src=\".\/wp-content\/uploads\/2022\/01\/ffplay-8-2.png\" alt=\"\" class=\"wp-image-477\"\/><\/figure>\n\n\n\n<p>\u6240\u4ee5\uff0c\u7b80\u6d01\u6765\u8bf4\uff0caudio_hw_buf_size + len + audio_write_buf_size \u8fd93\u5757\u6570\u636e\u90fd\u64ad\u653e\u5b8c\uff0c\u97f3\u9891\u65f6\u949f\u7684 pts \u5c31\u7b49\u4e8e is-&gt;audio_clock\u4e86\u3002\u4f46\u662f\uff0c\u6b64\u65f6\u6b64\u523b\uff0c\u8fd93\u5757\u6570\u636e\u8fd8\u5728\u5185\u5b58\u91cc\u9762\uff0c\u8fd8\u6ca1\u64ad\u653e\u5462\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\uff0c\u6b64\u65f6\u6b64\u523b\uff0c\u97f3\u9891\u65f6\u949f\u7684pts \u5c31\u7b49\u4e8e is-&gt;audio_clock \u51cf\u53bb\u90a33\u5757\u6570\u636e\u7684\u65f6\u95f4\u3002\u56e0\u4e3a len \u7b49\u4e8e audio_hw_buf_size\uff0c\u6240\u4ee5\u8fd9\u6761\u516c\u5f0f\u5c31\u51fa\u6765\u4e86\u3002<\/p>\n\n\n\n<p><strong>pts = is-&gt;audio_clock - (double)(2 * is-&gt;audio_hw_buf_size + is-&gt;audio_write_buf_size) \/ is-&gt;audio_tgt.bytes_per_sec<\/strong><\/p>\n\n\n\n<p>\u8fd8\u6709 set_clock_at() \u6700\u540e\u4e00\u4e2a\u53c2\u6570 audio_callback_time\uff0c\u8fd9\u4e2a\u53c2\u6570\u4e5f\u9700\u8981\u6ce8\u610f\uff0c\u56e0\u4e3a audio_callback_time \u662f\u5728 \u5165\u53e3\u5c31\u521d\u59cb\u5316\u4e86\uff0c\u4e3a\u4ec0\u4e48\u8981\u5165\u53e3\u521d\u59cb\u5316\u5462\uff1f<\/p>\n\n\n\n<p>\u56e0\u4e3a\uff0csdl_audio_callback() \u51fd\u6570\u5f00\u59cb\u6267\u884c\u7684\u65f6\u5019\uff0cSDL \u91cc\u9762\u8fd8\u6709 audio_write_buf_size \u957f\u5ea6\u7684\u6570\u636e\u6ca1\u64ad\u653e\uff0c\u4f46\u662f sdl_audio_callback() \u5e76\u4e0d\u4f1a\u963b\u585eSDL \u7684\u97f3\u9891\u64ad\u653e\uff0csdl_audio_callback()\u91cc\u9762\u662f\u6709\u91cd\u91c7\u6837\u5904\u7406\u7684\uff0c\u5728\u91cd\u91c7\u6837\u6d88\u8017\u65f6\u95f4\u7684\u65f6\u5019\uff0c\u7ea2\u8272\u5185\u5b58\u7684\u6570\u636e\u4e5f\u5728\u540c\u65f6\u64ad\u653e\u7684\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5 set_clock_at() \u8bbe\u7f6e\u7684\u662f \u5728 sdl_audio_callback() \u5f00\u59cb\u6267\u884c\u7684\u90a3\u4e00\u523b\uff0c\u97f3\u9891\u6570\u636e\u64ad\u653e\u5230\u54ea\u91cc\u4e86\u3002\u5e76\u4e0d\u662f sdl_audio_callback() \u5feb\u6267\u884c\u5b8c\u4e86 \uff0c\u97f3\u9891\u6570\u636e\u64ad\u653e\u5230\u54ea\u91cc\u4e86\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>\u63a5\u4e0b\u6765\u8bb2\u89e3\u4ee5\u4e0b clock \u91cc\u9762 \u7684 serial \u6709\u4f55\u4f5c\u7528\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >typedef struct Clock {\n    ..\u7701\u7565\u4ee3\u7801..\n    int serial;           \/* clock is based on a packet with this serial *\/\n    int *queue_serial;    \/* pointer to the current packet queue serial, used for obsolete clock detection *\/\n} Clock;<\/code><\/pre>\n\n\n\n<p>struct Clock \u91cc\u9762\u6709\u4e24\u4e2a\u5e8f\u5217\u53f7\uff0cserial \u662f\u6bcf\u6b21\u4eceFrameQueue \u91cc\u9762\u62ffframe\u7684\u65f6\u5019\uff0c\u5c31\u4f1a\u628a serial \u8d4b\u503c\u4e3a frame \u7684\u5e8f\u5217\u53f7\u3002<\/p>\n\n\n\n<p>queue_serial \u5c31\u662f\u4e00\u76f4\u6307\u5411 PacketQueue \u961f\u5217\u7684\u5e8f\u5217\u53f7\uff0c\u4e4b\u524d\u8bf4\u8fc7\uff0c\u5982\u679cseek\u4e86\uff0cPacketQueue \u961f\u5217\u7684\u5e8f\u5217\u53f7 \u4f1a +1 \uff0c\u8fd9\u65f6\u5019 Clock \u7684 serial \u5c31\u4f1a\u4e0d\u7b49\u4e8e queue_serial\uff0cget_clock() \u51fd\u6570\u4f1a\u8fd4\u56de NAN \u7684\u65f6\u95f4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >static double get_clock(Clock *c)\n{\n    if (*c-&gt;queue_serial != c-&gt;serial)\n        return NAN;\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >\u6ce8\u610f\u7b2c\u4e8c\u4e2a\u53c2\u6570\uff0c\u521d\u59cb\u5316 queue_serial \u4e3a PacketQueue \u961f\u5217\u7684\u5e8f\u5217\u53f7\ninit_clock(&amp;is-&gt;vidclk, &amp;is-&gt;videoq.serial);\ninit_clock(&amp;is-&gt;audclk, &amp;is-&gt;audioq.serial);\ninit_clock(&amp;is-&gt;extclk, &amp;is-&gt;extclk.serial);<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>sdl_audio_callback() \u91cc\u9762\u8fd8\u6709\u4e00\u4e2a\u91cd\u8981\u51fd\u6570\u6ca1\u6709\u8bb2\u89e3\uff0c\u90a3\u5c31\u662f audio_decode_frame()\u3002<\/p>\n\n\n\n<p>audio_decode_frame() \u8fd9\u4e2a\u51fd\u6570\u547d\u540d\u4e0d\u662f\u7279\u522b\u597d\uff0caudio_decode_frame \u91cc\u9762\u5176\u5b9e\u5e76\u6ca1\u6709\u6267\u884c\u89e3\u7801\u64cd\u4f5c\uff0c\u89e3\u7801\u64cd\u4f5c\u90fd\u662f\u5728 audio_thread() \u7ebf\u7a0b\u91cc\u9762\u505a\u7684\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >\/**\n * Decode one audio frame and return its uncompressed size.\n *\n * The processed audio frame is decoded, converted if required, and\n * stored in is-&gt;audio_buf, with size in bytes given by the return\n * value.\n *\/\nstatic int audio_decode_frame(VideoState *is){...}<\/code><\/pre>\n\n\n\n<p>audio_decode_frame() \u51fd\u6570\u4e0a\u65b9\u7684\u6ce8\u91ca\u5df2\u7ecf\u8bb2\u660e\u4e86\u8fd9\u4e2a\u51fd\u6570\u7684\u529f\u80fd\uff0c\u5c31\u662f\u628a\u97f3\u9891\u6570\u636e\u653e\u5230 is-&gt;audio_buf\uff0c\u8fd4\u56de\u6570\u636e\u5927\u5c0f\uff0c\u8ba9\u522b\u4eba\u6765\u53d6\u3002<\/p>\n\n\n\n<p>\u4e0d\u8fc7 audio_decode_frame() \u5185\u90e8\u5b9e\u73b0\u8fd8\u662f\u975e\u5e38\u590d\u6742\u7684\uff0c\u9700\u8981\u4ed4\u7ec6\u8bb2\u89e3\u4e00\u4e0b\u3002<\/p>\n\n\n\n<p>\u5165\u53e3\u5c31\u662f\u4e00\u4e2a\u9488\u5bf9 32 \u4f4d\u505a\u7684\u7279\u6b8a\u5904\u7406\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >#if defined(_WIN32)\n        while (frame_queue_nb_remaining(&amp;is-&gt;sampq) == 0) {\n            if ((av_gettime_relative() - audio_callback_time) &gt; 1000000LL * is-&gt;audio_hw_buf_size \/ is-&gt;audio_tgt.bytes_per_sec \/ 2)\n                return -1;\n            av_usleep (1000);\n        }\n#endif<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc\u4e3a\u4ec0\u4e48\u4f1a\u9488\u5bf9 32 \u4f4d\u7684\u7cfb\u7edf\u505asleep\u5462\uff1f\u6211\u4f30\u8ba1\u662f\u56e0\u4e3a\uff0c32\u4f4d\u7684\u7cfb\u7edf\u666e\u904d\u786c\u4ef6\u6bd4\u8f83\u5dee\uff0c\u89e3\u7801\u901f\u5ea6\u6bd4\u8f83\u6162\u3002<\/p>\n\n\n\n<p>1000000LL * is-&gt;audio_hw_buf_size \/ is-&gt;audio_tgt.bytes_per_sec \/ 2 \u5176\u5b9e\u7b49\u4e8e \u4e8c\u5206\u4e4b\u4e00\u7684 callback \u65f6\u95f4\uff0c\u4f8b\u5982\u672c\u6587\u547d\u4ee4\u662f 0.04 s \u56de\u8c03\u4e00\u6b21\uff0c\u90a3 1000000LL * is-&gt;audio_hw_buf_size \/ is-&gt;audio_tgt.bytes_per_sec \/ 2 \u5c31\u7b49\u4e8e 0.02s\u3002<\/p>\n\n\n\n<p>\u7b49\u5f851\/2 \u7684\u65f6\u95f4\u662f\u4e3a\u4ec0\u4e48\u5462\uff1f\u6211\u4f30\u8ba1\u662f\u8ba9 \u786c\u4ef6\u5dee\u7684\u73af\u5883\u5728\u4e34\u754c\u65f6\u95f4\u70b9\u4e0d\u8981\u8f7b\u6613\u8fd4\u56de\u9759\u97f3\u6570\u636e\uff0c\u5ef6\u8fdf\u97f3\u9891\u5e27\u7684\u64ad\u653e\u3002<\/p>\n\n\n\n<p>\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5148\u8bf4\u4e0b\u80cc\u666f\uff0c\u64ad\u653e\u7684\u8fd8\u662f a.mp4 \uff0c\u6bcf0.04s\u79d2 \u8c03\u4e00\u6b21 audio_decode_frame() \u51fd\u6570\u3002<\/p>\n\n\n\n<p>\u5728 14:00 \u7684\u65f6\u5019\uff0c\u4e0b\u53482\u70b9\u7684\u65f6\u5019\uff0cSDL \u56de\u8c03\u4e86 audio_decode_frame() \u51fd\u6570\uff0c\u56e0\u4e3a\u7cfb\u7edf\u6162\uff0c\u6b64\u523b FrameQueue \u91cc\u9762\u6ca1\u6709\u6570\u636e\u53ef\u4ee5\u62ff\u300214:00:005 \u7684\u65f6\u5019\u624d\u89e3\u7801\u51fa\u6570\u636e\u653e\u8fdb\u53bb FrameQueue \uff0c\u5982\u679c \u4e0dsleep\uff0c\u7acb\u5373\u5c31\u8fd4\u56de\u4e86\u3002\u56e0\u4e3a\u4e0b\u6b21\u56de\u8c03\u8981\u7b49 0.04s\uff0c\u5c31\u4f1a\u5bfc\u81f4\u97f3\u9891\u8bbe\u5907\u591a\u64ad\u653e\u4e86 0.04s \u7684\u9759\u97f3\u6570\u636e\u3002\u5982\u679csleep \u5c31\u53ef\u4ee5\u5728 14:00:005 \u5de6\u53f3\u7684\u65f6\u523b\u628a\u6570\u636e\u5199\u8fdb SDL \u7684\u5185\u5b58\uff0c\u4e5f\u5c31\u662f\u8bf4\u672c\u6765\u5e94\u8be5\u64ad\u653e\u7684\u6570\u636e\uff0c\u5982\u679c\u56e0\u4e3a\u89e3\u7801\u6162\uff0c\u4e0dsleep\uff0c\u5ef6\u8fdf\u4e860.04s\u624d\u64ad\u653e\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5ffplay\u9488\u5bf9 32\u4f4d\u7684\u7cfb\u7edf\u505a\u4e86\u4f18\u5316\uff0c\u6298\u4e2d\u4e00\u4e0b\uff0c\u5982\u679c\u6ca1\u6709\u89e3\u7801\u51fa\u6570\u636e\uff0c\u7b49\u5f85 1\/2 \u7684\u56de\u8c03\u65f6\u95f4\uff0c\u4e0d\u81f3\u4e8e\u5ef6\u8fdf\u90a3\u4e48\u5927\u3002<\/p>\n\n\n\n<p><strong>\u91cd\u8981\u77e5\u8bc6\u70b9\uff1a<\/strong> 1000000LL \u662f\u4e00\u767e\u4e07\u7684\u610f\u601d\uff0c\u540e\u9762\u7684LL\u662f\u8f6c\u6362\u6210\u957f\u6574\u5f62\u6570\u636e\u7c7b\u578b\uff0cLong Long<\/p>\n\n\n\n<p>\u7136\u540e\uff0c\u56e0\u4e3a\u672c\u6587\u547d\u4ee4\u6ca1\u6709\u8dd1\u8fdb\u53bb\u91cd\u91c7\u6837\u903b\u8f91\uff0c\u6682\u65f6\u4e0d\u8bb2\u89e3\u91cc\u9762\u7684\u91cd\u91c7\u6837\u903b\u8f91\uff0c\u540e\u7eed\u97f3\u9891\u5411\u89c6\u9891\u540c\u6b65\u7684\u65f6\u5019\uff0c\u8981\u91cd\u91c7\u6837\u505a\u6837\u672c\u8865\u507f\uff0c\u7edf\u4e00\u8bb2\u89e3\u3002<\/p>\n\n\n\n<p>\u6ca1\u6709\u91cd\u91c7\u6837\u903b\u8f91\u4e4b\u540e\uff0caudio_decode_frame() \u5269\u4e0b\u7684\u903b\u8f91\u5c31\u975e\u5e38\u7b80\u5355\u4e86\uff0c\u540e\u9762\u51e0\u4e4e\u6ca1\u4ec0\u4e48\u903b\u8f91\uff0c\u5c31\u4e24\u70b9\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u628a AVFrame \u7684data \u8f6c\u79fb\u5230 is-&gt;audio_buf\u3002is-&gt;audio_buf = af-&gt;frame-&gt;data[0];<\/li><li>\u8bbe\u7f6e is-&gt;audio_clock\u3002is-&gt;audio_clock = af-&gt;pts + (double) af-&gt;frame-&gt;nb_samples \/ af-&gt;frame-&gt;sample_rate;<\/li><\/ol>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>ffplay \u6e90\u7801\u5206\u6790\uff0csdl_audio_callback() \u97f3\u9891\u64ad\u653e\u7ebf\u7a0b\u5206\u6790\u5b8c\u6bd5\u3002<\/p>\n\n\n\n<p>\u00a9\u7248\u6743\u6240\u5c5e\uff1a\u77e5\u8bc6\u661f\u7403\uff1a\u5f26\u5916\u4e4b\u97f3\uff0cQQ\uff1a2338195090\u3002<\/p>\n\n\n\n<p>\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\u7cfb\u5217 \u4ee5 ffmpeg4.2 \u6e90\u7801\u4e3a\u51c6\uff0c\u4e0b\u8f7d\u5730\u5740\uff1a\u94fe\u63a5\uff1a\u767e\u5ea6\u7f51\u76d8 \u63d0\u53d6\u7801\uff1ag3k8 FFplay \u6e90\u7801\u5206\u6790\u7cfb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-474","post","type-post","status-publish","format-standard","hentry","category-ffplay"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>FFplay\u6e90\u7801\u5206\u6790-\u97f3\u89c6\u9891\u540c\u6b651 - \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=474\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FFplay\u6e90\u7801\u5206\u6790-\u97f3\u89c6\u9891\u540c\u6b651 - \u5f26\u5916\u4e4b\u97f3\" \/>\n<meta property=\"og:description\" content=\"\u672c\u7cfb\u5217 \u4ee5 ffmpeg4.2 \u6e90\u7801\u4e3a\u51c6\uff0c\u4e0b\u8f7d\u5730\u5740\uff1a\u94fe\u63a5\uff1a\u767e\u5ea6\u7f51\u76d8 \u63d0\u53d6\u7801\uff1ag3k8 FFplay \u6e90\u7801\u5206\u6790\u7cfb [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.xianwaizhiyin.net\/?p=474\" \/>\n<meta property=\"og:site_name\" content=\"\u5f26\u5916\u4e4b\u97f3\" \/>\n<meta property=\"article:published_time\" content=\"2022-01-31T11:04:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-10T19:05:52+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/.\/wp-content\/uploads\/2022\/01\/ffplay-8-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=\"5 \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=474#primaryimage\",\"inLanguage\":\"zh-Hans\",\"url\":\".\/wp-content\/uploads\/2022\/01\/ffplay-8-1.png\",\"contentUrl\":\".\/wp-content\/uploads\/2022\/01\/ffplay-8-1.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.xianwaizhiyin.net\/?p=474#webpage\",\"url\":\"https:\/\/www.xianwaizhiyin.net\/?p=474\",\"name\":\"FFplay\u6e90\u7801\u5206\u6790-\u97f3\u89c6\u9891\u540c\u6b651 - \u5f26\u5916\u4e4b\u97f3\",\"isPartOf\":{\"@id\":\"https:\/\/www.xianwaizhiyin.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.xianwaizhiyin.net\/?p=474#primaryimage\"},\"datePublished\":\"2022-01-31T11:04:45+00:00\",\"dateModified\":\"2022-06-10T19:05:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.xianwaizhiyin.net\/#\/schema\/person\/6605a70af752697df6b62f77c53298a3\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.xianwaizhiyin.net\/?p=474#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.xianwaizhiyin.net\/?p=474\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.xianwaizhiyin.net\/?p=474#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.xianwaizhiyin.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FFplay\u6e90\u7801\u5206\u6790-\u97f3\u89c6\u9891\u540c\u6b651\"}]},{\"@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":"FFplay\u6e90\u7801\u5206\u6790-\u97f3\u89c6\u9891\u540c\u6b651 - \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=474","og_locale":"zh_CN","og_type":"article","og_title":"FFplay\u6e90\u7801\u5206\u6790-\u97f3\u89c6\u9891\u540c\u6b651 - \u5f26\u5916\u4e4b\u97f3","og_description":"\u672c\u7cfb\u5217 \u4ee5 ffmpeg4.2 \u6e90\u7801\u4e3a\u51c6\uff0c\u4e0b\u8f7d\u5730\u5740\uff1a\u94fe\u63a5\uff1a\u767e\u5ea6\u7f51\u76d8 \u63d0\u53d6\u7801\uff1ag3k8 FFplay \u6e90\u7801\u5206\u6790\u7cfb [&hellip;]","og_url":"https:\/\/www.xianwaizhiyin.net\/?p=474","og_site_name":"\u5f26\u5916\u4e4b\u97f3","article_published_time":"2022-01-31T11:04:45+00:00","article_modified_time":"2022-06-10T19:05:52+00:00","og_image":[{"url":".\/wp-content\/uploads\/2022\/01\/ffplay-8-1.png"}],"twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"loken","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \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=474#primaryimage","inLanguage":"zh-Hans","url":".\/wp-content\/uploads\/2022\/01\/ffplay-8-1.png","contentUrl":".\/wp-content\/uploads\/2022\/01\/ffplay-8-1.png"},{"@type":"WebPage","@id":"https:\/\/www.xianwaizhiyin.net\/?p=474#webpage","url":"https:\/\/www.xianwaizhiyin.net\/?p=474","name":"FFplay\u6e90\u7801\u5206\u6790-\u97f3\u89c6\u9891\u540c\u6b651 - \u5f26\u5916\u4e4b\u97f3","isPartOf":{"@id":"https:\/\/www.xianwaizhiyin.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.xianwaizhiyin.net\/?p=474#primaryimage"},"datePublished":"2022-01-31T11:04:45+00:00","dateModified":"2022-06-10T19:05:52+00:00","author":{"@id":"https:\/\/www.xianwaizhiyin.net\/#\/schema\/person\/6605a70af752697df6b62f77c53298a3"},"breadcrumb":{"@id":"https:\/\/www.xianwaizhiyin.net\/?p=474#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.xianwaizhiyin.net\/?p=474"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.xianwaizhiyin.net\/?p=474#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.xianwaizhiyin.net\/"},{"@type":"ListItem","position":2,"name":"FFplay\u6e90\u7801\u5206\u6790-\u97f3\u89c6\u9891\u540c\u6b651"}]},{"@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\/474","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=474"}],"version-history":[{"count":3,"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=\/wp\/v2\/posts\/474\/revisions"}],"predecessor-version":[{"id":2672,"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=\/wp\/v2\/posts\/474\/revisions\/2672"}],"wp:attachment":[{"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xianwaizhiyin.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}