gpt4 book ai didi

opencv - vcap 无法打开 [udp @ 0x56378e8a76a0] 绑定(bind)失败 : Permission denied

转载 作者:行者123 更新时间:2023-12-02 17:31:34 26 4
gpt4 key购买 nike

我正在尝试使用带有 ipv6 地址的 opencv 中的 VideoCapture 函数从我的树莓派流式传输到我的 debian 虚拟机,但是当我尝试时,标题中出现错误。

我已经确认通过 netcat 和 mplayer 可以访问 ipv6 地址,具体如下:

Debian 主机:

网猫-l -6 -u 2222

树莓派:

/opt/vc/bin/raspivid -t 0 -w 300 -h 300 -hf -fps 20 -o - | nc -u(ipv6地址)2222

代码:

    VideoCapture vcap;

const string videoStreamAddress = "udp://" + "(my Ipv6 address)" + ":2222";

vcap.open(videoStreamAddress);

编辑:我已经确认 vcap.open 可以使用 127.0.0.1 但问题是它仍然无法使用我的 ipv6 地址

最佳答案

以您指定的格式使用的 IPv6 地址 <protocol>:// , 需要用括号括起来( [] )。这最初是在 RFC 2732, Format for Literal IPv6 Addresses in URL's 中指定的。并继续 RFC 3896:, Uniform Resource Identifier (URI): Generic Syntax :

3.2.2. Host

The host subcomponent of authority is identified by an IP literalencapsulated within square brackets, an IPv4 address in dotted-decimal form, or a registered name. The host subcomponent is case-insensitive. he presence of a host subcomponent within a URI does notimply that the scheme requires access to the given host on theInternet. In many cases, the host syntax is used only for the sake ofreusing the existing registration process created and deployed forDNS, thus obtaining a globally unique name without the cost ofdeploying another registry. However, such use comes with its owncosts: domain name ownership may change over time for reasons notanticipated by the URI producer. In other cases, the data within thehost component identifies a registered name that has nothing to dowith an Internet host. We use the name "host" for the ABNF rulebecause that is its most common purpose, not its only purpose.

  host        = IP-literal / IPv4address / reg-name

The syntax rule for host is ambiguous because it does not completelydistinguish between an IPv4address and a reg-name. In order todisambiguate the syntax, we apply the "first-match-wins" algorithm: Ifhost matches the rule for IPv4address, then it should be considered anIPv4 address literal and not a reg-name. Although host iscase-insensitive, producers and normalizers should use lowercase forregistered names and hexadecimal addresses for the sake of uniformity,while only using uppercase letters for percent-encodings.

A host identified by an Internet Protocol literal address, version 6[RFC3513] or later, is distinguished by enclosing the IP literalwithin square brackets ("[" and "]"). This is the only place wheresquare bracket characters are allowed in the URI syntax. Inanticipation of future, as-yet-undefined IP literal address formats,an implementation may use an optional version flag to indicate such aformat explicitly rather than rely on heuristic determination.

  IP-literal = "[" ( IPv6address / IPvFuture  ) "]"

IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )

The version flag does not indicate the IP version; rather, itindicates future versions of the literal format. As such,implementations must not provide the version flag for the existingIPv4 and IPv6 literal address forms described below. If a URIcontaining an IP-literal that starts with "v" (case-insensitive),indicating that the version flag is present, is dereferenced by anapplication that does not know the meaning of that version flag, thenthe application should return an appropriate error for "addressmechanism not supported".

A host identified by an IPv6 literal address is represented inside thesquare brackets without a preceding version flag. The ABNF providedhere is a translation of the text definition of an IPv6 literaladdress provided in [RFC3513]. This syntax does not support IPv6scoped addressing zone identifiers.

A 128-bit IPv6 address is divided into eight 16-bit pieces. Each pieceis represented numerically in case-insensitive hexadecimal, using oneto four hexadecimal digits (leading zeroes are permitted). The eightencoded pieces are given most-significant first, separated by coloncharacters. Optionally, the least-significant two pieces may insteadbe represented in IPv4 address textual format. A sequence of one ormore consecutive zero-valued 16-bit pieces within the address may beelided, omitting all their digits and leaving exactly two consecutivecolons in their place to mark the elision.

  IPv6address =                            6( h16 ":" ) ls32
