{"id":1289,"date":"2025-01-19T22:21:13","date_gmt":"2025-01-19T14:21:13","guid":{"rendered":"https:\/\/imuslab.com\/wordpress\/?p=1289"},"modified":"2025-01-19T22:21:35","modified_gmt":"2025-01-19T14:21:35","slug":"ffmpeg-http-%e4%b8%b2%e6%b5%81-hdmi-%e6%8e%a1%e9%9b%86%e5%8d%a1%e8%bc%b8%e5%85%a5","status":"publish","type":"post","link":"https:\/\/imuslab.com\/wordpress\/2025\/01\/19\/ffmpeg-http-%e4%b8%b2%e6%b5%81-hdmi-%e6%8e%a1%e9%9b%86%e5%8d%a1%e8%bc%b8%e5%85%a5\/","title":{"rendered":"ffmpeg HTTP \u4e32\u6d41 HDMI \u63a1\u96c6\u5361\u8f38\u5165"},"content":{"rendered":"\n<p>\u5982\u679c\u6709\u4e00\u5929\u4e0d\u77e5\u9053\u70ba\u751a\u9ebc\u4f60\u9700\u8981\u900f\u904e Linux \/ Raspberry Pi \u4e32\u6d41 HDMI capture card \u5230\u7db2\u7d61\u4e0a\u53e6\u4e00\u500b\u4f4d\u7f6e\u7684\u8a71\uff0c\u4f60\u53ef\u4ee5\u7528\u9019\u500b ffmpeg command\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ffmpeg -f v4l2 \\\n    -input_format mjpeg \\\n    -video_size 1920x1080 \\\n    -framerate 25 \\\n    -i \/dev\/video0 \\\n    -vcodec mpeg4 \\\n    -pix_fmt yuv420p \\\n    -q:v 1 \\\n    -f mpegts \\\n    -flush_packets 1 \\\n    -max_delay 0\\\n    -analyzeduration 10 \\\n    -probesize 32 \\\n    -fflags nobuffer \\\n    -tune zerolatency \\\n    -listen 1 \\\n    <div style=\"width: 640px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-1289-1\" width=\"640\" height=\"360\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"http:\/\/0.0.0.0:8088\/feed.mp4?_=1\" \/><a href=\"http:\/\/0.0.0.0:8088\/feed.mp4\">http:\/\/0.0.0.0:8088\/feed.mp4<\/a><\/video><\/div>\n<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u4f60\u7684\u96fb\u8166\u4e0a\u4e26\u6c92\u6709 v4l2\uff0c\u53ef\u4ee5\u900f\u904e\u4ee5\u4e0b\u6307\u4ee4\u5b89\u88dd\u4e26\u6293\u5230 capture card \u652f\u63f4\u7684\u8f38\u51fa\u683c\u5f0f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install v4l-utils\nv4l2-ctl --device=\/dev\/video0 --all<\/code><\/pre>\n\n\n\n<p>\u8f38\u51fa\u4f8b\u5b50\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Driver Info:\n        Driver name      : uvcvideo\n        Card type        : usb video: usb video\n        Bus info         : usb-0000:00:14.0-2\n        Driver version   : 6.1.119\n        Capabilities     : 0x84a00001\n                Video Capture\n                Metadata Capture\n                Streaming\n                Extended Pix Format\n                Device Capabilities\n        Device Caps      : 0x04200001\n                Video Capture\n                Streaming\n                Extended Pix Format\nMedia Driver Info:\n        Driver name      : uvcvideo\n        Model            : usb video: usb video\n        Serial           :\n        Bus info         : usb-0000:00:14.0-2\n        Media version    : 6.1.119\n        Hardware revision: 0x00002100 (8448)\n        Driver version   : 6.1.119\nInterface Info:\n        ID               : 0x03000002\n        Type             : V4L Video\nEntity Info:\n        ID               : 0x00000001 (1)\n        Name             : usb video: usb video\n        Function         : V4L2 I\/O\n        Flags            : default\n        Pad 0x01000007   : 0: Sink\n          Link 0x0200000d: from remote pad 0x100000a of entity 'Processing 2' (Video Pixel Formatter):                            Data, Enabled, Immutable\nPriority: 2\nVideo input : 0 (Input 1: ok)\nFormat Video Capture:\n        Width\/Height      : 1920\/1080\n        Pixel Format      : 'MJPG' (Motion-JPEG)\n        Field             : None\n        Bytes per Line    : 0\n        Size Image        : 4147200\n        Colorspace        : sRGB\n        Transfer Function : Rec. 709\n        YCbCr\/HSV Encoding: ITU-R 601\n        Quantization      : Default (maps to Full Range)\n        Flags             :\nCrop Capability Video Capture:\n        Bounds      : Left 0, Top 0, Width 1920, Height 1080\n        Default     : Left 0, Top 0, Width 1920, Height 1080\n        Pixel Aspect: 1\/1\nSelection Video Capture: crop_default, Left 0, Top 0, Width 1920, Height 1080, Flags:\nSelection Video Capture: crop_bounds, Left 0, Top 0, Width 1920, Height 1080, Flags:\nStreaming Parameters Video Capture:\n        Capabilities     : timeperframe\n        Frames per second: 30.000 (30\/1)\n        Read buffers     : 0\n\nUser Controls\n\n                     brightness 0x00980900 (int)    : min=-128 max=127 step=1 default=-11 value=-11\n                       contrast 0x00980901 (int)    : min=0 max=255 step=1 default=148 value=148\n                     saturation 0x00980902 (int)    : min=0 max=255 step=1 default=180 value=180\n                            hue 0x00980903 (int)    : min=-128 max=127 step=1 default=0 value=0\n<\/code><\/pre>\n\n\n\n<p>\u53e6\u5916\u5982\u679c\u8981\u770b\u5230\u5b8c\u6574\u652f\u63f4\u7684 resolution \u8ddf framerate \u7684\u8a71\u53ef\u4ee5\u7528\u9019\u500b command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>v4l2-ctl -D -d \/dev\/video0 --list-formats-ext<\/code><\/pre>\n\n\n\n<p>\u5b83\u6703\u8f38\u51fa\u5f88\u591a\u4e0d\u540c\u7684\u652f\u63f4\u683c\u5f0f\uff0c\u4f8b\u5982\u8aaa\u9019\u662f UYVY422\uff0c\u652f\u63f4\u4f8b\u5982 480&#215;270 \u7136\u5f8c\u4e00\u5217 fps \u7b49\u7b49\uff0cffmpeg \u7684\u6307\u4ee4\u4e5f\u53ef\u4ee5\u6309\u652f\u63f4\u7684\u683c\u5f0f\u4f86\u8abf\u6574\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>       Index       : 1\n        Type        : Video Capture\n        Pixel Format: 'UYVY'\n        Name        : UYVY 4:2:2\n                Size: Discrete 424x240\n                        Interval: Discrete 0.011s (90.000 fps)\n                        Interval: Discrete 0.017s (60.000 fps)\n                        Interval: Discrete 0.033s (30.000 fps)\n                        Interval: Discrete 0.067s (15.000 fps)\n                        Interval: Discrete 0.167s (6.000 fps)\n                Size: Discrete 480x270\n                        Interval: Discrete 0.011s (90.000 fps)\n                        Interval: Discrete 0.017s (60.000 fps)\n                        Interval: Discrete 0.033s (30.000 fps)\n                        Interval: Discrete 0.067s (15.000 fps)\n                        Interval: Discrete 0.167s (6.000 fps)\n                Size: Discrete 640x360\n                        Interval: Discrete 0.011s (90.000 fps)\n                        Interval: Discrete 0.017s (60.000 fps)\n                        Interval: Discrete 0.033s (30.000 fps)\n                        Interval: Discrete 0.067s (15.000 fps)\n                        Interval: Discrete 0.167s (6.000 fps)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u9023\u63a5\u5230\u4e32\u6d41<\/h2>\n\n\n\n<p>\u8981\u9023\u63a5\u7684\u8a71\u53ef\u4ee5\u7528 VLC \u6216\u662f OBS \u4f86\u89c0\u770b\uff0c\u4ee5 VLC \u70ba\u4f8b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"344\" height=\"103\" src=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2025\/01\/\u5716\u7247.png\" alt=\"\" class=\"wp-image-1290\" srcset=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2025\/01\/\u5716\u7247.png 344w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2025\/01\/\u5716\u7247-300x90.png 300w\" sizes=\"auto, (max-width: 344px) 100vw, 344px\" \/><\/figure>\n\n\n\n<p>\u7136\u5f8c\u5728\u7db2\u5740\u5217\u8f38\u5165\u4f3a\u670d\u5668 \/ \u96fb\u8166\u7684 IP \u5730\u5740\u5373\u53ef\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"699\" height=\"446\" src=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2025\/01\/\u5716\u7247-1.png\" alt=\"\" class=\"wp-image-1291\" srcset=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2025\/01\/\u5716\u7247-1.png 699w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2025\/01\/\u5716\u7247-1-300x191.png 300w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u6709\u4e00\u5929\u4e0d\u77e5\u9053\u70ba\u751a\u9ebc\u4f60\u9700\u8981\u900f\u904e Linux \/ Raspberry Pi \u4e32\u6d41 HDMI capture card \u5230\u7db2\u7d61\u4e0a\u53e6\u4e00\u500b\u4f4d\u7f6e\u7684\u8a71\uff0c\u4f60\u53ef\u4ee5\u7528\u9019\u500b ffmpeg command\uff1a \u5982\u679c\u4f60\u7684\u96fb\u8166\u4e0a\u4e26\u6c92\u6709 v4l2\uff0c\u53ef\u4ee5\u900f\u904e\u4ee5\u4e0b\u6307\u4ee4\u5b89\u88dd\u4e26\u6293\u5230 capture card \u652f\u63f4\u7684\u8f38\u51fa\u683c\u5f0f \u8f38\u51fa\u4f8b\u5b50\uff1a \u53e6\u5916\u5982\u679c\u8981\u770b\u5230\u5b8c\u6574\u652f\u63f4\u7684 resolution \u8ddf framerate \u7684\u8a71\u53ef\u4ee5\u7528\u9019\u500b command \u5b83\u6703\u8f38\u51fa\u5f88\u591a\u4e0d\u540c\u7684\u652f\u63f4\u683c\u5f0f\uff0c\u4f8b\u5982\u8aaa\u9019\u662f UYVY422\uff0c\u652f\u63f4\u4f8b\u5982 480&#215;270 \u7136\u5f8c\u4e00\u5217 fps \u7b49\u7b49\uff0cffmpeg \u7684\u6307\u4ee4\u4e5f\u53ef\u4ee5\u6309\u652f\u63f4\u7684\u683c\u5f0f\u4f86\u8abf\u6574\u3002 \u9023\u63a5\u5230\u4e32\u6d41 \u8981\u9023\u63a5\u7684\u8a71\u53ef\u4ee5\u7528 VLC \u6216\u662f OBS \u4f86\u89c0\u770b\uff0c\u4ee5 VLC \u70ba\u4f8b\uff1a \u7136\u5f8c\u5728\u7db2\u5740\u5217\u8f38\u5165\u4f3a\u670d\u5668 \/ \u96fb\u8166\u7684 IP \u5730\u5740\u5373\u53ef\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1289","post","type-post","status-publish","format-standard","hentry","category-development-logs"],"_links":{"self":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts\/1289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1289"}],"version-history":[{"count":2,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts\/1289\/revisions"}],"predecessor-version":[{"id":1293,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts\/1289\/revisions\/1293"}],"wp:attachment":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}