{"id":42420,"date":"2025-06-08T17:00:44","date_gmt":"2025-06-08T09:00:44","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/42420.html"},"modified":"2025-06-08T17:00:44","modified_gmt":"2025-06-08T09:00:44","slug":"windows%e4%b8%8a%e7%94%a8ffmpeg%e9%87%87%e9%9b%86%e6%91%84%e5%83%8f%e5%a4%b4%e6%8e%a8%e6%b5%81-%e2%86%92-mediamtx%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%bd%ac%e5%8f%91%e6%b5%81-%e2%86%92-wsl2%e4%b8%8a%e6%8b%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/42420.html","title":{"rendered":"Windows\u4e0a\u7528FFmpeg\u91c7\u96c6\u6444\u50cf\u5934\u63a8\u6d41 \u2192 MediaMTX\u670d\u52a1\u5668\u8f6c\u53d1\u6d41 \u2192 WSL2\u4e0a\u62c9\u6d41\u64ad\u653e"},"content":{"rendered":"<h2>1. Windows\u4e0a FFmpeg \u63a8\u6d41&#xff08;\u6444\u50cf\u5934\u91c7\u96c6&#xff09;<\/h2>\n<ul>\n<li>\n<p>\u8bbe\u5907\u540d\u79f0\u53ef\u7528 ffmpeg -list_devices true -f dshow -i dummy \u67e5\u8be2&#xff0c;\u5047\u8bbe\u4e3aIntegrated Camera<\/p>\n<\/li>\n<li>\n<p>\u91c7\u96c6\u63a8\u6d41\u793a\u4f8b&#xff08;\u63a8RTMP\u5230MediaMTX&#xff09;&#xff1a;<\/p>\n<\/li>\n<\/ul>\n<p>ffmpeg -rtbufsize 100M -f dshow -video_size 1280&#215;720 -framerate 30 -i video&#061;&#034;Integrated Camera&#034; -c:v libx264 -preset veryfast -f flv rtmp:\/\/&lt;\u670d\u52a1\u5668IP\u6216localhost&gt;\/live\/stream <\/p>\n<p>\u8fd9\u91cc\u63a8\u5230MediaMTX\u9ed8\u8ba4\u76d1\u542c\u7684RTMP\u7aef\u53e31935&#xff0c;\u8def\u5f84\/live\/stream&#xff0c;\u53ef\u6839\u636eMediaMTX\u914d\u7f6e\u8c03\u6574<\/p>\n<hr \/>\n<h2>2. MediaMTX\u670d\u52a1\u5668\u8f6c\u53d1\u914d\u7f6e<\/h2>\n<ul>\n<li>\n<p>\u786e\u4fdd mediamtx.yml \u914d\u7f6e\u6587\u4ef6\u4e2d\u5f00\u542f\u4e86RTMP\u670d\u52a1&#xff0c;\u76d1\u542c1935\u7aef\u53e3<\/p>\n<\/li>\n<li>\n<p>\u5178\u578b\u914d\u7f6e\u7247\u6bb5&#xff1a;<\/p>\n<\/li>\n<\/ul>\n<p>protocols: [rtmp, rtsp, hls] rtmp: listen: &#034;:1935&#034; <\/p>\n<ul>\n<li>\n<p>MediaMTX\u542f\u52a8\u540e\u4f1a\u76d1\u542cRTMP\u7aef\u53e3&#xff0c;\u63a5\u6536\u5e76\u8f6c\u53d1\u6d41<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h2>3. WSL2\u4e0a\u62c9\u6d41\u64ad\u653e<\/h2>\n<ul>\n<li>\n<p>WSL2\u672c\u8d28\u662fLinux\u73af\u5883&#xff0c;\u53ef\u4ee5\u7528ffplay\u6216vlc\u62c9\u6d41<\/p>\n<\/li>\n<li>\n<p>\u62c9\u53d6RTMP\u6d41\u793a\u4f8b&#xff1a;<\/p>\n<\/li>\n<\/ul>\n<p>ffplay rtmp:\/\/&lt;Windows\u4e3b\u673aIP\u6216localhost&gt;:1935\/live\/stream <\/p>\n<ul>\n<li>\n<p>\u5982\u679cWSL2\u548cWindows\u5728\u540c\u4e00\u53f0\u673a\u5668\u4e0a&#xff0c;localhost\u901a\u5e38\u53ef\u901a&#xff1b;\u5982\u679c\u7f51\u7edc\u9694\u79bb&#xff0c;\u7528Windows\u5b9e\u9645IP<\/p>\n<\/li>\n<li>\n<p>\u540c\u7406&#xff0c;OpenCV\u8bfb\u53d6\u4e5f\u7528\u76f8\u540cURL&#xff1a;<\/p>\n<\/li>\n<\/ul>\n<p>cv::VideoCapture cap(&#034;rtmp:\/\/&lt;WindowsIP&gt;:1935\/live\/stream&#034;); <\/p>\n<hr \/>\n<h2>\u6ce8\u610f\u70b9<\/h2>\n<ul>\n<li>\n<p>\u9632\u706b\u5899&#xff1a;\u786e\u8ba4Windows\u9632\u706b\u5899\u5141\u8bb81935\u7aef\u53e3\u5165\u7ad9&#xff0c;MediaMTX\u76d1\u542c\u751f\u6548<\/p>\n<\/li>\n<li>\n<p>\u7f51\u7edc\u5730\u5740&#xff1a;WSL2\u8bbf\u95eeWindows\u65f6&#xff0c;localhost\u6709\u65f6\u4e0d\u901a&#xff0c;\u53ef\u80fd\u9700\u8981\u7528&lt;Windows\u4e3b\u673aIP&gt;\u6216\u8005host.docker.internal\u7b49\u7279\u6b8a\u5730\u5740<\/p>\n<\/li>\n<li>\n<p>\u63a8\u6d41\u53c2\u6570&#xff1a;<\/p>\n<ul>\n<li>\n<p>-rtbufsize 100M\u9632\u6b62\u91c7\u96c6\u7f13\u51b2\u533a\u6ea2\u51fa<\/p>\n<\/li>\n<li>\n<p>-preset veryfast\u6216\u66f4\u5feb\u7f16\u7801\u901f\u5ea6\u964d\u4f4eCPU\u8d1f\u8f7d<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6d41\u5730\u5740\u4e00\u81f4\u6027&#xff1a;\u63a8\u6d41\u5730\u5740\u548c\u62c9\u6d41\u5730\u5740\u7684\u8def\u5f84\u8981\u5bf9\u5e94<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h2>\u6d41\u7a0b\u793a\u610f\u56fe<\/h2>\n<p>Windows(FFmpeg dshow\u63a8\u6d41) &#8211;&gt; MediaMTX(rtmp:\/\/:1935\/live\/stream) &#8211;&gt; WSL2(ffplay\u62c9\u6d41) <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb691\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf4\u6b21\u3002\u8bbe\u5907\u540d\u79f0\u53ef\u7528\u67e5\u8be2\uff0c\u5047\u8bbe\u4e3a\u8fd9\u91cc\u63a8\u5230MediaMTX\u9ed8\u8ba4\u76d1\u542c\u7684RTMP\u7aef\u53e31935\uff0c\u8def\u5f84\uff0c\u53ef\u6839\u636eMediaMTX\u914d\u7f6e\u8c03\u6574\u3002_ffmpeg \u89c6\u9891\u91c7\u96c6\u4e0e\u63a8\u6d41<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[213,149,43],"topic":[],"class_list":["post-42420","post","type-post","status-publish","format-standard","hentry","category-server","tag-ffmpeg","tag-windows","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Windows\u4e0a\u7528FFmpeg\u91c7\u96c6\u6444\u50cf\u5934\u63a8\u6d41 \u2192 MediaMTX\u670d\u52a1\u5668\u8f6c\u53d1\u6d41 \u2192 WSL2\u4e0a\u62c9\u6d41\u64ad\u653e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/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.wsisp.com\/helps\/42420.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Windows\u4e0a\u7528FFmpeg\u91c7\u96c6\u6444\u50cf\u5934\u63a8\u6d41 \u2192 MediaMTX\u670d\u52a1\u5668\u8f6c\u53d1\u6d41 \u2192 WSL2\u4e0a\u62c9\u6d41\u64ad\u653e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb691\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf4\u6b21\u3002\u8bbe\u5907\u540d\u79f0\u53ef\u7528\u67e5\u8be2\uff0c\u5047\u8bbe\u4e3a\u8fd9\u91cc\u63a8\u5230MediaMTX\u9ed8\u8ba4\u76d1\u542c\u7684RTMP\u7aef\u53e31935\uff0c\u8def\u5f84\uff0c\u53ef\u6839\u636eMediaMTX\u914d\u7f6e\u8c03\u6574\u3002_ffmpeg \u89c6\u9891\u91c7\u96c6\u4e0e\u63a8\u6d41\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/42420.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-08T09:00:44+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/42420.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/42420.html\",\"name\":\"Windows\u4e0a\u7528FFmpeg\u91c7\u96c6\u6444\u50cf\u5934\u63a8\u6d41 \u2192 MediaMTX\u670d\u52a1\u5668\u8f6c\u53d1\u6d41 \u2192 WSL2\u4e0a\u62c9\u6d41\u64ad\u653e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-08T09:00:44+00:00\",\"dateModified\":\"2025-06-08T09:00:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/42420.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/42420.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/42420.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Windows\u4e0a\u7528FFmpeg\u91c7\u96c6\u6444\u50cf\u5934\u63a8\u6d41 \u2192 MediaMTX\u670d\u52a1\u5668\u8f6c\u53d1\u6d41 \u2192 WSL2\u4e0a\u62c9\u6d41\u64ad\u653e\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Windows\u4e0a\u7528FFmpeg\u91c7\u96c6\u6444\u50cf\u5934\u63a8\u6d41 \u2192 MediaMTX\u670d\u52a1\u5668\u8f6c\u53d1\u6d41 \u2192 WSL2\u4e0a\u62c9\u6d41\u64ad\u653e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/42420.html","og_locale":"zh_CN","og_type":"article","og_title":"Windows\u4e0a\u7528FFmpeg\u91c7\u96c6\u6444\u50cf\u5934\u63a8\u6d41 \u2192 MediaMTX\u670d\u52a1\u5668\u8f6c\u53d1\u6d41 \u2192 WSL2\u4e0a\u62c9\u6d41\u64ad\u653e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb691\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf4\u6b21\u3002\u8bbe\u5907\u540d\u79f0\u53ef\u7528\u67e5\u8be2\uff0c\u5047\u8bbe\u4e3a\u8fd9\u91cc\u63a8\u5230MediaMTX\u9ed8\u8ba4\u76d1\u542c\u7684RTMP\u7aef\u53e31935\uff0c\u8def\u5f84\uff0c\u53ef\u6839\u636eMediaMTX\u914d\u7f6e\u8c03\u6574\u3002_ffmpeg \u89c6\u9891\u91c7\u96c6\u4e0e\u63a8\u6d41","og_url":"https:\/\/www.wsisp.com\/helps\/42420.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-08T09:00:44+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/42420.html","url":"https:\/\/www.wsisp.com\/helps\/42420.html","name":"Windows\u4e0a\u7528FFmpeg\u91c7\u96c6\u6444\u50cf\u5934\u63a8\u6d41 \u2192 MediaMTX\u670d\u52a1\u5668\u8f6c\u53d1\u6d41 \u2192 WSL2\u4e0a\u62c9\u6d41\u64ad\u653e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-08T09:00:44+00:00","dateModified":"2025-06-08T09:00:44+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/42420.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/42420.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/42420.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Windows\u4e0a\u7528FFmpeg\u91c7\u96c6\u6444\u50cf\u5934\u63a8\u6d41 \u2192 MediaMTX\u670d\u52a1\u5668\u8f6c\u53d1\u6d41 \u2192 WSL2\u4e0a\u62c9\u6d41\u64ad\u653e"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/42420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=42420"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/42420\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=42420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=42420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=42420"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=42420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}