/ "::" 5( h16 ":" ) ls32
/ [ h16 ] "::" 4( h16 ":" ) ls32
/ [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
/ [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
/ [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
/ [ *4( h16 ":" ) h16 ] "::" ls32
/ [ *5( h16 ":" ) h16 ] "::" h16
/ [ *6( h16 ":" ) h16 ] "::"

ls32 = ( h16 ":" h16 ) / IPv4address
; least-significant 32 bits of address

h16 = 1*4HEXDIG
; 16 bits of address represented in hexadecimal

A host identified by an IPv4 literal address is represented indotted-decimal notation (a sequence of four decimal numbers in therange 0 to 255, separated by "."), as described in [RFC1123] byreference to [RFC0952]. Note that other forms of dotted notation maybe interpreted on some platforms, as described in Section 7.4, butonly the dotted-decimal form of four octets is allowed by thisgrammar.

  IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet = DIGIT ; 0-9
/ %x31-39 DIGIT ; 10-99
/ "1" 2DIGIT ; 100-199
/ "2" %x30-34 DIGIT ; 200-249
/ "25" %x30-35 ; 250-255

A host identified by a registered name is a sequence of charactersusually intended for lookup within a locally defined host or servicename registry, though the URI's scheme-specific semantics may requirethat a specific registry (or fixed name table) be used instead. Themost common name registry mechanism is the Domain Name System (DNS). Aregistered name intended for lookup in the DNS uses the syntax definedin Section 3.5 of [RFC1034] and Section 2.1 of [RFC1123]. Such a nameconsists of a sequence of domain labels separated by ".", each domainlabel starting and ending with an alphanumeric character and possiblyalso containing "-" characters. The rightmost domain label of a fullyqualified domain name in DNS may be followed by a single "." andshould be if it is necessary to distinguish between the completedomain name and some local domain.

  reg-name    = *( unreserved / pct-encoded / sub-delims )

If the URI scheme defines a default for host, then that defaultapplies when the host subcomponent is undefined or when the registeredname is empty (zero length). For example, the "file" URI scheme isdefined so that no authority, an empty host, and "localhost" all meanthe end-user's machine, whereas the "http" scheme considers a missingauthority or empty host invalid.

This specification does not mandate a particular registered namelookup technology and therefore does not restrict the syntax of reg-name beyond what is necessary for interoperability. Instead, itdelegates the issue of registered name syntax conformance to theoperating system of each application performing URI resolution, andthat operating system decides what it will allow for the purpose ofhost identification. A URI resolution implementation might use DNS,host tables, yellow pages, NetInfo, WINS, or any other system forlookup of registered names. However, a globally scoped naming system,such as DNS fully qualified domain names, is necessary for URIsintended to have global scope. URI producers should use names thatconform to the DNS syntax, even when use of DNS is not immediatelyapparent, and should limit these names to no more than 255 charactersin length.

The reg-name syntax allows percent-encoded octets in order torepresent non-ASCII registered names in a uniform way that isindependent of the underlying name resolution technology. Non-ASCIIcharacters must first be encoded according to UTF-8 [STD63], and theneach octet of the corresponding UTF-8 sequence must be percent-encoded to be represented as URI characters. URI producingapplications must not use percent-encoding in host unless it is usedto represent a UTF-8 character sequence. When a non-ASCII registeredname represents an internationalized domain name intended forresolution via the DNS, the name must be transformed to the IDNAencoding [RFC3490] prior to name lookup. URI producers should providethese registered names in the IDNA encoding, rather than apercent-encoding, if they wish to maximize interoperability withlegacy URI resolvers.

关于opencv - vcap 无法打开 [udp @ 0x56378e8a76a0] 绑定(bind)失败 : Permission denied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55384201/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com