### RTMP URL with SWF Verification Example Source: https://rtmpdump.mplayerhq.hu/librtmp.3.html An example of a string suitable for use with RTMP_SetupURL(), demonstrating how to specify a SWF URL and enable SWF verification. ```shell "rtmp://flashserver:1935/ondemand/thefile swfUrl=http://flashserver/player.swf swfVfy=1" ``` -------------------------------- ### Equivalent HTTP and rtmpdump Commands Source: https://rtmpdump.mplayerhq.hu/rtmpgw.8.html Demonstrates how an HTTP GET request for an RTMP stream can be translated into an rtmpdump command. Note that only short-form options are supported in this translation. ```http GET /?r=rtmp:%2f%2fserver%2fmyapp&y=somefile HTTP/1.0 ``` ```bash rtmpdump -r rtmp://server/myapp -y somefile ``` -------------------------------- ### Clone RTMPDump Source Code Source: https://rtmpdump.mplayerhq.hu Use this command to clone the RTMPDump source code repository from the official FFmpeg git server. This is the recommended way to get the latest version. ```bash git clone git://git.ffmpeg.org/rtmpdump ``` -------------------------------- ### Constructing AMF Data with conn Option Source: https://rtmpdump.mplayerhq.hu/rtmpdump.1.html Demonstrates how to append arbitrary AMF data to the Connect message using the --conn option. This is useful for servers requiring specific connection data. ```shell -C B:1 -C S:authMe -C O:1 -C NN:code:1.23 -C NS:flag:ok -C O:0 ``` -------------------------------- ### RTMP URL Format and Options Source: https://rtmpdump.mplayerhq.hu/librtmp.3.html Details the structure of RTMP URLs and the various connection and network parameters that can be specified. ```APIDOC ## RTMP URL Format and Options ### RTMP URL Format The RTMP URL format is: ``` rtmp[t][e|s]://hostname[:port][/app[/playpath]] ``` Supports plain rtmp, tunneled (t), encrypted (e), and SSL/TLS (s) sessions, along with their tunneled variants (rtmpte, rmtpts). ### Options Additional options can be specified by appending space-separated key=value pairs to the URL. Special characters in values must be escaped using a backslash followed by two hexadecimal digits (e.g., space is \20, backslash is \5c). #### Network Parameters - **socks=host:port**: Use the specified SOCKS4 proxy. #### Connection Parameters These options define the content of the RTMP Connect request packet. - **app=name**: Name of the application to connect to on the RTMP server. Overrides the app in the RTMP URL. - **tcUrl=url**: URL of the target stream. Defaults to rtmp[t][e|s]://host[:port]/app. - **pageUrl=url**: URL of the web page embedding the media. - **swfUrl=url**: URL of the SWF player for the media. - **flashVer=version**: Version of the Flash plugin. Defaults to "LNX 10,0,32,18". - **conn=type:data**: Append arbitrary AMF data to the Connect message. Supported types: B (Boolean), N (Number), S (String), O (Object), Z (Null). Example: `conn=B:1 conn=S:authMe conn=O:1 conn=NN:code:1.23 conn=NS:flag:ok conn=O:0` ``` -------------------------------- ### RTMP Session Management Functions Source: https://rtmpdump.mplayerhq.hu/librtmp.3.html This section details the fundamental functions for managing an RTMP session, from allocation and initialization to connection establishment and stream handling. ```APIDOC ## RTMP Session Management Functions ### Description Provides functions to allocate, initialize, set up, connect, and manage RTMP sessions and streams. ### Functions - **RTMP_Alloc()**: Creates a session handle. - **RTMP_Init(RTMP *r)**: Initializes an RTMP session. - **RTMP_SetupURL(RTMP *r, const char *url)**: Sets up the RTMP session parameters using a provided URL. - **RTMP_Connect(RTMP *r, const RTMPPacket *pkt)**: Establishes the network connection for the RTMP session. - **RTMP_ConnectStream(RTMP *r, int seekTime)**: Establishes the RTMP session stream. - **RTMP_EnableWrite(RTMP *r)**: Enables writing to the stream for publishing. - **RTMP_Read(RTMP *r, char *buf, int size)**: Reads data from the RTMP stream. - **RTMP_Write(RTMP *r, char *buf, int size)**: Writes data to the RTMP stream. - **RTMP_Pause(RTMP *r, bool pause)**: Pauses or unpauses the stream playback. - **RTMP_Seek(RTMP *r, int seekTime)**: Seeks to a specific position in the stream. - **RTMP_Close(RTMP *r)**: Closes the RTMP session. - **RTMP_Free(RTMP *r)**: Frees the session handle. ``` -------------------------------- ### RTMP Protocol Selection Source: https://rtmpdump.mplayerhq.hu/rtmpgw.8.html Specifies the protocol to use for the RTMP connection. Each number corresponds to a different protocol type. ```shell 0 = rtmp 1 = rtmpt 2 = rtmpe 3 = rtmpte 4 = rtmps 5 = rtmpts ``` -------------------------------- ### RTMP URL Format Source: https://rtmpdump.mplayerhq.hu/rtmpdump.1.html Specifies the general format for RTMP URLs used with rtmpdump. Supports plain, tunneled, and encrypted sessions. ```shell rtmp[t][e]://hostname[:port][/app[/playpath]] ``` -------------------------------- ### AMF Data Connection Options Source: https://rtmpdump.mplayerhq.hu/librtmp.3.html The 'conn' option allows appending arbitrary AMF data to the RTMP Connect message. Data can be of types Boolean (B), Number (N), String (S), Object (O), or Null (Z). Subobjects can have named data items. This option can be used multiple times to construct complex AMF sequences. ```text conn=B:1 conn=S:authMe conn=O:1 conn=NN:code:1.23 conn=NS:flag:ok conn=O:0 ``` -------------------------------- ### RTMP URL Format Source: https://rtmpdump.mplayerhq.hu/librtmp.3.html The RTMP URL specifies the connection details for the media server. It supports plain RTMP, tunneled (RTMPT), and encrypted (RTMPE, RTMPS) sessions. Additional options can be appended as key=value pairs, with special characters requiring hexadecimal escaping (e.g., space as \20). ```text rtmp[t][e|s]://hostname[:port][/app[/playpath]] ``` -------------------------------- ### Constructing AMF Data for Connect Message Source: https://rtmpdump.mplayerhq.hu/rtmpgw.8.html Appends arbitrary AMF data to the RTMP Connect message. This is useful for servers requiring specific connection parameters. ```shell −C B:1 −C S:authMe −C O:1 −C NN:code:1.23 −C NS:flag:ok −C O:0 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.