1cabdff1aSopenharmony_ci@chapter Protocol Options 2cabdff1aSopenharmony_ci@c man begin PROTOCOL OPTIONS 3cabdff1aSopenharmony_ci 4cabdff1aSopenharmony_ciThe libavformat library provides some generic global options, which 5cabdff1aSopenharmony_cican be set on all the protocols. In addition each protocol may support 6cabdff1aSopenharmony_ciso-called private options, which are specific for that component. 7cabdff1aSopenharmony_ci 8cabdff1aSopenharmony_ciOptions may be set by specifying -@var{option} @var{value} in the 9cabdff1aSopenharmony_ciFFmpeg tools, or by setting the value explicitly in the 10cabdff1aSopenharmony_ci@code{AVFormatContext} options or using the @file{libavutil/opt.h} API 11cabdff1aSopenharmony_cifor programmatic use. 12cabdff1aSopenharmony_ci 13cabdff1aSopenharmony_ciThe list of supported options follows: 14cabdff1aSopenharmony_ci 15cabdff1aSopenharmony_ci@table @option 16cabdff1aSopenharmony_ci@item protocol_whitelist @var{list} (@emph{input}) 17cabdff1aSopenharmony_ciSet a ","-separated list of allowed protocols. "ALL" matches all protocols. Protocols 18cabdff1aSopenharmony_ciprefixed by "-" are disabled. 19cabdff1aSopenharmony_ciAll protocols are allowed by default but protocols used by an another 20cabdff1aSopenharmony_ciprotocol (nested protocols) are restricted to a per protocol subset. 21cabdff1aSopenharmony_ci@end table 22cabdff1aSopenharmony_ci 23cabdff1aSopenharmony_ci@c man end PROTOCOL OPTIONS 24cabdff1aSopenharmony_ci 25cabdff1aSopenharmony_ci@chapter Protocols 26cabdff1aSopenharmony_ci@c man begin PROTOCOLS 27cabdff1aSopenharmony_ci 28cabdff1aSopenharmony_ciProtocols are configured elements in FFmpeg that enable access to 29cabdff1aSopenharmony_ciresources that require specific protocols. 30cabdff1aSopenharmony_ci 31cabdff1aSopenharmony_ciWhen you configure your FFmpeg build, all the supported protocols are 32cabdff1aSopenharmony_cienabled by default. You can list all available ones using the 33cabdff1aSopenharmony_ciconfigure option "--list-protocols". 34cabdff1aSopenharmony_ci 35cabdff1aSopenharmony_ciYou can disable all the protocols using the configure option 36cabdff1aSopenharmony_ci"--disable-protocols", and selectively enable a protocol using the 37cabdff1aSopenharmony_cioption "--enable-protocol=@var{PROTOCOL}", or you can disable a 38cabdff1aSopenharmony_ciparticular protocol using the option 39cabdff1aSopenharmony_ci"--disable-protocol=@var{PROTOCOL}". 40cabdff1aSopenharmony_ci 41cabdff1aSopenharmony_ciThe option "-protocols" of the ff* tools will display the list of 42cabdff1aSopenharmony_cisupported protocols. 43cabdff1aSopenharmony_ci 44cabdff1aSopenharmony_ciAll protocols accept the following options: 45cabdff1aSopenharmony_ci 46cabdff1aSopenharmony_ci@table @option 47cabdff1aSopenharmony_ci@item rw_timeout 48cabdff1aSopenharmony_ciMaximum time to wait for (network) read/write operations to complete, 49cabdff1aSopenharmony_ciin microseconds. 50cabdff1aSopenharmony_ci@end table 51cabdff1aSopenharmony_ci 52cabdff1aSopenharmony_ciA description of the currently available protocols follows. 53cabdff1aSopenharmony_ci 54cabdff1aSopenharmony_ci@section amqp 55cabdff1aSopenharmony_ci 56cabdff1aSopenharmony_ciAdvanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based 57cabdff1aSopenharmony_cipublish-subscribe communication protocol. 58cabdff1aSopenharmony_ci 59cabdff1aSopenharmony_ciFFmpeg must be compiled with --enable-librabbitmq to support AMQP. A separate 60cabdff1aSopenharmony_ciAMQP broker must also be run. An example open-source AMQP broker is RabbitMQ. 61cabdff1aSopenharmony_ci 62cabdff1aSopenharmony_ciAfter starting the broker, an FFmpeg client may stream data to the broker using 63cabdff1aSopenharmony_cithe command: 64cabdff1aSopenharmony_ci 65cabdff1aSopenharmony_ci@example 66cabdff1aSopenharmony_ciffmpeg -re -i input -f mpegts amqp://[[user]:[password]@@]hostname[:port][/vhost] 67cabdff1aSopenharmony_ci@end example 68cabdff1aSopenharmony_ci 69cabdff1aSopenharmony_ciWhere hostname and port (default is 5672) is the address of the broker. The 70cabdff1aSopenharmony_ciclient may also set a user/password for authentication. The default for both 71cabdff1aSopenharmony_cifields is "guest". Name of virtual host on broker can be set with vhost. The 72cabdff1aSopenharmony_cidefault value is "/". 73cabdff1aSopenharmony_ci 74cabdff1aSopenharmony_ciMuliple subscribers may stream from the broker using the command: 75cabdff1aSopenharmony_ci@example 76cabdff1aSopenharmony_ciffplay amqp://[[user]:[password]@@]hostname[:port][/vhost] 77cabdff1aSopenharmony_ci@end example 78cabdff1aSopenharmony_ci 79cabdff1aSopenharmony_ciIn RabbitMQ all data published to the broker flows through a specific exchange, 80cabdff1aSopenharmony_ciand each subscribing client has an assigned queue/buffer. When a packet arrives 81cabdff1aSopenharmony_ciat an exchange, it may be copied to a client's queue depending on the exchange 82cabdff1aSopenharmony_ciand routing_key fields. 83cabdff1aSopenharmony_ci 84cabdff1aSopenharmony_ciThe following options are supported: 85cabdff1aSopenharmony_ci 86cabdff1aSopenharmony_ci@table @option 87cabdff1aSopenharmony_ci 88cabdff1aSopenharmony_ci@item exchange 89cabdff1aSopenharmony_ciSets the exchange to use on the broker. RabbitMQ has several predefined 90cabdff1aSopenharmony_ciexchanges: "amq.direct" is the default exchange, where the publisher and 91cabdff1aSopenharmony_cisubscriber must have a matching routing_key; "amq.fanout" is the same as a 92cabdff1aSopenharmony_cibroadcast operation (i.e. the data is forwarded to all queues on the fanout 93cabdff1aSopenharmony_ciexchange independent of the routing_key); and "amq.topic" is similar to 94cabdff1aSopenharmony_ci"amq.direct", but allows for more complex pattern matching (refer to the RabbitMQ 95cabdff1aSopenharmony_cidocumentation). 96cabdff1aSopenharmony_ci 97cabdff1aSopenharmony_ci@item routing_key 98cabdff1aSopenharmony_ciSets the routing key. The default value is "amqp". The routing key is used on 99cabdff1aSopenharmony_cithe "amq.direct" and "amq.topic" exchanges to decide whether packets are written 100cabdff1aSopenharmony_cito the queue of a subscriber. 101cabdff1aSopenharmony_ci 102cabdff1aSopenharmony_ci@item pkt_size 103cabdff1aSopenharmony_ciMaximum size of each packet sent/received to the broker. Default is 131072. 104cabdff1aSopenharmony_ciMinimum is 4096 and max is any large value (representable by an int). When 105cabdff1aSopenharmony_cireceiving packets, this sets an internal buffer size in FFmpeg. It should be 106cabdff1aSopenharmony_ciequal to or greater than the size of the published packets to the broker. Otherwise 107cabdff1aSopenharmony_cithe received message may be truncated causing decoding errors. 108cabdff1aSopenharmony_ci 109cabdff1aSopenharmony_ci@item connection_timeout 110cabdff1aSopenharmony_ciThe timeout in seconds during the initial connection to the broker. The 111cabdff1aSopenharmony_cidefault value is rw_timeout, or 5 seconds if rw_timeout is not set. 112cabdff1aSopenharmony_ci 113cabdff1aSopenharmony_ci@item delivery_mode @var{mode} 114cabdff1aSopenharmony_ciSets the delivery mode of each message sent to broker. 115cabdff1aSopenharmony_ciThe following values are accepted: 116cabdff1aSopenharmony_ci@table @samp 117cabdff1aSopenharmony_ci@item persistent 118cabdff1aSopenharmony_ciDelivery mode set to "persistent" (2). This is the default value. 119cabdff1aSopenharmony_ciMessages may be written to the broker's disk depending on its setup. 120cabdff1aSopenharmony_ci 121cabdff1aSopenharmony_ci@item non-persistent 122cabdff1aSopenharmony_ciDelivery mode set to "non-persistent" (1). 123cabdff1aSopenharmony_ciMessages will stay in broker's memory unless the broker is under memory 124cabdff1aSopenharmony_cipressure. 125cabdff1aSopenharmony_ci 126cabdff1aSopenharmony_ci@end table 127cabdff1aSopenharmony_ci 128cabdff1aSopenharmony_ci@end table 129cabdff1aSopenharmony_ci 130cabdff1aSopenharmony_ci@section async 131cabdff1aSopenharmony_ci 132cabdff1aSopenharmony_ciAsynchronous data filling wrapper for input stream. 133cabdff1aSopenharmony_ci 134cabdff1aSopenharmony_ciFill data in a background thread, to decouple I/O operation from demux thread. 135cabdff1aSopenharmony_ci 136cabdff1aSopenharmony_ci@example 137cabdff1aSopenharmony_ciasync:@var{URL} 138cabdff1aSopenharmony_ciasync:http://host/resource 139cabdff1aSopenharmony_ciasync:cache:http://host/resource 140cabdff1aSopenharmony_ci@end example 141cabdff1aSopenharmony_ci 142cabdff1aSopenharmony_ci@section bluray 143cabdff1aSopenharmony_ci 144cabdff1aSopenharmony_ciRead BluRay playlist. 145cabdff1aSopenharmony_ci 146cabdff1aSopenharmony_ciThe accepted options are: 147cabdff1aSopenharmony_ci@table @option 148cabdff1aSopenharmony_ci 149cabdff1aSopenharmony_ci@item angle 150cabdff1aSopenharmony_ciBluRay angle 151cabdff1aSopenharmony_ci 152cabdff1aSopenharmony_ci@item chapter 153cabdff1aSopenharmony_ciStart chapter (1...N) 154cabdff1aSopenharmony_ci 155cabdff1aSopenharmony_ci@item playlist 156cabdff1aSopenharmony_ciPlaylist to read (BDMV/PLAYLIST/?????.mpls) 157cabdff1aSopenharmony_ci 158cabdff1aSopenharmony_ci@end table 159cabdff1aSopenharmony_ci 160cabdff1aSopenharmony_ciExamples: 161cabdff1aSopenharmony_ci 162cabdff1aSopenharmony_ciRead longest playlist from BluRay mounted to /mnt/bluray: 163cabdff1aSopenharmony_ci@example 164cabdff1aSopenharmony_cibluray:/mnt/bluray 165cabdff1aSopenharmony_ci@end example 166cabdff1aSopenharmony_ci 167cabdff1aSopenharmony_ciRead angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2: 168cabdff1aSopenharmony_ci@example 169cabdff1aSopenharmony_ci-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray 170cabdff1aSopenharmony_ci@end example 171cabdff1aSopenharmony_ci 172cabdff1aSopenharmony_ci@section cache 173cabdff1aSopenharmony_ci 174cabdff1aSopenharmony_ciCaching wrapper for input stream. 175cabdff1aSopenharmony_ci 176cabdff1aSopenharmony_ciCache the input stream to temporary file. It brings seeking capability to live streams. 177cabdff1aSopenharmony_ci 178cabdff1aSopenharmony_ciThe accepted options are: 179cabdff1aSopenharmony_ci@table @option 180cabdff1aSopenharmony_ci 181cabdff1aSopenharmony_ci@item read_ahead_limit 182cabdff1aSopenharmony_ciAmount in bytes that may be read ahead when seeking isn't supported. Range is -1 to INT_MAX. 183cabdff1aSopenharmony_ci-1 for unlimited. Default is 65536. 184cabdff1aSopenharmony_ci 185cabdff1aSopenharmony_ci@end table 186cabdff1aSopenharmony_ci 187cabdff1aSopenharmony_ciURL Syntax is 188cabdff1aSopenharmony_ci@example 189cabdff1aSopenharmony_cicache:@var{URL} 190cabdff1aSopenharmony_ci@end example 191cabdff1aSopenharmony_ci 192cabdff1aSopenharmony_ci@section concat 193cabdff1aSopenharmony_ci 194cabdff1aSopenharmony_ciPhysical concatenation protocol. 195cabdff1aSopenharmony_ci 196cabdff1aSopenharmony_ciRead and seek from many resources in sequence as if they were 197cabdff1aSopenharmony_cia unique resource. 198cabdff1aSopenharmony_ci 199cabdff1aSopenharmony_ciA URL accepted by this protocol has the syntax: 200cabdff1aSopenharmony_ci@example 201cabdff1aSopenharmony_ciconcat:@var{URL1}|@var{URL2}|...|@var{URLN} 202cabdff1aSopenharmony_ci@end example 203cabdff1aSopenharmony_ci 204cabdff1aSopenharmony_ciwhere @var{URL1}, @var{URL2}, ..., @var{URLN} are the urls of the 205cabdff1aSopenharmony_ciresource to be concatenated, each one possibly specifying a distinct 206cabdff1aSopenharmony_ciprotocol. 207cabdff1aSopenharmony_ci 208cabdff1aSopenharmony_ciFor example to read a sequence of files @file{split1.mpeg}, 209cabdff1aSopenharmony_ci@file{split2.mpeg}, @file{split3.mpeg} with @command{ffplay} use the 210cabdff1aSopenharmony_cicommand: 211cabdff1aSopenharmony_ci@example 212cabdff1aSopenharmony_ciffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg 213cabdff1aSopenharmony_ci@end example 214cabdff1aSopenharmony_ci 215cabdff1aSopenharmony_ciNote that you may need to escape the character "|" which is special for 216cabdff1aSopenharmony_cimany shells. 217cabdff1aSopenharmony_ci 218cabdff1aSopenharmony_ci@section concatf 219cabdff1aSopenharmony_ci 220cabdff1aSopenharmony_ciPhysical concatenation protocol using a line break delimited list of 221cabdff1aSopenharmony_ciresources. 222cabdff1aSopenharmony_ci 223cabdff1aSopenharmony_ciRead and seek from many resources in sequence as if they were 224cabdff1aSopenharmony_cia unique resource. 225cabdff1aSopenharmony_ci 226cabdff1aSopenharmony_ciA URL accepted by this protocol has the syntax: 227cabdff1aSopenharmony_ci@example 228cabdff1aSopenharmony_ciconcatf:@var{URL} 229cabdff1aSopenharmony_ci@end example 230cabdff1aSopenharmony_ci 231cabdff1aSopenharmony_ciwhere @var{URL} is the url containing a line break delimited list of 232cabdff1aSopenharmony_ciresources to be concatenated, each one possibly specifying a distinct 233cabdff1aSopenharmony_ciprotocol. Special characters must be escaped with backslash or single 234cabdff1aSopenharmony_ciquotes. See @ref{quoting_and_escaping,,the "Quoting and escaping" 235cabdff1aSopenharmony_cisection in the ffmpeg-utils(1) manual,ffmpeg-utils}. 236cabdff1aSopenharmony_ci 237cabdff1aSopenharmony_ciFor example to read a sequence of files @file{split1.mpeg}, 238cabdff1aSopenharmony_ci@file{split2.mpeg}, @file{split3.mpeg} listed in separate lines within 239cabdff1aSopenharmony_cia file @file{split.txt} with @command{ffplay} use the command: 240cabdff1aSopenharmony_ci@example 241cabdff1aSopenharmony_ciffplay concatf:split.txt 242cabdff1aSopenharmony_ci@end example 243cabdff1aSopenharmony_ciWhere @file{split.txt} contains the lines: 244cabdff1aSopenharmony_ci@example 245cabdff1aSopenharmony_cisplit1.mpeg 246cabdff1aSopenharmony_cisplit2.mpeg 247cabdff1aSopenharmony_cisplit3.mpeg 248cabdff1aSopenharmony_ci@end example 249cabdff1aSopenharmony_ci 250cabdff1aSopenharmony_ci@section crypto 251cabdff1aSopenharmony_ci 252cabdff1aSopenharmony_ciAES-encrypted stream reading protocol. 253cabdff1aSopenharmony_ci 254cabdff1aSopenharmony_ciThe accepted options are: 255cabdff1aSopenharmony_ci@table @option 256cabdff1aSopenharmony_ci@item key 257cabdff1aSopenharmony_ciSet the AES decryption key binary block from given hexadecimal representation. 258cabdff1aSopenharmony_ci 259cabdff1aSopenharmony_ci@item iv 260cabdff1aSopenharmony_ciSet the AES decryption initialization vector binary block from given hexadecimal representation. 261cabdff1aSopenharmony_ci@end table 262cabdff1aSopenharmony_ci 263cabdff1aSopenharmony_ciAccepted URL formats: 264cabdff1aSopenharmony_ci@example 265cabdff1aSopenharmony_cicrypto:@var{URL} 266cabdff1aSopenharmony_cicrypto+@var{URL} 267cabdff1aSopenharmony_ci@end example 268cabdff1aSopenharmony_ci 269cabdff1aSopenharmony_ci@section data 270cabdff1aSopenharmony_ci 271cabdff1aSopenharmony_ciData in-line in the URI. See @url{http://en.wikipedia.org/wiki/Data_URI_scheme}. 272cabdff1aSopenharmony_ci 273cabdff1aSopenharmony_ciFor example, to convert a GIF file given inline with @command{ffmpeg}: 274cabdff1aSopenharmony_ci@example 275cabdff1aSopenharmony_ciffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png 276cabdff1aSopenharmony_ci@end example 277cabdff1aSopenharmony_ci 278cabdff1aSopenharmony_ci@section file 279cabdff1aSopenharmony_ci 280cabdff1aSopenharmony_ciFile access protocol. 281cabdff1aSopenharmony_ci 282cabdff1aSopenharmony_ciRead from or write to a file. 283cabdff1aSopenharmony_ci 284cabdff1aSopenharmony_ciA file URL can have the form: 285cabdff1aSopenharmony_ci@example 286cabdff1aSopenharmony_cifile:@var{filename} 287cabdff1aSopenharmony_ci@end example 288cabdff1aSopenharmony_ci 289cabdff1aSopenharmony_ciwhere @var{filename} is the path of the file to read. 290cabdff1aSopenharmony_ci 291cabdff1aSopenharmony_ciAn URL that does not have a protocol prefix will be assumed to be a 292cabdff1aSopenharmony_cifile URL. Depending on the build, an URL that looks like a Windows 293cabdff1aSopenharmony_cipath with the drive letter at the beginning will also be assumed to be 294cabdff1aSopenharmony_cia file URL (usually not the case in builds for unix-like systems). 295cabdff1aSopenharmony_ci 296cabdff1aSopenharmony_ciFor example to read from a file @file{input.mpeg} with @command{ffmpeg} 297cabdff1aSopenharmony_ciuse the command: 298cabdff1aSopenharmony_ci@example 299cabdff1aSopenharmony_ciffmpeg -i file:input.mpeg output.mpeg 300cabdff1aSopenharmony_ci@end example 301cabdff1aSopenharmony_ci 302cabdff1aSopenharmony_ciThis protocol accepts the following options: 303cabdff1aSopenharmony_ci 304cabdff1aSopenharmony_ci@table @option 305cabdff1aSopenharmony_ci@item truncate 306cabdff1aSopenharmony_ciTruncate existing files on write, if set to 1. A value of 0 prevents 307cabdff1aSopenharmony_citruncating. Default value is 1. 308cabdff1aSopenharmony_ci 309cabdff1aSopenharmony_ci@item blocksize 310cabdff1aSopenharmony_ciSet I/O operation maximum block size, in bytes. Default value is 311cabdff1aSopenharmony_ci@code{INT_MAX}, which results in not limiting the requested block size. 312cabdff1aSopenharmony_ciSetting this value reasonably low improves user termination request reaction 313cabdff1aSopenharmony_citime, which is valuable for files on slow medium. 314cabdff1aSopenharmony_ci 315cabdff1aSopenharmony_ci@item follow 316cabdff1aSopenharmony_ciIf set to 1, the protocol will retry reading at the end of the file, allowing 317cabdff1aSopenharmony_cireading files that still are being written. In order for this to terminate, 318cabdff1aSopenharmony_ciyou either need to use the rw_timeout option, or use the interrupt callback 319cabdff1aSopenharmony_ci(for API users). 320cabdff1aSopenharmony_ci 321cabdff1aSopenharmony_ci@item seekable 322cabdff1aSopenharmony_ciControls if seekability is advertised on the file. 0 means non-seekable, -1 323cabdff1aSopenharmony_cimeans auto (seekable for normal files, non-seekable for named pipes). 324cabdff1aSopenharmony_ci 325cabdff1aSopenharmony_ciMany demuxers handle seekable and non-seekable resources differently, 326cabdff1aSopenharmony_cioverriding this might speed up opening certain files at the cost of losing some 327cabdff1aSopenharmony_cifeatures (e.g. accurate seeking). 328cabdff1aSopenharmony_ci@end table 329cabdff1aSopenharmony_ci 330cabdff1aSopenharmony_ci@section ftp 331cabdff1aSopenharmony_ci 332cabdff1aSopenharmony_ciFTP (File Transfer Protocol). 333cabdff1aSopenharmony_ci 334cabdff1aSopenharmony_ciRead from or write to remote resources using FTP protocol. 335cabdff1aSopenharmony_ci 336cabdff1aSopenharmony_ciFollowing syntax is required. 337cabdff1aSopenharmony_ci@example 338cabdff1aSopenharmony_ciftp://[user[:password]@@]server[:port]/path/to/remote/resource.mpeg 339cabdff1aSopenharmony_ci@end example 340cabdff1aSopenharmony_ci 341cabdff1aSopenharmony_ciThis protocol accepts the following options. 342cabdff1aSopenharmony_ci 343cabdff1aSopenharmony_ci@table @option 344cabdff1aSopenharmony_ci@item timeout 345cabdff1aSopenharmony_ciSet timeout in microseconds of socket I/O operations used by the underlying low level 346cabdff1aSopenharmony_cioperation. By default it is set to -1, which means that the timeout is 347cabdff1aSopenharmony_cinot specified. 348cabdff1aSopenharmony_ci 349cabdff1aSopenharmony_ci@item ftp-user 350cabdff1aSopenharmony_ciSet a user to be used for authenticating to the FTP server. This is overridden by the 351cabdff1aSopenharmony_ciuser in the FTP URL. 352cabdff1aSopenharmony_ci 353cabdff1aSopenharmony_ci@item ftp-password 354cabdff1aSopenharmony_ciSet a password to be used for authenticating to the FTP server. This is overridden by 355cabdff1aSopenharmony_cithe password in the FTP URL, or by @option{ftp-anonymous-password} if no user is set. 356cabdff1aSopenharmony_ci 357cabdff1aSopenharmony_ci@item ftp-anonymous-password 358cabdff1aSopenharmony_ciPassword used when login as anonymous user. Typically an e-mail address 359cabdff1aSopenharmony_cishould be used. 360cabdff1aSopenharmony_ci 361cabdff1aSopenharmony_ci@item ftp-write-seekable 362cabdff1aSopenharmony_ciControl seekability of connection during encoding. If set to 1 the 363cabdff1aSopenharmony_ciresource is supposed to be seekable, if set to 0 it is assumed not 364cabdff1aSopenharmony_cito be seekable. Default value is 0. 365cabdff1aSopenharmony_ci@end table 366cabdff1aSopenharmony_ci 367cabdff1aSopenharmony_ciNOTE: Protocol can be used as output, but it is recommended to not do 368cabdff1aSopenharmony_ciit, unless special care is taken (tests, customized server configuration 369cabdff1aSopenharmony_cietc.). Different FTP servers behave in different way during seek 370cabdff1aSopenharmony_cioperation. ff* tools may produce incomplete content due to server limitations. 371cabdff1aSopenharmony_ci 372cabdff1aSopenharmony_ci@section gopher 373cabdff1aSopenharmony_ci 374cabdff1aSopenharmony_ciGopher protocol. 375cabdff1aSopenharmony_ci 376cabdff1aSopenharmony_ci@section gophers 377cabdff1aSopenharmony_ci 378cabdff1aSopenharmony_ciGophers protocol. 379cabdff1aSopenharmony_ci 380cabdff1aSopenharmony_ciThe Gopher protocol with TLS encapsulation. 381cabdff1aSopenharmony_ci 382cabdff1aSopenharmony_ci@section hls 383cabdff1aSopenharmony_ci 384cabdff1aSopenharmony_ciRead Apple HTTP Live Streaming compliant segmented stream as 385cabdff1aSopenharmony_cia uniform one. The M3U8 playlists describing the segments can be 386cabdff1aSopenharmony_ciremote HTTP resources or local files, accessed using the standard 387cabdff1aSopenharmony_cifile protocol. 388cabdff1aSopenharmony_ciThe nested protocol is declared by specifying 389cabdff1aSopenharmony_ci"+@var{proto}" after the hls URI scheme name, where @var{proto} 390cabdff1aSopenharmony_ciis either "file" or "http". 391cabdff1aSopenharmony_ci 392cabdff1aSopenharmony_ci@example 393cabdff1aSopenharmony_cihls+http://host/path/to/remote/resource.m3u8 394cabdff1aSopenharmony_cihls+file://path/to/local/resource.m3u8 395cabdff1aSopenharmony_ci@end example 396cabdff1aSopenharmony_ci 397cabdff1aSopenharmony_ciUsing this protocol is discouraged - the hls demuxer should work 398cabdff1aSopenharmony_cijust as well (if not, please report the issues) and is more complete. 399cabdff1aSopenharmony_ciTo use the hls demuxer instead, simply use the direct URLs to the 400cabdff1aSopenharmony_cim3u8 files. 401cabdff1aSopenharmony_ci 402cabdff1aSopenharmony_ci@section http 403cabdff1aSopenharmony_ci 404cabdff1aSopenharmony_ciHTTP (Hyper Text Transfer Protocol). 405cabdff1aSopenharmony_ci 406cabdff1aSopenharmony_ciThis protocol accepts the following options: 407cabdff1aSopenharmony_ci 408cabdff1aSopenharmony_ci@table @option 409cabdff1aSopenharmony_ci@item seekable 410cabdff1aSopenharmony_ciControl seekability of connection. If set to 1 the resource is 411cabdff1aSopenharmony_cisupposed to be seekable, if set to 0 it is assumed not to be seekable, 412cabdff1aSopenharmony_ciif set to -1 it will try to autodetect if it is seekable. Default 413cabdff1aSopenharmony_civalue is -1. 414cabdff1aSopenharmony_ci 415cabdff1aSopenharmony_ci@item chunked_post 416cabdff1aSopenharmony_ciIf set to 1 use chunked Transfer-Encoding for posts, default is 1. 417cabdff1aSopenharmony_ci 418cabdff1aSopenharmony_ci@item content_type 419cabdff1aSopenharmony_ciSet a specific content type for the POST messages or for listen mode. 420cabdff1aSopenharmony_ci 421cabdff1aSopenharmony_ci@item http_proxy 422cabdff1aSopenharmony_ciset HTTP proxy to tunnel through e.g. http://example.com:1234 423cabdff1aSopenharmony_ci 424cabdff1aSopenharmony_ci@item headers 425cabdff1aSopenharmony_ciSet custom HTTP headers, can override built in default headers. The 426cabdff1aSopenharmony_civalue must be a string encoding the headers. 427cabdff1aSopenharmony_ci 428cabdff1aSopenharmony_ci@item multiple_requests 429cabdff1aSopenharmony_ciUse persistent connections if set to 1, default is 0. 430cabdff1aSopenharmony_ci 431cabdff1aSopenharmony_ci@item post_data 432cabdff1aSopenharmony_ciSet custom HTTP post data. 433cabdff1aSopenharmony_ci 434cabdff1aSopenharmony_ci@item referer 435cabdff1aSopenharmony_ciSet the Referer header. Include 'Referer: URL' header in HTTP request. 436cabdff1aSopenharmony_ci 437cabdff1aSopenharmony_ci@item user_agent 438cabdff1aSopenharmony_ciOverride the User-Agent header. If not specified the protocol will use a 439cabdff1aSopenharmony_cistring describing the libavformat build. ("Lavf/<version>") 440cabdff1aSopenharmony_ci 441cabdff1aSopenharmony_ci@item reconnect_at_eof 442cabdff1aSopenharmony_ciIf set then eof is treated like an error and causes reconnection, this is useful 443cabdff1aSopenharmony_cifor live / endless streams. 444cabdff1aSopenharmony_ci 445cabdff1aSopenharmony_ci@item reconnect_streamed 446cabdff1aSopenharmony_ciIf set then even streamed/non seekable streams will be reconnected on errors. 447cabdff1aSopenharmony_ci 448cabdff1aSopenharmony_ci@item reconnect_on_network_error 449cabdff1aSopenharmony_ciReconnect automatically in case of TCP/TLS errors during connect. 450cabdff1aSopenharmony_ci 451cabdff1aSopenharmony_ci@item reconnect_on_http_error 452cabdff1aSopenharmony_ciA comma separated list of HTTP status codes to reconnect on. The list can 453cabdff1aSopenharmony_ciinclude specific status codes (e.g. '503') or the strings '4xx' / '5xx'. 454cabdff1aSopenharmony_ci 455cabdff1aSopenharmony_ci@item reconnect_delay_max 456cabdff1aSopenharmony_ciSets the maximum delay in seconds after which to give up reconnecting 457cabdff1aSopenharmony_ci 458cabdff1aSopenharmony_ci@item mime_type 459cabdff1aSopenharmony_ciExport the MIME type. 460cabdff1aSopenharmony_ci 461cabdff1aSopenharmony_ci@item http_version 462cabdff1aSopenharmony_ciExports the HTTP response version number. Usually "1.0" or "1.1". 463cabdff1aSopenharmony_ci 464cabdff1aSopenharmony_ci@item icy 465cabdff1aSopenharmony_ciIf set to 1 request ICY (SHOUTcast) metadata from the server. If the server 466cabdff1aSopenharmony_cisupports this, the metadata has to be retrieved by the application by reading 467cabdff1aSopenharmony_cithe @option{icy_metadata_headers} and @option{icy_metadata_packet} options. 468cabdff1aSopenharmony_ciThe default is 1. 469cabdff1aSopenharmony_ci 470cabdff1aSopenharmony_ci@item icy_metadata_headers 471cabdff1aSopenharmony_ciIf the server supports ICY metadata, this contains the ICY-specific HTTP reply 472cabdff1aSopenharmony_ciheaders, separated by newline characters. 473cabdff1aSopenharmony_ci 474cabdff1aSopenharmony_ci@item icy_metadata_packet 475cabdff1aSopenharmony_ciIf the server supports ICY metadata, and @option{icy} was set to 1, this 476cabdff1aSopenharmony_cicontains the last non-empty metadata packet sent by the server. It should be 477cabdff1aSopenharmony_cipolled in regular intervals by applications interested in mid-stream metadata 478cabdff1aSopenharmony_ciupdates. 479cabdff1aSopenharmony_ci 480cabdff1aSopenharmony_ci@item cookies 481cabdff1aSopenharmony_ciSet the cookies to be sent in future requests. The format of each cookie is the 482cabdff1aSopenharmony_cisame as the value of a Set-Cookie HTTP response field. Multiple cookies can be 483cabdff1aSopenharmony_cidelimited by a newline character. 484cabdff1aSopenharmony_ci 485cabdff1aSopenharmony_ci@item offset 486cabdff1aSopenharmony_ciSet initial byte offset. 487cabdff1aSopenharmony_ci 488cabdff1aSopenharmony_ci@item end_offset 489cabdff1aSopenharmony_ciTry to limit the request to bytes preceding this offset. 490cabdff1aSopenharmony_ci 491cabdff1aSopenharmony_ci@item method 492cabdff1aSopenharmony_ciWhen used as a client option it sets the HTTP method for the request. 493cabdff1aSopenharmony_ci 494cabdff1aSopenharmony_ciWhen used as a server option it sets the HTTP method that is going to be 495cabdff1aSopenharmony_ciexpected from the client(s). 496cabdff1aSopenharmony_ciIf the expected and the received HTTP method do not match the client will 497cabdff1aSopenharmony_cibe given a Bad Request response. 498cabdff1aSopenharmony_ciWhen unset the HTTP method is not checked for now. This will be replaced by 499cabdff1aSopenharmony_ciautodetection in the future. 500cabdff1aSopenharmony_ci 501cabdff1aSopenharmony_ci@item listen 502cabdff1aSopenharmony_ciIf set to 1 enables experimental HTTP server. This can be used to send data when 503cabdff1aSopenharmony_ciused as an output option, or read data from a client with HTTP POST when used as 504cabdff1aSopenharmony_cian input option. 505cabdff1aSopenharmony_ciIf set to 2 enables experimental multi-client HTTP server. This is not yet implemented 506cabdff1aSopenharmony_ciin ffmpeg.c and thus must not be used as a command line option. 507cabdff1aSopenharmony_ci@example 508cabdff1aSopenharmony_ci# Server side (sending): 509cabdff1aSopenharmony_ciffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://@var{server}:@var{port} 510cabdff1aSopenharmony_ci 511cabdff1aSopenharmony_ci# Client side (receiving): 512cabdff1aSopenharmony_ciffmpeg -i http://@var{server}:@var{port} -c copy somefile.ogg 513cabdff1aSopenharmony_ci 514cabdff1aSopenharmony_ci# Client can also be done with wget: 515cabdff1aSopenharmony_ciwget http://@var{server}:@var{port} -O somefile.ogg 516cabdff1aSopenharmony_ci 517cabdff1aSopenharmony_ci# Server side (receiving): 518cabdff1aSopenharmony_ciffmpeg -listen 1 -i http://@var{server}:@var{port} -c copy somefile.ogg 519cabdff1aSopenharmony_ci 520cabdff1aSopenharmony_ci# Client side (sending): 521cabdff1aSopenharmony_ciffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://@var{server}:@var{port} 522cabdff1aSopenharmony_ci 523cabdff1aSopenharmony_ci# Client can also be done with wget: 524cabdff1aSopenharmony_ciwget --post-file=somefile.ogg http://@var{server}:@var{port} 525cabdff1aSopenharmony_ci@end example 526cabdff1aSopenharmony_ci 527cabdff1aSopenharmony_ci@item send_expect_100 528cabdff1aSopenharmony_ciSend an Expect: 100-continue header for POST. If set to 1 it will send, if set 529cabdff1aSopenharmony_cito 0 it won't, if set to -1 it will try to send if it is applicable. Default 530cabdff1aSopenharmony_civalue is -1. 531cabdff1aSopenharmony_ci 532cabdff1aSopenharmony_ci@item auth_type 533cabdff1aSopenharmony_ci 534cabdff1aSopenharmony_ciSet HTTP authentication type. No option for Digest, since this method requires 535cabdff1aSopenharmony_cigetting nonce parameters from the server first and can't be used straight away like 536cabdff1aSopenharmony_ciBasic. 537cabdff1aSopenharmony_ci 538cabdff1aSopenharmony_ci@table @option 539cabdff1aSopenharmony_ci@item none 540cabdff1aSopenharmony_ciChoose the HTTP authentication type automatically. This is the default. 541cabdff1aSopenharmony_ci@item basic 542cabdff1aSopenharmony_ci 543cabdff1aSopenharmony_ciChoose the HTTP basic authentication. 544cabdff1aSopenharmony_ci 545cabdff1aSopenharmony_ciBasic authentication sends a Base64-encoded string that contains a user name and password 546cabdff1aSopenharmony_cifor the client. Base64 is not a form of encryption and should be considered the same as 547cabdff1aSopenharmony_cisending the user name and password in clear text (Base64 is a reversible encoding). 548cabdff1aSopenharmony_ciIf a resource needs to be protected, strongly consider using an authentication scheme 549cabdff1aSopenharmony_ciother than basic authentication. HTTPS/TLS should be used with basic authentication. 550cabdff1aSopenharmony_ciWithout these additional security enhancements, basic authentication should not be used 551cabdff1aSopenharmony_cito protect sensitive or valuable information. 552cabdff1aSopenharmony_ci@end table 553cabdff1aSopenharmony_ci 554cabdff1aSopenharmony_ci@end table 555cabdff1aSopenharmony_ci 556cabdff1aSopenharmony_ci@subsection HTTP Cookies 557cabdff1aSopenharmony_ci 558cabdff1aSopenharmony_ciSome HTTP requests will be denied unless cookie values are passed in with the 559cabdff1aSopenharmony_cirequest. The @option{cookies} option allows these cookies to be specified. At 560cabdff1aSopenharmony_cithe very least, each cookie must specify a value along with a path and domain. 561cabdff1aSopenharmony_ciHTTP requests that match both the domain and path will automatically include the 562cabdff1aSopenharmony_cicookie value in the HTTP Cookie header field. Multiple cookies can be delimited 563cabdff1aSopenharmony_ciby a newline. 564cabdff1aSopenharmony_ci 565cabdff1aSopenharmony_ciThe required syntax to play a stream specifying a cookie is: 566cabdff1aSopenharmony_ci@example 567cabdff1aSopenharmony_ciffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8 568cabdff1aSopenharmony_ci@end example 569cabdff1aSopenharmony_ci 570cabdff1aSopenharmony_ci@section Icecast 571cabdff1aSopenharmony_ci 572cabdff1aSopenharmony_ciIcecast protocol (stream to Icecast servers) 573cabdff1aSopenharmony_ci 574cabdff1aSopenharmony_ciThis protocol accepts the following options: 575cabdff1aSopenharmony_ci 576cabdff1aSopenharmony_ci@table @option 577cabdff1aSopenharmony_ci@item ice_genre 578cabdff1aSopenharmony_ciSet the stream genre. 579cabdff1aSopenharmony_ci 580cabdff1aSopenharmony_ci@item ice_name 581cabdff1aSopenharmony_ciSet the stream name. 582cabdff1aSopenharmony_ci 583cabdff1aSopenharmony_ci@item ice_description 584cabdff1aSopenharmony_ciSet the stream description. 585cabdff1aSopenharmony_ci 586cabdff1aSopenharmony_ci@item ice_url 587cabdff1aSopenharmony_ciSet the stream website URL. 588cabdff1aSopenharmony_ci 589cabdff1aSopenharmony_ci@item ice_public 590cabdff1aSopenharmony_ciSet if the stream should be public. 591cabdff1aSopenharmony_ciThe default is 0 (not public). 592cabdff1aSopenharmony_ci 593cabdff1aSopenharmony_ci@item user_agent 594cabdff1aSopenharmony_ciOverride the User-Agent header. If not specified a string of the form 595cabdff1aSopenharmony_ci"Lavf/<version>" will be used. 596cabdff1aSopenharmony_ci 597cabdff1aSopenharmony_ci@item password 598cabdff1aSopenharmony_ciSet the Icecast mountpoint password. 599cabdff1aSopenharmony_ci 600cabdff1aSopenharmony_ci@item content_type 601cabdff1aSopenharmony_ciSet the stream content type. This must be set if it is different from 602cabdff1aSopenharmony_ciaudio/mpeg. 603cabdff1aSopenharmony_ci 604cabdff1aSopenharmony_ci@item legacy_icecast 605cabdff1aSopenharmony_ciThis enables support for Icecast versions < 2.4.0, that do not support the 606cabdff1aSopenharmony_ciHTTP PUT method but the SOURCE method. 607cabdff1aSopenharmony_ci 608cabdff1aSopenharmony_ci@item tls 609cabdff1aSopenharmony_ciEstablish a TLS (HTTPS) connection to Icecast. 610cabdff1aSopenharmony_ci 611cabdff1aSopenharmony_ci@end table 612cabdff1aSopenharmony_ci 613cabdff1aSopenharmony_ci@example 614cabdff1aSopenharmony_ciicecast://[@var{username}[:@var{password}]@@]@var{server}:@var{port}/@var{mountpoint} 615cabdff1aSopenharmony_ci@end example 616cabdff1aSopenharmony_ci 617cabdff1aSopenharmony_ci@section ipfs 618cabdff1aSopenharmony_ci 619cabdff1aSopenharmony_ciInterPlanetary File System (IPFS) protocol support. One can access files stored 620cabdff1aSopenharmony_cion the IPFS network through so-called gateways. These are http(s) endpoints. 621cabdff1aSopenharmony_ciThis protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be sent 622cabdff1aSopenharmony_cito such a gateway. Users can (and should) host their own node which means this 623cabdff1aSopenharmony_ciprotocol will use one's local gateway to access files on the IPFS network. 624cabdff1aSopenharmony_ci 625cabdff1aSopenharmony_ciIf a user doesn't have a node of their own then the public gateway @code{https://dweb.link} 626cabdff1aSopenharmony_ciis used by default. 627cabdff1aSopenharmony_ci 628cabdff1aSopenharmony_ciThis protocol accepts the following options: 629cabdff1aSopenharmony_ci 630cabdff1aSopenharmony_ci@table @option 631cabdff1aSopenharmony_ci 632cabdff1aSopenharmony_ci@item gateway 633cabdff1aSopenharmony_ciDefines the gateway to use. When not set, the protocol will first try 634cabdff1aSopenharmony_cilocating the local gateway by looking at @code{$IPFS_GATEWAY}, @code{$IPFS_PATH} 635cabdff1aSopenharmony_ciand @code{$HOME/.ipfs/}, in that order. If that fails @code{https://dweb.link} will be used. 636cabdff1aSopenharmony_ci 637cabdff1aSopenharmony_ci@end table 638cabdff1aSopenharmony_ci 639cabdff1aSopenharmony_ciOne can use this protocol in 2 ways. Using IPFS: 640cabdff1aSopenharmony_ci@example 641cabdff1aSopenharmony_ciffplay ipfs://QmbGtJg23skhvFmu9mJiePVByhfzu5rwo74MEkVDYAmF5T 642cabdff1aSopenharmony_ci@end example 643cabdff1aSopenharmony_ci 644cabdff1aSopenharmony_ciOr the IPNS protocol (IPNS is mutable IPFS): 645cabdff1aSopenharmony_ci@example 646cabdff1aSopenharmony_ciffplay ipns://QmbGtJg23skhvFmu9mJiePVByhfzu5rwo74MEkVDYAmF5T 647cabdff1aSopenharmony_ci@end example 648cabdff1aSopenharmony_ci 649cabdff1aSopenharmony_ci@section mmst 650cabdff1aSopenharmony_ci 651cabdff1aSopenharmony_ciMMS (Microsoft Media Server) protocol over TCP. 652cabdff1aSopenharmony_ci 653cabdff1aSopenharmony_ci@section mmsh 654cabdff1aSopenharmony_ci 655cabdff1aSopenharmony_ciMMS (Microsoft Media Server) protocol over HTTP. 656cabdff1aSopenharmony_ci 657cabdff1aSopenharmony_ciThe required syntax is: 658cabdff1aSopenharmony_ci@example 659cabdff1aSopenharmony_cimmsh://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] 660cabdff1aSopenharmony_ci@end example 661cabdff1aSopenharmony_ci 662cabdff1aSopenharmony_ci@section md5 663cabdff1aSopenharmony_ci 664cabdff1aSopenharmony_ciMD5 output protocol. 665cabdff1aSopenharmony_ci 666cabdff1aSopenharmony_ciComputes the MD5 hash of the data to be written, and on close writes 667cabdff1aSopenharmony_cithis to the designated output or stdout if none is specified. It can 668cabdff1aSopenharmony_cibe used to test muxers without writing an actual file. 669cabdff1aSopenharmony_ci 670cabdff1aSopenharmony_ciSome examples follow. 671cabdff1aSopenharmony_ci@example 672cabdff1aSopenharmony_ci# Write the MD5 hash of the encoded AVI file to the file output.avi.md5. 673cabdff1aSopenharmony_ciffmpeg -i input.flv -f avi -y md5:output.avi.md5 674cabdff1aSopenharmony_ci 675cabdff1aSopenharmony_ci# Write the MD5 hash of the encoded AVI file to stdout. 676cabdff1aSopenharmony_ciffmpeg -i input.flv -f avi -y md5: 677cabdff1aSopenharmony_ci@end example 678cabdff1aSopenharmony_ci 679cabdff1aSopenharmony_ciNote that some formats (typically MOV) require the output protocol to 680cabdff1aSopenharmony_cibe seekable, so they will fail with the MD5 output protocol. 681cabdff1aSopenharmony_ci 682cabdff1aSopenharmony_ci@section pipe 683cabdff1aSopenharmony_ci 684cabdff1aSopenharmony_ciUNIX pipe access protocol. 685cabdff1aSopenharmony_ci 686cabdff1aSopenharmony_ciRead and write from UNIX pipes. 687cabdff1aSopenharmony_ci 688cabdff1aSopenharmony_ciThe accepted syntax is: 689cabdff1aSopenharmony_ci@example 690cabdff1aSopenharmony_cipipe:[@var{number}] 691cabdff1aSopenharmony_ci@end example 692cabdff1aSopenharmony_ci 693cabdff1aSopenharmony_ci@var{number} is the number corresponding to the file descriptor of the 694cabdff1aSopenharmony_cipipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If @var{number} 695cabdff1aSopenharmony_ciis not specified, by default the stdout file descriptor will be used 696cabdff1aSopenharmony_cifor writing, stdin for reading. 697cabdff1aSopenharmony_ci 698cabdff1aSopenharmony_ciFor example to read from stdin with @command{ffmpeg}: 699cabdff1aSopenharmony_ci@example 700cabdff1aSopenharmony_cicat test.wav | ffmpeg -i pipe:0 701cabdff1aSopenharmony_ci# ...this is the same as... 702cabdff1aSopenharmony_cicat test.wav | ffmpeg -i pipe: 703cabdff1aSopenharmony_ci@end example 704cabdff1aSopenharmony_ci 705cabdff1aSopenharmony_ciFor writing to stdout with @command{ffmpeg}: 706cabdff1aSopenharmony_ci@example 707cabdff1aSopenharmony_ciffmpeg -i test.wav -f avi pipe:1 | cat > test.avi 708cabdff1aSopenharmony_ci# ...this is the same as... 709cabdff1aSopenharmony_ciffmpeg -i test.wav -f avi pipe: | cat > test.avi 710cabdff1aSopenharmony_ci@end example 711cabdff1aSopenharmony_ci 712cabdff1aSopenharmony_ciThis protocol accepts the following options: 713cabdff1aSopenharmony_ci 714cabdff1aSopenharmony_ci@table @option 715cabdff1aSopenharmony_ci@item blocksize 716cabdff1aSopenharmony_ciSet I/O operation maximum block size, in bytes. Default value is 717cabdff1aSopenharmony_ci@code{INT_MAX}, which results in not limiting the requested block size. 718cabdff1aSopenharmony_ciSetting this value reasonably low improves user termination request reaction 719cabdff1aSopenharmony_citime, which is valuable if data transmission is slow. 720cabdff1aSopenharmony_ci@end table 721cabdff1aSopenharmony_ci 722cabdff1aSopenharmony_ciNote that some formats (typically MOV), require the output protocol to 723cabdff1aSopenharmony_cibe seekable, so they will fail with the pipe output protocol. 724cabdff1aSopenharmony_ci 725cabdff1aSopenharmony_ci@section prompeg 726cabdff1aSopenharmony_ci 727cabdff1aSopenharmony_ciPro-MPEG Code of Practice #3 Release 2 FEC protocol. 728cabdff1aSopenharmony_ci 729cabdff1aSopenharmony_ciThe Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism 730cabdff1aSopenharmony_cifor MPEG-2 Transport Streams sent over RTP. 731cabdff1aSopenharmony_ci 732cabdff1aSopenharmony_ciThis protocol must be used in conjunction with the @code{rtp_mpegts} muxer and 733cabdff1aSopenharmony_cithe @code{rtp} protocol. 734cabdff1aSopenharmony_ci 735cabdff1aSopenharmony_ciThe required syntax is: 736cabdff1aSopenharmony_ci@example 737cabdff1aSopenharmony_ci-f rtp_mpegts -fec prompeg=@var{option}=@var{val}... rtp://@var{hostname}:@var{port} 738cabdff1aSopenharmony_ci@end example 739cabdff1aSopenharmony_ci 740cabdff1aSopenharmony_ciThe destination UDP ports are @code{port + 2} for the column FEC stream 741cabdff1aSopenharmony_ciand @code{port + 4} for the row FEC stream. 742cabdff1aSopenharmony_ci 743cabdff1aSopenharmony_ciThis protocol accepts the following options: 744cabdff1aSopenharmony_ci@table @option 745cabdff1aSopenharmony_ci 746cabdff1aSopenharmony_ci@item l=@var{n} 747cabdff1aSopenharmony_ciThe number of columns (4-20, LxD <= 100) 748cabdff1aSopenharmony_ci 749cabdff1aSopenharmony_ci@item d=@var{n} 750cabdff1aSopenharmony_ciThe number of rows (4-20, LxD <= 100) 751cabdff1aSopenharmony_ci 752cabdff1aSopenharmony_ci@end table 753cabdff1aSopenharmony_ci 754cabdff1aSopenharmony_ciExample usage: 755cabdff1aSopenharmony_ci 756cabdff1aSopenharmony_ci@example 757cabdff1aSopenharmony_ci-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://@var{hostname}:@var{port} 758cabdff1aSopenharmony_ci@end example 759cabdff1aSopenharmony_ci 760cabdff1aSopenharmony_ci@section rist 761cabdff1aSopenharmony_ci 762cabdff1aSopenharmony_ciReliable Internet Streaming Transport protocol 763cabdff1aSopenharmony_ci 764cabdff1aSopenharmony_ciThe accepted options are: 765cabdff1aSopenharmony_ci@table @option 766cabdff1aSopenharmony_ci@item rist_profile 767cabdff1aSopenharmony_ciSupported values: 768cabdff1aSopenharmony_ci@table @samp 769cabdff1aSopenharmony_ci@item simple 770cabdff1aSopenharmony_ci@item main 771cabdff1aSopenharmony_ciThis one is default. 772cabdff1aSopenharmony_ci@item advanced 773cabdff1aSopenharmony_ci@end table 774cabdff1aSopenharmony_ci 775cabdff1aSopenharmony_ci@item buffer_size 776cabdff1aSopenharmony_ciSet internal RIST buffer size in milliseconds for retransmission of data. 777cabdff1aSopenharmony_ciDefault value is 0 which means the librist default (1 sec). Maximum value is 30 778cabdff1aSopenharmony_ciseconds. 779cabdff1aSopenharmony_ci 780cabdff1aSopenharmony_ci@item fifo_size 781cabdff1aSopenharmony_ciSize of the librist receiver output fifo in number of packets. This must be a 782cabdff1aSopenharmony_cipower of 2. 783cabdff1aSopenharmony_ciDefaults to 8192 (vs the librist default of 1024). 784cabdff1aSopenharmony_ci 785cabdff1aSopenharmony_ci@item overrun_nonfatal=@var{1|0} 786cabdff1aSopenharmony_ciSurvive in case of librist fifo buffer overrun. Default value is 0. 787cabdff1aSopenharmony_ci 788cabdff1aSopenharmony_ci@item pkt_size 789cabdff1aSopenharmony_ciSet maximum packet size for sending data. 1316 by default. 790cabdff1aSopenharmony_ci 791cabdff1aSopenharmony_ci@item log_level 792cabdff1aSopenharmony_ciSet loglevel for RIST logging messages. You only need to set this if you 793cabdff1aSopenharmony_ciexplicitly want to enable debug level messages or packet loss simulation, 794cabdff1aSopenharmony_ciotherwise the regular loglevel is respected. 795cabdff1aSopenharmony_ci 796cabdff1aSopenharmony_ci@item secret 797cabdff1aSopenharmony_ciSet override of encryption secret, by default is unset. 798cabdff1aSopenharmony_ci 799cabdff1aSopenharmony_ci@item encryption 800cabdff1aSopenharmony_ciSet encryption type, by default is disabled. 801cabdff1aSopenharmony_ciAcceptable values are 128 and 256. 802cabdff1aSopenharmony_ci@end table 803cabdff1aSopenharmony_ci 804cabdff1aSopenharmony_ci@section rtmp 805cabdff1aSopenharmony_ci 806cabdff1aSopenharmony_ciReal-Time Messaging Protocol. 807cabdff1aSopenharmony_ci 808cabdff1aSopenharmony_ciThe Real-Time Messaging Protocol (RTMP) is used for streaming multimedia 809cabdff1aSopenharmony_cicontent across a TCP/IP network. 810cabdff1aSopenharmony_ci 811cabdff1aSopenharmony_ciThe required syntax is: 812cabdff1aSopenharmony_ci@example 813cabdff1aSopenharmony_cirtmp://[@var{username}:@var{password}@@]@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}] 814cabdff1aSopenharmony_ci@end example 815cabdff1aSopenharmony_ci 816cabdff1aSopenharmony_ciThe accepted parameters are: 817cabdff1aSopenharmony_ci@table @option 818cabdff1aSopenharmony_ci 819cabdff1aSopenharmony_ci@item username 820cabdff1aSopenharmony_ciAn optional username (mostly for publishing). 821cabdff1aSopenharmony_ci 822cabdff1aSopenharmony_ci@item password 823cabdff1aSopenharmony_ciAn optional password (mostly for publishing). 824cabdff1aSopenharmony_ci 825cabdff1aSopenharmony_ci@item server 826cabdff1aSopenharmony_ciThe address of the RTMP server. 827cabdff1aSopenharmony_ci 828cabdff1aSopenharmony_ci@item port 829cabdff1aSopenharmony_ciThe number of the TCP port to use (by default is 1935). 830cabdff1aSopenharmony_ci 831cabdff1aSopenharmony_ci@item app 832cabdff1aSopenharmony_ciIt is the name of the application to access. It usually corresponds to 833cabdff1aSopenharmony_cithe path where the application is installed on the RTMP server 834cabdff1aSopenharmony_ci(e.g. @file{/ondemand/}, @file{/flash/live/}, etc.). You can override 835cabdff1aSopenharmony_cithe value parsed from the URI through the @code{rtmp_app} option, too. 836cabdff1aSopenharmony_ci 837cabdff1aSopenharmony_ci@item playpath 838cabdff1aSopenharmony_ciIt is the path or name of the resource to play with reference to the 839cabdff1aSopenharmony_ciapplication specified in @var{app}, may be prefixed by "mp4:". You 840cabdff1aSopenharmony_cican override the value parsed from the URI through the @code{rtmp_playpath} 841cabdff1aSopenharmony_cioption, too. 842cabdff1aSopenharmony_ci 843cabdff1aSopenharmony_ci@item listen 844cabdff1aSopenharmony_ciAct as a server, listening for an incoming connection. 845cabdff1aSopenharmony_ci 846cabdff1aSopenharmony_ci@item timeout 847cabdff1aSopenharmony_ciMaximum time to wait for the incoming connection. Implies listen. 848cabdff1aSopenharmony_ci@end table 849cabdff1aSopenharmony_ci 850cabdff1aSopenharmony_ciAdditionally, the following parameters can be set via command line options 851cabdff1aSopenharmony_ci(or in code via @code{AVOption}s): 852cabdff1aSopenharmony_ci@table @option 853cabdff1aSopenharmony_ci 854cabdff1aSopenharmony_ci@item rtmp_app 855cabdff1aSopenharmony_ciName of application to connect on the RTMP server. This option 856cabdff1aSopenharmony_cioverrides the parameter specified in the URI. 857cabdff1aSopenharmony_ci 858cabdff1aSopenharmony_ci@item rtmp_buffer 859cabdff1aSopenharmony_ciSet the client buffer time in milliseconds. The default is 3000. 860cabdff1aSopenharmony_ci 861cabdff1aSopenharmony_ci@item rtmp_conn 862cabdff1aSopenharmony_ciExtra arbitrary AMF connection parameters, parsed from a string, 863cabdff1aSopenharmony_cie.g. like @code{B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0}. 864cabdff1aSopenharmony_ciEach value is prefixed by a single character denoting the type, 865cabdff1aSopenharmony_ciB for Boolean, N for number, S for string, O for object, or Z for null, 866cabdff1aSopenharmony_cifollowed by a colon. For Booleans the data must be either 0 or 1 for 867cabdff1aSopenharmony_ciFALSE or TRUE, respectively. Likewise for Objects the data must be 0 or 868cabdff1aSopenharmony_ci1 to end or begin an object, respectively. Data items in subobjects may 869cabdff1aSopenharmony_cibe named, by prefixing the type with 'N' and specifying the name before 870cabdff1aSopenharmony_cithe value (i.e. @code{NB:myFlag:1}). This option may be used multiple 871cabdff1aSopenharmony_citimes to construct arbitrary AMF sequences. 872cabdff1aSopenharmony_ci 873cabdff1aSopenharmony_ci@item rtmp_flashver 874cabdff1aSopenharmony_ciVersion of the Flash plugin used to run the SWF player. The default 875cabdff1aSopenharmony_ciis LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible; 876cabdff1aSopenharmony_ci<libavformat version>).) 877cabdff1aSopenharmony_ci 878cabdff1aSopenharmony_ci@item rtmp_flush_interval 879cabdff1aSopenharmony_ciNumber of packets flushed in the same request (RTMPT only). The default 880cabdff1aSopenharmony_ciis 10. 881cabdff1aSopenharmony_ci 882cabdff1aSopenharmony_ci@item rtmp_live 883cabdff1aSopenharmony_ciSpecify that the media is a live stream. No resuming or seeking in 884cabdff1aSopenharmony_cilive streams is possible. The default value is @code{any}, which means the 885cabdff1aSopenharmony_cisubscriber first tries to play the live stream specified in the 886cabdff1aSopenharmony_ciplaypath. If a live stream of that name is not found, it plays the 887cabdff1aSopenharmony_cirecorded stream. The other possible values are @code{live} and 888cabdff1aSopenharmony_ci@code{recorded}. 889cabdff1aSopenharmony_ci 890cabdff1aSopenharmony_ci@item rtmp_pageurl 891cabdff1aSopenharmony_ciURL of the web page in which the media was embedded. By default no 892cabdff1aSopenharmony_civalue will be sent. 893cabdff1aSopenharmony_ci 894cabdff1aSopenharmony_ci@item rtmp_playpath 895cabdff1aSopenharmony_ciStream identifier to play or to publish. This option overrides the 896cabdff1aSopenharmony_ciparameter specified in the URI. 897cabdff1aSopenharmony_ci 898cabdff1aSopenharmony_ci@item rtmp_subscribe 899cabdff1aSopenharmony_ciName of live stream to subscribe to. By default no value will be sent. 900cabdff1aSopenharmony_ciIt is only sent if the option is specified or if rtmp_live 901cabdff1aSopenharmony_ciis set to live. 902cabdff1aSopenharmony_ci 903cabdff1aSopenharmony_ci@item rtmp_swfhash 904cabdff1aSopenharmony_ciSHA256 hash of the decompressed SWF file (32 bytes). 905cabdff1aSopenharmony_ci 906cabdff1aSopenharmony_ci@item rtmp_swfsize 907cabdff1aSopenharmony_ciSize of the decompressed SWF file, required for SWFVerification. 908cabdff1aSopenharmony_ci 909cabdff1aSopenharmony_ci@item rtmp_swfurl 910cabdff1aSopenharmony_ciURL of the SWF player for the media. By default no value will be sent. 911cabdff1aSopenharmony_ci 912cabdff1aSopenharmony_ci@item rtmp_swfverify 913cabdff1aSopenharmony_ciURL to player swf file, compute hash/size automatically. 914cabdff1aSopenharmony_ci 915cabdff1aSopenharmony_ci@item rtmp_tcurl 916cabdff1aSopenharmony_ciURL of the target stream. Defaults to proto://host[:port]/app. 917cabdff1aSopenharmony_ci 918cabdff1aSopenharmony_ci@item tcp_nodelay=@var{1|0} 919cabdff1aSopenharmony_ciSet TCP_NODELAY to disable Nagle's algorithm. Default value is 0. 920cabdff1aSopenharmony_ci 921cabdff1aSopenharmony_ci@emph{Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY.} 922cabdff1aSopenharmony_ci 923cabdff1aSopenharmony_ci@end table 924cabdff1aSopenharmony_ci 925cabdff1aSopenharmony_ciFor example to read with @command{ffplay} a multimedia resource named 926cabdff1aSopenharmony_ci"sample" from the application "vod" from an RTMP server "myserver": 927cabdff1aSopenharmony_ci@example 928cabdff1aSopenharmony_ciffplay rtmp://myserver/vod/sample 929cabdff1aSopenharmony_ci@end example 930cabdff1aSopenharmony_ci 931cabdff1aSopenharmony_ciTo publish to a password protected server, passing the playpath and 932cabdff1aSopenharmony_ciapp names separately: 933cabdff1aSopenharmony_ci@example 934cabdff1aSopenharmony_ciffmpeg -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@@myserver/ 935cabdff1aSopenharmony_ci@end example 936cabdff1aSopenharmony_ci 937cabdff1aSopenharmony_ci@section rtmpe 938cabdff1aSopenharmony_ci 939cabdff1aSopenharmony_ciEncrypted Real-Time Messaging Protocol. 940cabdff1aSopenharmony_ci 941cabdff1aSopenharmony_ciThe Encrypted Real-Time Messaging Protocol (RTMPE) is used for 942cabdff1aSopenharmony_cistreaming multimedia content within standard cryptographic primitives, 943cabdff1aSopenharmony_ciconsisting of Diffie-Hellman key exchange and HMACSHA256, generating 944cabdff1aSopenharmony_cia pair of RC4 keys. 945cabdff1aSopenharmony_ci 946cabdff1aSopenharmony_ci@section rtmps 947cabdff1aSopenharmony_ci 948cabdff1aSopenharmony_ciReal-Time Messaging Protocol over a secure SSL connection. 949cabdff1aSopenharmony_ci 950cabdff1aSopenharmony_ciThe Real-Time Messaging Protocol (RTMPS) is used for streaming 951cabdff1aSopenharmony_cimultimedia content across an encrypted connection. 952cabdff1aSopenharmony_ci 953cabdff1aSopenharmony_ci@section rtmpt 954cabdff1aSopenharmony_ci 955cabdff1aSopenharmony_ciReal-Time Messaging Protocol tunneled through HTTP. 956cabdff1aSopenharmony_ci 957cabdff1aSopenharmony_ciThe Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used 958cabdff1aSopenharmony_cifor streaming multimedia content within HTTP requests to traverse 959cabdff1aSopenharmony_cifirewalls. 960cabdff1aSopenharmony_ci 961cabdff1aSopenharmony_ci@section rtmpte 962cabdff1aSopenharmony_ci 963cabdff1aSopenharmony_ciEncrypted Real-Time Messaging Protocol tunneled through HTTP. 964cabdff1aSopenharmony_ci 965cabdff1aSopenharmony_ciThe Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE) 966cabdff1aSopenharmony_ciis used for streaming multimedia content within HTTP requests to traverse 967cabdff1aSopenharmony_cifirewalls. 968cabdff1aSopenharmony_ci 969cabdff1aSopenharmony_ci@section rtmpts 970cabdff1aSopenharmony_ci 971cabdff1aSopenharmony_ciReal-Time Messaging Protocol tunneled through HTTPS. 972cabdff1aSopenharmony_ci 973cabdff1aSopenharmony_ciThe Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used 974cabdff1aSopenharmony_cifor streaming multimedia content within HTTPS requests to traverse 975cabdff1aSopenharmony_cifirewalls. 976cabdff1aSopenharmony_ci 977cabdff1aSopenharmony_ci@section libsmbclient 978cabdff1aSopenharmony_ci 979cabdff1aSopenharmony_cilibsmbclient permits one to manipulate CIFS/SMB network resources. 980cabdff1aSopenharmony_ci 981cabdff1aSopenharmony_ciFollowing syntax is required. 982cabdff1aSopenharmony_ci 983cabdff1aSopenharmony_ci@example 984cabdff1aSopenharmony_cismb://[[domain:]user[:password@@]]server[/share[/path[/file]]] 985cabdff1aSopenharmony_ci@end example 986cabdff1aSopenharmony_ci 987cabdff1aSopenharmony_ciThis protocol accepts the following options. 988cabdff1aSopenharmony_ci 989cabdff1aSopenharmony_ci@table @option 990cabdff1aSopenharmony_ci@item timeout 991cabdff1aSopenharmony_ciSet timeout in milliseconds of socket I/O operations used by the underlying 992cabdff1aSopenharmony_cilow level operation. By default it is set to -1, which means that the timeout 993cabdff1aSopenharmony_ciis not specified. 994cabdff1aSopenharmony_ci 995cabdff1aSopenharmony_ci@item truncate 996cabdff1aSopenharmony_ciTruncate existing files on write, if set to 1. A value of 0 prevents 997cabdff1aSopenharmony_citruncating. Default value is 1. 998cabdff1aSopenharmony_ci 999cabdff1aSopenharmony_ci@item workgroup 1000cabdff1aSopenharmony_ciSet the workgroup used for making connections. By default workgroup is not specified. 1001cabdff1aSopenharmony_ci 1002cabdff1aSopenharmony_ci@end table 1003cabdff1aSopenharmony_ci 1004cabdff1aSopenharmony_ciFor more information see: @url{http://www.samba.org/}. 1005cabdff1aSopenharmony_ci 1006cabdff1aSopenharmony_ci@section libssh 1007cabdff1aSopenharmony_ci 1008cabdff1aSopenharmony_ciSecure File Transfer Protocol via libssh 1009cabdff1aSopenharmony_ci 1010cabdff1aSopenharmony_ciRead from or write to remote resources using SFTP protocol. 1011cabdff1aSopenharmony_ci 1012cabdff1aSopenharmony_ciFollowing syntax is required. 1013cabdff1aSopenharmony_ci 1014cabdff1aSopenharmony_ci@example 1015cabdff1aSopenharmony_cisftp://[user[:password]@@]server[:port]/path/to/remote/resource.mpeg 1016cabdff1aSopenharmony_ci@end example 1017cabdff1aSopenharmony_ci 1018cabdff1aSopenharmony_ciThis protocol accepts the following options. 1019cabdff1aSopenharmony_ci 1020cabdff1aSopenharmony_ci@table @option 1021cabdff1aSopenharmony_ci@item timeout 1022cabdff1aSopenharmony_ciSet timeout of socket I/O operations used by the underlying low level 1023cabdff1aSopenharmony_cioperation. By default it is set to -1, which means that the timeout 1024cabdff1aSopenharmony_ciis not specified. 1025cabdff1aSopenharmony_ci 1026cabdff1aSopenharmony_ci@item truncate 1027cabdff1aSopenharmony_ciTruncate existing files on write, if set to 1. A value of 0 prevents 1028cabdff1aSopenharmony_citruncating. Default value is 1. 1029cabdff1aSopenharmony_ci 1030cabdff1aSopenharmony_ci@item private_key 1031cabdff1aSopenharmony_ciSpecify the path of the file containing private key to use during authorization. 1032cabdff1aSopenharmony_ciBy default libssh searches for keys in the @file{~/.ssh/} directory. 1033cabdff1aSopenharmony_ci 1034cabdff1aSopenharmony_ci@end table 1035cabdff1aSopenharmony_ci 1036cabdff1aSopenharmony_ciExample: Play a file stored on remote server. 1037cabdff1aSopenharmony_ci 1038cabdff1aSopenharmony_ci@example 1039cabdff1aSopenharmony_ciffplay sftp://user:password@@server_address:22/home/user/resource.mpeg 1040cabdff1aSopenharmony_ci@end example 1041cabdff1aSopenharmony_ci 1042cabdff1aSopenharmony_ci@section librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte 1043cabdff1aSopenharmony_ci 1044cabdff1aSopenharmony_ciReal-Time Messaging Protocol and its variants supported through 1045cabdff1aSopenharmony_cilibrtmp. 1046cabdff1aSopenharmony_ci 1047cabdff1aSopenharmony_ciRequires the presence of the librtmp headers and library during 1048cabdff1aSopenharmony_ciconfiguration. You need to explicitly configure the build with 1049cabdff1aSopenharmony_ci"--enable-librtmp". If enabled this will replace the native RTMP 1050cabdff1aSopenharmony_ciprotocol. 1051cabdff1aSopenharmony_ci 1052cabdff1aSopenharmony_ciThis protocol provides most client functions and a few server 1053cabdff1aSopenharmony_cifunctions needed to support RTMP, RTMP tunneled in HTTP (RTMPT), 1054cabdff1aSopenharmony_ciencrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled 1055cabdff1aSopenharmony_civariants of these encrypted types (RTMPTE, RTMPTS). 1056cabdff1aSopenharmony_ci 1057cabdff1aSopenharmony_ciThe required syntax is: 1058cabdff1aSopenharmony_ci@example 1059cabdff1aSopenharmony_ci@var{rtmp_proto}://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] @var{options} 1060cabdff1aSopenharmony_ci@end example 1061cabdff1aSopenharmony_ci 1062cabdff1aSopenharmony_ciwhere @var{rtmp_proto} is one of the strings "rtmp", "rtmpt", "rtmpe", 1063cabdff1aSopenharmony_ci"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and 1064cabdff1aSopenharmony_ci@var{server}, @var{port}, @var{app} and @var{playpath} have the same 1065cabdff1aSopenharmony_cimeaning as specified for the RTMP native protocol. 1066cabdff1aSopenharmony_ci@var{options} contains a list of space-separated options of the form 1067cabdff1aSopenharmony_ci@var{key}=@var{val}. 1068cabdff1aSopenharmony_ci 1069cabdff1aSopenharmony_ciSee the librtmp manual page (man 3 librtmp) for more information. 1070cabdff1aSopenharmony_ci 1071cabdff1aSopenharmony_ciFor example, to stream a file in real-time to an RTMP server using 1072cabdff1aSopenharmony_ci@command{ffmpeg}: 1073cabdff1aSopenharmony_ci@example 1074cabdff1aSopenharmony_ciffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream 1075cabdff1aSopenharmony_ci@end example 1076cabdff1aSopenharmony_ci 1077cabdff1aSopenharmony_ciTo play the same stream using @command{ffplay}: 1078cabdff1aSopenharmony_ci@example 1079cabdff1aSopenharmony_ciffplay "rtmp://myserver/live/mystream live=1" 1080cabdff1aSopenharmony_ci@end example 1081cabdff1aSopenharmony_ci 1082cabdff1aSopenharmony_ci@section rtp 1083cabdff1aSopenharmony_ci 1084cabdff1aSopenharmony_ciReal-time Transport Protocol. 1085cabdff1aSopenharmony_ci 1086cabdff1aSopenharmony_ciThe required syntax for an RTP URL is: 1087cabdff1aSopenharmony_cirtp://@var{hostname}[:@var{port}][?@var{option}=@var{val}...] 1088cabdff1aSopenharmony_ci 1089cabdff1aSopenharmony_ci@var{port} specifies the RTP port to use. 1090cabdff1aSopenharmony_ci 1091cabdff1aSopenharmony_ciThe following URL options are supported: 1092cabdff1aSopenharmony_ci 1093cabdff1aSopenharmony_ci@table @option 1094cabdff1aSopenharmony_ci 1095cabdff1aSopenharmony_ci@item ttl=@var{n} 1096cabdff1aSopenharmony_ciSet the TTL (Time-To-Live) value (for multicast only). 1097cabdff1aSopenharmony_ci 1098cabdff1aSopenharmony_ci@item rtcpport=@var{n} 1099cabdff1aSopenharmony_ciSet the remote RTCP port to @var{n}. 1100cabdff1aSopenharmony_ci 1101cabdff1aSopenharmony_ci@item localrtpport=@var{n} 1102cabdff1aSopenharmony_ciSet the local RTP port to @var{n}. 1103cabdff1aSopenharmony_ci 1104cabdff1aSopenharmony_ci@item localrtcpport=@var{n}' 1105cabdff1aSopenharmony_ciSet the local RTCP port to @var{n}. 1106cabdff1aSopenharmony_ci 1107cabdff1aSopenharmony_ci@item pkt_size=@var{n} 1108cabdff1aSopenharmony_ciSet max packet size (in bytes) to @var{n}. 1109cabdff1aSopenharmony_ci 1110cabdff1aSopenharmony_ci@item buffer_size=@var{size} 1111cabdff1aSopenharmony_ciSet the maximum UDP socket buffer size in bytes. 1112cabdff1aSopenharmony_ci 1113cabdff1aSopenharmony_ci@item connect=0|1 1114cabdff1aSopenharmony_ciDo a @code{connect()} on the UDP socket (if set to 1) or not (if set 1115cabdff1aSopenharmony_cito 0). 1116cabdff1aSopenharmony_ci 1117cabdff1aSopenharmony_ci@item sources=@var{ip}[,@var{ip}] 1118cabdff1aSopenharmony_ciList allowed source IP addresses. 1119cabdff1aSopenharmony_ci 1120cabdff1aSopenharmony_ci@item block=@var{ip}[,@var{ip}] 1121cabdff1aSopenharmony_ciList disallowed (blocked) source IP addresses. 1122cabdff1aSopenharmony_ci 1123cabdff1aSopenharmony_ci@item write_to_source=0|1 1124cabdff1aSopenharmony_ciSend packets to the source address of the latest received packet (if 1125cabdff1aSopenharmony_ciset to 1) or to a default remote address (if set to 0). 1126cabdff1aSopenharmony_ci 1127cabdff1aSopenharmony_ci@item localport=@var{n} 1128cabdff1aSopenharmony_ciSet the local RTP port to @var{n}. 1129cabdff1aSopenharmony_ci 1130cabdff1aSopenharmony_ci@item localaddr=@var{addr} 1131cabdff1aSopenharmony_ciLocal IP address of a network interface used for sending packets or joining 1132cabdff1aSopenharmony_cimulticast groups. 1133cabdff1aSopenharmony_ci 1134cabdff1aSopenharmony_ci@item timeout=@var{n} 1135cabdff1aSopenharmony_ciSet timeout (in microseconds) of socket I/O operations to @var{n}. 1136cabdff1aSopenharmony_ci 1137cabdff1aSopenharmony_ciThis is a deprecated option. Instead, @option{localrtpport} should be 1138cabdff1aSopenharmony_ciused. 1139cabdff1aSopenharmony_ci 1140cabdff1aSopenharmony_ci@end table 1141cabdff1aSopenharmony_ci 1142cabdff1aSopenharmony_ciImportant notes: 1143cabdff1aSopenharmony_ci 1144cabdff1aSopenharmony_ci@enumerate 1145cabdff1aSopenharmony_ci 1146cabdff1aSopenharmony_ci@item 1147cabdff1aSopenharmony_ciIf @option{rtcpport} is not set the RTCP port will be set to the RTP 1148cabdff1aSopenharmony_ciport value plus 1. 1149cabdff1aSopenharmony_ci 1150cabdff1aSopenharmony_ci@item 1151cabdff1aSopenharmony_ciIf @option{localrtpport} (the local RTP port) is not set any available 1152cabdff1aSopenharmony_ciport will be used for the local RTP and RTCP ports. 1153cabdff1aSopenharmony_ci 1154cabdff1aSopenharmony_ci@item 1155cabdff1aSopenharmony_ciIf @option{localrtcpport} (the local RTCP port) is not set it will be 1156cabdff1aSopenharmony_ciset to the local RTP port value plus 1. 1157cabdff1aSopenharmony_ci@end enumerate 1158cabdff1aSopenharmony_ci 1159cabdff1aSopenharmony_ci@section rtsp 1160cabdff1aSopenharmony_ci 1161cabdff1aSopenharmony_ciReal-Time Streaming Protocol. 1162cabdff1aSopenharmony_ci 1163cabdff1aSopenharmony_ciRTSP is not technically a protocol handler in libavformat, it is a demuxer 1164cabdff1aSopenharmony_ciand muxer. The demuxer supports both normal RTSP (with data transferred 1165cabdff1aSopenharmony_ciover RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with 1166cabdff1aSopenharmony_cidata transferred over RDT). 1167cabdff1aSopenharmony_ci 1168cabdff1aSopenharmony_ciThe muxer can be used to send a stream using RTSP ANNOUNCE to a server 1169cabdff1aSopenharmony_cisupporting it (currently Darwin Streaming Server and Mischa Spiegelmock's 1170cabdff1aSopenharmony_ci@uref{https://github.com/revmischa/rtsp-server, RTSP server}). 1171cabdff1aSopenharmony_ci 1172cabdff1aSopenharmony_ciThe required syntax for a RTSP url is: 1173cabdff1aSopenharmony_ci@example 1174cabdff1aSopenharmony_cirtsp://@var{hostname}[:@var{port}]/@var{path} 1175cabdff1aSopenharmony_ci@end example 1176cabdff1aSopenharmony_ci 1177cabdff1aSopenharmony_ciOptions can be set on the @command{ffmpeg}/@command{ffplay} command 1178cabdff1aSopenharmony_ciline, or set in code via @code{AVOption}s or in 1179cabdff1aSopenharmony_ci@code{avformat_open_input}. 1180cabdff1aSopenharmony_ci 1181cabdff1aSopenharmony_ciThe following options are supported. 1182cabdff1aSopenharmony_ci 1183cabdff1aSopenharmony_ci@table @option 1184cabdff1aSopenharmony_ci@item initial_pause 1185cabdff1aSopenharmony_ciDo not start playing the stream immediately if set to 1. Default value 1186cabdff1aSopenharmony_ciis 0. 1187cabdff1aSopenharmony_ci 1188cabdff1aSopenharmony_ci@item rtsp_transport 1189cabdff1aSopenharmony_ciSet RTSP transport protocols. 1190cabdff1aSopenharmony_ci 1191cabdff1aSopenharmony_ciIt accepts the following values: 1192cabdff1aSopenharmony_ci@table @samp 1193cabdff1aSopenharmony_ci@item udp 1194cabdff1aSopenharmony_ciUse UDP as lower transport protocol. 1195cabdff1aSopenharmony_ci 1196cabdff1aSopenharmony_ci@item tcp 1197cabdff1aSopenharmony_ciUse TCP (interleaving within the RTSP control channel) as lower 1198cabdff1aSopenharmony_citransport protocol. 1199cabdff1aSopenharmony_ci 1200cabdff1aSopenharmony_ci@item udp_multicast 1201cabdff1aSopenharmony_ciUse UDP multicast as lower transport protocol. 1202cabdff1aSopenharmony_ci 1203cabdff1aSopenharmony_ci@item http 1204cabdff1aSopenharmony_ciUse HTTP tunneling as lower transport protocol, which is useful for 1205cabdff1aSopenharmony_cipassing proxies. 1206cabdff1aSopenharmony_ci@end table 1207cabdff1aSopenharmony_ci 1208cabdff1aSopenharmony_ciMultiple lower transport protocols may be specified, in that case they are 1209cabdff1aSopenharmony_citried one at a time (if the setup of one fails, the next one is tried). 1210cabdff1aSopenharmony_ciFor the muxer, only the @samp{tcp} and @samp{udp} options are supported. 1211cabdff1aSopenharmony_ci 1212cabdff1aSopenharmony_ci@item rtsp_flags 1213cabdff1aSopenharmony_ciSet RTSP flags. 1214cabdff1aSopenharmony_ci 1215cabdff1aSopenharmony_ciThe following values are accepted: 1216cabdff1aSopenharmony_ci@table @samp 1217cabdff1aSopenharmony_ci@item filter_src 1218cabdff1aSopenharmony_ciAccept packets only from negotiated peer address and port. 1219cabdff1aSopenharmony_ci@item listen 1220cabdff1aSopenharmony_ciAct as a server, listening for an incoming connection. 1221cabdff1aSopenharmony_ci@item prefer_tcp 1222cabdff1aSopenharmony_ciTry TCP for RTP transport first, if TCP is available as RTSP RTP transport. 1223cabdff1aSopenharmony_ci@end table 1224cabdff1aSopenharmony_ci 1225cabdff1aSopenharmony_ciDefault value is @samp{none}. 1226cabdff1aSopenharmony_ci 1227cabdff1aSopenharmony_ci@item allowed_media_types 1228cabdff1aSopenharmony_ciSet media types to accept from the server. 1229cabdff1aSopenharmony_ci 1230cabdff1aSopenharmony_ciThe following flags are accepted: 1231cabdff1aSopenharmony_ci@table @samp 1232cabdff1aSopenharmony_ci@item video 1233cabdff1aSopenharmony_ci@item audio 1234cabdff1aSopenharmony_ci@item data 1235cabdff1aSopenharmony_ci@end table 1236cabdff1aSopenharmony_ci 1237cabdff1aSopenharmony_ciBy default it accepts all media types. 1238cabdff1aSopenharmony_ci 1239cabdff1aSopenharmony_ci@item min_port 1240cabdff1aSopenharmony_ciSet minimum local UDP port. Default value is 5000. 1241cabdff1aSopenharmony_ci 1242cabdff1aSopenharmony_ci@item max_port 1243cabdff1aSopenharmony_ciSet maximum local UDP port. Default value is 65000. 1244cabdff1aSopenharmony_ci 1245cabdff1aSopenharmony_ci@item listen_timeout 1246cabdff1aSopenharmony_ciSet maximum timeout (in seconds) to establish an initial connection. Setting 1247cabdff1aSopenharmony_ci@option{listen_timeout} > 0 sets @option{rtsp_flags} to @samp{listen}. Default is -1 1248cabdff1aSopenharmony_ciwhich means an infinite timeout when @samp{listen} mode is set. 1249cabdff1aSopenharmony_ci 1250cabdff1aSopenharmony_ci@item reorder_queue_size 1251cabdff1aSopenharmony_ciSet number of packets to buffer for handling of reordered packets. 1252cabdff1aSopenharmony_ci 1253cabdff1aSopenharmony_ci@item timeout 1254cabdff1aSopenharmony_ciSet socket TCP I/O timeout in microseconds. 1255cabdff1aSopenharmony_ci 1256cabdff1aSopenharmony_ci@item user_agent 1257cabdff1aSopenharmony_ciOverride User-Agent header. If not specified, it defaults to the 1258cabdff1aSopenharmony_cilibavformat identifier string. 1259cabdff1aSopenharmony_ci@end table 1260cabdff1aSopenharmony_ci 1261cabdff1aSopenharmony_ciWhen receiving data over UDP, the demuxer tries to reorder received packets 1262cabdff1aSopenharmony_ci(since they may arrive out of order, or packets may get lost totally). This 1263cabdff1aSopenharmony_cican be disabled by setting the maximum demuxing delay to zero (via 1264cabdff1aSopenharmony_cithe @code{max_delay} field of AVFormatContext). 1265cabdff1aSopenharmony_ci 1266cabdff1aSopenharmony_ciWhen watching multi-bitrate Real-RTSP streams with @command{ffplay}, the 1267cabdff1aSopenharmony_cistreams to display can be chosen with @code{-vst} @var{n} and 1268cabdff1aSopenharmony_ci@code{-ast} @var{n} for video and audio respectively, and can be switched 1269cabdff1aSopenharmony_cion the fly by pressing @code{v} and @code{a}. 1270cabdff1aSopenharmony_ci 1271cabdff1aSopenharmony_ci@subsection Examples 1272cabdff1aSopenharmony_ci 1273cabdff1aSopenharmony_ciThe following examples all make use of the @command{ffplay} and 1274cabdff1aSopenharmony_ci@command{ffmpeg} tools. 1275cabdff1aSopenharmony_ci 1276cabdff1aSopenharmony_ci@itemize 1277cabdff1aSopenharmony_ci@item 1278cabdff1aSopenharmony_ciWatch a stream over UDP, with a max reordering delay of 0.5 seconds: 1279cabdff1aSopenharmony_ci@example 1280cabdff1aSopenharmony_ciffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4 1281cabdff1aSopenharmony_ci@end example 1282cabdff1aSopenharmony_ci 1283cabdff1aSopenharmony_ci@item 1284cabdff1aSopenharmony_ciWatch a stream tunneled over HTTP: 1285cabdff1aSopenharmony_ci@example 1286cabdff1aSopenharmony_ciffplay -rtsp_transport http rtsp://server/video.mp4 1287cabdff1aSopenharmony_ci@end example 1288cabdff1aSopenharmony_ci 1289cabdff1aSopenharmony_ci@item 1290cabdff1aSopenharmony_ciSend a stream in realtime to a RTSP server, for others to watch: 1291cabdff1aSopenharmony_ci@example 1292cabdff1aSopenharmony_ciffmpeg -re -i @var{input} -f rtsp -muxdelay 0.1 rtsp://server/live.sdp 1293cabdff1aSopenharmony_ci@end example 1294cabdff1aSopenharmony_ci 1295cabdff1aSopenharmony_ci@item 1296cabdff1aSopenharmony_ciReceive a stream in realtime: 1297cabdff1aSopenharmony_ci@example 1298cabdff1aSopenharmony_ciffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp @var{output} 1299cabdff1aSopenharmony_ci@end example 1300cabdff1aSopenharmony_ci@end itemize 1301cabdff1aSopenharmony_ci 1302cabdff1aSopenharmony_ci@section sap 1303cabdff1aSopenharmony_ci 1304cabdff1aSopenharmony_ciSession Announcement Protocol (RFC 2974). This is not technically a 1305cabdff1aSopenharmony_ciprotocol handler in libavformat, it is a muxer and demuxer. 1306cabdff1aSopenharmony_ciIt is used for signalling of RTP streams, by announcing the SDP for the 1307cabdff1aSopenharmony_cistreams regularly on a separate port. 1308cabdff1aSopenharmony_ci 1309cabdff1aSopenharmony_ci@subsection Muxer 1310cabdff1aSopenharmony_ci 1311cabdff1aSopenharmony_ciThe syntax for a SAP url given to the muxer is: 1312cabdff1aSopenharmony_ci@example 1313cabdff1aSopenharmony_cisap://@var{destination}[:@var{port}][?@var{options}] 1314cabdff1aSopenharmony_ci@end example 1315cabdff1aSopenharmony_ci 1316cabdff1aSopenharmony_ciThe RTP packets are sent to @var{destination} on port @var{port}, 1317cabdff1aSopenharmony_cior to port 5004 if no port is specified. 1318cabdff1aSopenharmony_ci@var{options} is a @code{&}-separated list. The following options 1319cabdff1aSopenharmony_ciare supported: 1320cabdff1aSopenharmony_ci 1321cabdff1aSopenharmony_ci@table @option 1322cabdff1aSopenharmony_ci 1323cabdff1aSopenharmony_ci@item announce_addr=@var{address} 1324cabdff1aSopenharmony_ciSpecify the destination IP address for sending the announcements to. 1325cabdff1aSopenharmony_ciIf omitted, the announcements are sent to the commonly used SAP 1326cabdff1aSopenharmony_ciannouncement multicast address 224.2.127.254 (sap.mcast.net), or 1327cabdff1aSopenharmony_ciff0e::2:7ffe if @var{destination} is an IPv6 address. 1328cabdff1aSopenharmony_ci 1329cabdff1aSopenharmony_ci@item announce_port=@var{port} 1330cabdff1aSopenharmony_ciSpecify the port to send the announcements on, defaults to 1331cabdff1aSopenharmony_ci9875 if not specified. 1332cabdff1aSopenharmony_ci 1333cabdff1aSopenharmony_ci@item ttl=@var{ttl} 1334cabdff1aSopenharmony_ciSpecify the time to live value for the announcements and RTP packets, 1335cabdff1aSopenharmony_cidefaults to 255. 1336cabdff1aSopenharmony_ci 1337cabdff1aSopenharmony_ci@item same_port=@var{0|1} 1338cabdff1aSopenharmony_ciIf set to 1, send all RTP streams on the same port pair. If zero (the 1339cabdff1aSopenharmony_cidefault), all streams are sent on unique ports, with each stream on a 1340cabdff1aSopenharmony_ciport 2 numbers higher than the previous. 1341cabdff1aSopenharmony_ciVLC/Live555 requires this to be set to 1, to be able to receive the stream. 1342cabdff1aSopenharmony_ciThe RTP stack in libavformat for receiving requires all streams to be sent 1343cabdff1aSopenharmony_cion unique ports. 1344cabdff1aSopenharmony_ci@end table 1345cabdff1aSopenharmony_ci 1346cabdff1aSopenharmony_ciExample command lines follow. 1347cabdff1aSopenharmony_ci 1348cabdff1aSopenharmony_ciTo broadcast a stream on the local subnet, for watching in VLC: 1349cabdff1aSopenharmony_ci 1350cabdff1aSopenharmony_ci@example 1351cabdff1aSopenharmony_ciffmpeg -re -i @var{input} -f sap sap://224.0.0.255?same_port=1 1352cabdff1aSopenharmony_ci@end example 1353cabdff1aSopenharmony_ci 1354cabdff1aSopenharmony_ciSimilarly, for watching in @command{ffplay}: 1355cabdff1aSopenharmony_ci 1356cabdff1aSopenharmony_ci@example 1357cabdff1aSopenharmony_ciffmpeg -re -i @var{input} -f sap sap://224.0.0.255 1358cabdff1aSopenharmony_ci@end example 1359cabdff1aSopenharmony_ci 1360cabdff1aSopenharmony_ciAnd for watching in @command{ffplay}, over IPv6: 1361cabdff1aSopenharmony_ci 1362cabdff1aSopenharmony_ci@example 1363cabdff1aSopenharmony_ciffmpeg -re -i @var{input} -f sap sap://[ff0e::1:2:3:4] 1364cabdff1aSopenharmony_ci@end example 1365cabdff1aSopenharmony_ci 1366cabdff1aSopenharmony_ci@subsection Demuxer 1367cabdff1aSopenharmony_ci 1368cabdff1aSopenharmony_ciThe syntax for a SAP url given to the demuxer is: 1369cabdff1aSopenharmony_ci@example 1370cabdff1aSopenharmony_cisap://[@var{address}][:@var{port}] 1371cabdff1aSopenharmony_ci@end example 1372cabdff1aSopenharmony_ci 1373cabdff1aSopenharmony_ci@var{address} is the multicast address to listen for announcements on, 1374cabdff1aSopenharmony_ciif omitted, the default 224.2.127.254 (sap.mcast.net) is used. @var{port} 1375cabdff1aSopenharmony_ciis the port that is listened on, 9875 if omitted. 1376cabdff1aSopenharmony_ci 1377cabdff1aSopenharmony_ciThe demuxers listens for announcements on the given address and port. 1378cabdff1aSopenharmony_ciOnce an announcement is received, it tries to receive that particular stream. 1379cabdff1aSopenharmony_ci 1380cabdff1aSopenharmony_ciExample command lines follow. 1381cabdff1aSopenharmony_ci 1382cabdff1aSopenharmony_ciTo play back the first stream announced on the normal SAP multicast address: 1383cabdff1aSopenharmony_ci 1384cabdff1aSopenharmony_ci@example 1385cabdff1aSopenharmony_ciffplay sap:// 1386cabdff1aSopenharmony_ci@end example 1387cabdff1aSopenharmony_ci 1388cabdff1aSopenharmony_ciTo play back the first stream announced on one the default IPv6 SAP multicast address: 1389cabdff1aSopenharmony_ci 1390cabdff1aSopenharmony_ci@example 1391cabdff1aSopenharmony_ciffplay sap://[ff0e::2:7ffe] 1392cabdff1aSopenharmony_ci@end example 1393cabdff1aSopenharmony_ci 1394cabdff1aSopenharmony_ci@section sctp 1395cabdff1aSopenharmony_ci 1396cabdff1aSopenharmony_ciStream Control Transmission Protocol. 1397cabdff1aSopenharmony_ci 1398cabdff1aSopenharmony_ciThe accepted URL syntax is: 1399cabdff1aSopenharmony_ci@example 1400cabdff1aSopenharmony_cisctp://@var{host}:@var{port}[?@var{options}] 1401cabdff1aSopenharmony_ci@end example 1402cabdff1aSopenharmony_ci 1403cabdff1aSopenharmony_ciThe protocol accepts the following options: 1404cabdff1aSopenharmony_ci@table @option 1405cabdff1aSopenharmony_ci@item listen 1406cabdff1aSopenharmony_ciIf set to any value, listen for an incoming connection. Outgoing connection is done by default. 1407cabdff1aSopenharmony_ci 1408cabdff1aSopenharmony_ci@item max_streams 1409cabdff1aSopenharmony_ciSet the maximum number of streams. By default no limit is set. 1410cabdff1aSopenharmony_ci@end table 1411cabdff1aSopenharmony_ci 1412cabdff1aSopenharmony_ci@section srt 1413cabdff1aSopenharmony_ci 1414cabdff1aSopenharmony_ciHaivision Secure Reliable Transport Protocol via libsrt. 1415cabdff1aSopenharmony_ci 1416cabdff1aSopenharmony_ciThe supported syntax for a SRT URL is: 1417cabdff1aSopenharmony_ci@example 1418cabdff1aSopenharmony_cisrt://@var{hostname}:@var{port}[?@var{options}] 1419cabdff1aSopenharmony_ci@end example 1420cabdff1aSopenharmony_ci 1421cabdff1aSopenharmony_ci@var{options} contains a list of &-separated options of the form 1422cabdff1aSopenharmony_ci@var{key}=@var{val}. 1423cabdff1aSopenharmony_ci 1424cabdff1aSopenharmony_cior 1425cabdff1aSopenharmony_ci 1426cabdff1aSopenharmony_ci@example 1427cabdff1aSopenharmony_ci@var{options} srt://@var{hostname}:@var{port} 1428cabdff1aSopenharmony_ci@end example 1429cabdff1aSopenharmony_ci 1430cabdff1aSopenharmony_ci@var{options} contains a list of '-@var{key} @var{val}' 1431cabdff1aSopenharmony_cioptions. 1432cabdff1aSopenharmony_ci 1433cabdff1aSopenharmony_ciThis protocol accepts the following options. 1434cabdff1aSopenharmony_ci 1435cabdff1aSopenharmony_ci@table @option 1436cabdff1aSopenharmony_ci@item connect_timeout=@var{milliseconds} 1437cabdff1aSopenharmony_ciConnection timeout; SRT cannot connect for RTT > 1500 msec 1438cabdff1aSopenharmony_ci(2 handshake exchanges) with the default connect timeout of 1439cabdff1aSopenharmony_ci3 seconds. This option applies to the caller and rendezvous 1440cabdff1aSopenharmony_ciconnection modes. The connect timeout is 10 times the value 1441cabdff1aSopenharmony_ciset for the rendezvous mode (which can be used as a 1442cabdff1aSopenharmony_ciworkaround for this connection problem with earlier versions). 1443cabdff1aSopenharmony_ci 1444cabdff1aSopenharmony_ci@item ffs=@var{bytes} 1445cabdff1aSopenharmony_ciFlight Flag Size (Window Size), in bytes. FFS is actually an 1446cabdff1aSopenharmony_ciinternal parameter and you should set it to not less than 1447cabdff1aSopenharmony_ci@option{recv_buffer_size} and @option{mss}. The default value 1448cabdff1aSopenharmony_ciis relatively large, therefore unless you set a very large receiver buffer, 1449cabdff1aSopenharmony_ciyou do not need to change this option. Default value is 25600. 1450cabdff1aSopenharmony_ci 1451cabdff1aSopenharmony_ci@item inputbw=@var{bytes/seconds} 1452cabdff1aSopenharmony_ciSender nominal input rate, in bytes per seconds. Used along with 1453cabdff1aSopenharmony_ci@option{oheadbw}, when @option{maxbw} is set to relative (0), to 1454cabdff1aSopenharmony_cicalculate maximum sending rate when recovery packets are sent 1455cabdff1aSopenharmony_cialong with the main media stream: 1456cabdff1aSopenharmony_ci@option{inputbw} * (100 + @option{oheadbw}) / 100 1457cabdff1aSopenharmony_ciif @option{inputbw} is not set while @option{maxbw} is set to 1458cabdff1aSopenharmony_cirelative (0), the actual input rate is evaluated inside 1459cabdff1aSopenharmony_cithe library. Default value is 0. 1460cabdff1aSopenharmony_ci 1461cabdff1aSopenharmony_ci@item iptos=@var{tos} 1462cabdff1aSopenharmony_ciIP Type of Service. Applies to sender only. Default value is 0xB8. 1463cabdff1aSopenharmony_ci 1464cabdff1aSopenharmony_ci@item ipttl=@var{ttl} 1465cabdff1aSopenharmony_ciIP Time To Live. Applies to sender only. Default value is 64. 1466cabdff1aSopenharmony_ci 1467cabdff1aSopenharmony_ci@item latency=@var{microseconds} 1468cabdff1aSopenharmony_ciTimestamp-based Packet Delivery Delay. 1469cabdff1aSopenharmony_ciUsed to absorb bursts of missed packet retransmissions. 1470cabdff1aSopenharmony_ciThis flag sets both @option{rcvlatency} and @option{peerlatency} 1471cabdff1aSopenharmony_cito the same value. Note that prior to version 1.3.0 1472cabdff1aSopenharmony_cithis is the only flag to set the latency, however 1473cabdff1aSopenharmony_cithis is effectively equivalent to setting @option{peerlatency}, 1474cabdff1aSopenharmony_ciwhen side is sender and @option{rcvlatency} 1475cabdff1aSopenharmony_ciwhen side is receiver, and the bidirectional stream 1476cabdff1aSopenharmony_cisending is not supported. 1477cabdff1aSopenharmony_ci 1478cabdff1aSopenharmony_ci@item listen_timeout=@var{microseconds} 1479cabdff1aSopenharmony_ciSet socket listen timeout. 1480cabdff1aSopenharmony_ci 1481cabdff1aSopenharmony_ci@item maxbw=@var{bytes/seconds} 1482cabdff1aSopenharmony_ciMaximum sending bandwidth, in bytes per seconds. 1483cabdff1aSopenharmony_ci-1 infinite (CSRTCC limit is 30mbps) 1484cabdff1aSopenharmony_ci0 relative to input rate (see @option{inputbw}) 1485cabdff1aSopenharmony_ci>0 absolute limit value 1486cabdff1aSopenharmony_ciDefault value is 0 (relative) 1487cabdff1aSopenharmony_ci 1488cabdff1aSopenharmony_ci@item mode=@var{caller|listener|rendezvous} 1489cabdff1aSopenharmony_ciConnection mode. 1490cabdff1aSopenharmony_ci@option{caller} opens client connection. 1491cabdff1aSopenharmony_ci@option{listener} starts server to listen for incoming connections. 1492cabdff1aSopenharmony_ci@option{rendezvous} use Rendez-Vous connection mode. 1493cabdff1aSopenharmony_ciDefault value is caller. 1494cabdff1aSopenharmony_ci 1495cabdff1aSopenharmony_ci@item mss=@var{bytes} 1496cabdff1aSopenharmony_ciMaximum Segment Size, in bytes. Used for buffer allocation 1497cabdff1aSopenharmony_ciand rate calculation using a packet counter assuming fully 1498cabdff1aSopenharmony_cifilled packets. The smallest MSS between the peers is 1499cabdff1aSopenharmony_ciused. This is 1500 by default in the overall internet. 1500cabdff1aSopenharmony_ciThis is the maximum size of the UDP packet and can be 1501cabdff1aSopenharmony_cionly decreased, unless you have some unusual dedicated 1502cabdff1aSopenharmony_cinetwork settings. Default value is 1500. 1503cabdff1aSopenharmony_ci 1504cabdff1aSopenharmony_ci@item nakreport=@var{1|0} 1505cabdff1aSopenharmony_ciIf set to 1, Receiver will send `UMSG_LOSSREPORT` messages 1506cabdff1aSopenharmony_ciperiodically until a lost packet is retransmitted or 1507cabdff1aSopenharmony_ciintentionally dropped. Default value is 1. 1508cabdff1aSopenharmony_ci 1509cabdff1aSopenharmony_ci@item oheadbw=@var{percents} 1510cabdff1aSopenharmony_ciRecovery bandwidth overhead above input rate, in percents. 1511cabdff1aSopenharmony_ciSee @option{inputbw}. Default value is 25%. 1512cabdff1aSopenharmony_ci 1513cabdff1aSopenharmony_ci@item passphrase=@var{string} 1514cabdff1aSopenharmony_ciHaiCrypt Encryption/Decryption Passphrase string, length 1515cabdff1aSopenharmony_cifrom 10 to 79 characters. The passphrase is the shared 1516cabdff1aSopenharmony_cisecret between the sender and the receiver. It is used 1517cabdff1aSopenharmony_cito generate the Key Encrypting Key using PBKDF2 1518cabdff1aSopenharmony_ci(Password-Based Key Derivation Function). It is used 1519cabdff1aSopenharmony_cionly if @option{pbkeylen} is non-zero. It is used on 1520cabdff1aSopenharmony_cithe receiver only if the received data is encrypted. 1521cabdff1aSopenharmony_ciThe configured passphrase cannot be recovered (write-only). 1522cabdff1aSopenharmony_ci 1523cabdff1aSopenharmony_ci@item enforced_encryption=@var{1|0} 1524cabdff1aSopenharmony_ciIf true, both connection parties must have the same password 1525cabdff1aSopenharmony_ciset (including empty, that is, with no encryption). If the 1526cabdff1aSopenharmony_cipassword doesn't match or only one side is unencrypted, 1527cabdff1aSopenharmony_cithe connection is rejected. Default is true. 1528cabdff1aSopenharmony_ci 1529cabdff1aSopenharmony_ci@item kmrefreshrate=@var{packets} 1530cabdff1aSopenharmony_ciThe number of packets to be transmitted after which the 1531cabdff1aSopenharmony_ciencryption key is switched to a new key. Default is -1. 1532cabdff1aSopenharmony_ci-1 means auto (0x1000000 in srt library). The range for 1533cabdff1aSopenharmony_cithis option is integers in the 0 - @code{INT_MAX}. 1534cabdff1aSopenharmony_ci 1535cabdff1aSopenharmony_ci@item kmpreannounce=@var{packets} 1536cabdff1aSopenharmony_ciThe interval between when a new encryption key is sent and 1537cabdff1aSopenharmony_ciwhen switchover occurs. This value also applies to the 1538cabdff1aSopenharmony_cisubsequent interval between when switchover occurs and 1539cabdff1aSopenharmony_ciwhen the old encryption key is decommissioned. Default is -1. 1540cabdff1aSopenharmony_ci-1 means auto (0x1000 in srt library). The range for 1541cabdff1aSopenharmony_cithis option is integers in the 0 - @code{INT_MAX}. 1542cabdff1aSopenharmony_ci 1543cabdff1aSopenharmony_ci@item snddropdelay=@var{microseconds} 1544cabdff1aSopenharmony_ciThe sender's extra delay before dropping packets. This delay is 1545cabdff1aSopenharmony_ciadded to the default drop delay time interval value. 1546cabdff1aSopenharmony_ci 1547cabdff1aSopenharmony_ciSpecial value -1: Do not drop packets on the sender at all. 1548cabdff1aSopenharmony_ci 1549cabdff1aSopenharmony_ci@item payload_size=@var{bytes} 1550cabdff1aSopenharmony_ciSets the maximum declared size of a packet transferred 1551cabdff1aSopenharmony_ciduring the single call to the sending function in Live 1552cabdff1aSopenharmony_cimode. Use 0 if this value isn't used (which is default in 1553cabdff1aSopenharmony_cifile mode). 1554cabdff1aSopenharmony_ciDefault is -1 (automatic), which typically means MPEG-TS; 1555cabdff1aSopenharmony_ciif you are going to use SRT 1556cabdff1aSopenharmony_cito send any different kind of payload, such as, for example, 1557cabdff1aSopenharmony_ciwrapping a live stream in very small frames, then you can 1558cabdff1aSopenharmony_ciuse a bigger maximum frame size, though not greater than 1559cabdff1aSopenharmony_ci1456 bytes. 1560cabdff1aSopenharmony_ci 1561cabdff1aSopenharmony_ci@item pkt_size=@var{bytes} 1562cabdff1aSopenharmony_ciAlias for @samp{payload_size}. 1563cabdff1aSopenharmony_ci 1564cabdff1aSopenharmony_ci@item peerlatency=@var{microseconds} 1565cabdff1aSopenharmony_ciThe latency value (as described in @option{rcvlatency}) that is 1566cabdff1aSopenharmony_ciset by the sender side as a minimum value for the receiver. 1567cabdff1aSopenharmony_ci 1568cabdff1aSopenharmony_ci@item pbkeylen=@var{bytes} 1569cabdff1aSopenharmony_ciSender encryption key length, in bytes. 1570cabdff1aSopenharmony_ciOnly can be set to 0, 16, 24 and 32. 1571cabdff1aSopenharmony_ciEnable sender encryption if not 0. 1572cabdff1aSopenharmony_ciNot required on receiver (set to 0), 1573cabdff1aSopenharmony_cikey size obtained from sender in HaiCrypt handshake. 1574cabdff1aSopenharmony_ciDefault value is 0. 1575cabdff1aSopenharmony_ci 1576cabdff1aSopenharmony_ci@item rcvlatency=@var{microseconds} 1577cabdff1aSopenharmony_ciThe time that should elapse since the moment when the 1578cabdff1aSopenharmony_cipacket was sent and the moment when it's delivered to 1579cabdff1aSopenharmony_cithe receiver application in the receiving function. 1580cabdff1aSopenharmony_ciThis time should be a buffer time large enough to cover 1581cabdff1aSopenharmony_cithe time spent for sending, unexpectedly extended RTT 1582cabdff1aSopenharmony_citime, and the time needed to retransmit the lost UDP 1583cabdff1aSopenharmony_cipacket. The effective latency value will be the maximum 1584cabdff1aSopenharmony_ciof this options' value and the value of @option{peerlatency} 1585cabdff1aSopenharmony_ciset by the peer side. Before version 1.3.0 this option 1586cabdff1aSopenharmony_ciis only available as @option{latency}. 1587cabdff1aSopenharmony_ci 1588cabdff1aSopenharmony_ci@item recv_buffer_size=@var{bytes} 1589cabdff1aSopenharmony_ciSet UDP receive buffer size, expressed in bytes. 1590cabdff1aSopenharmony_ci 1591cabdff1aSopenharmony_ci@item send_buffer_size=@var{bytes} 1592cabdff1aSopenharmony_ciSet UDP send buffer size, expressed in bytes. 1593cabdff1aSopenharmony_ci 1594cabdff1aSopenharmony_ci@item timeout=@var{microseconds} 1595cabdff1aSopenharmony_ciSet raise error timeouts for read, write and connect operations. Note that the 1596cabdff1aSopenharmony_ciSRT library has internal timeouts which can be controlled separately, the 1597cabdff1aSopenharmony_civalue set here is only a cap on those. 1598cabdff1aSopenharmony_ci 1599cabdff1aSopenharmony_ci@item tlpktdrop=@var{1|0} 1600cabdff1aSopenharmony_ciToo-late Packet Drop. When enabled on receiver, it skips 1601cabdff1aSopenharmony_cimissing packets that have not been delivered in time and 1602cabdff1aSopenharmony_cidelivers the following packets to the application when 1603cabdff1aSopenharmony_citheir time-to-play has come. It also sends a fake ACK to 1604cabdff1aSopenharmony_cithe sender. When enabled on sender and enabled on the 1605cabdff1aSopenharmony_cireceiving peer, the sender drops the older packets that 1606cabdff1aSopenharmony_cihave no chance of being delivered in time. It was 1607cabdff1aSopenharmony_ciautomatically enabled in the sender if the receiver 1608cabdff1aSopenharmony_cisupports it. 1609cabdff1aSopenharmony_ci 1610cabdff1aSopenharmony_ci@item sndbuf=@var{bytes} 1611cabdff1aSopenharmony_ciSet send buffer size, expressed in bytes. 1612cabdff1aSopenharmony_ci 1613cabdff1aSopenharmony_ci@item rcvbuf=@var{bytes} 1614cabdff1aSopenharmony_ciSet receive buffer size, expressed in bytes. 1615cabdff1aSopenharmony_ci 1616cabdff1aSopenharmony_ciReceive buffer must not be greater than @option{ffs}. 1617cabdff1aSopenharmony_ci 1618cabdff1aSopenharmony_ci@item lossmaxttl=@var{packets} 1619cabdff1aSopenharmony_ciThe value up to which the Reorder Tolerance may grow. When 1620cabdff1aSopenharmony_ciReorder Tolerance is > 0, then packet loss report is delayed 1621cabdff1aSopenharmony_ciuntil that number of packets come in. Reorder Tolerance 1622cabdff1aSopenharmony_ciincreases every time a "belated" packet has come, but it 1623cabdff1aSopenharmony_ciwasn't due to retransmission (that is, when UDP packets tend 1624cabdff1aSopenharmony_cito come out of order), with the difference between the latest 1625cabdff1aSopenharmony_cisequence and this packet's sequence, and not more than the 1626cabdff1aSopenharmony_civalue of this option. By default it's 0, which means that this 1627cabdff1aSopenharmony_cimechanism is turned off, and the loss report is always sent 1628cabdff1aSopenharmony_ciimmediately upon experiencing a "gap" in sequences. 1629cabdff1aSopenharmony_ci 1630cabdff1aSopenharmony_ci@item minversion 1631cabdff1aSopenharmony_ciThe minimum SRT version that is required from the peer. A connection 1632cabdff1aSopenharmony_cito a peer that does not satisfy the minimum version requirement 1633cabdff1aSopenharmony_ciwill be rejected. 1634cabdff1aSopenharmony_ci 1635cabdff1aSopenharmony_ciThe version format in hex is 0xXXYYZZ for x.y.z in human readable 1636cabdff1aSopenharmony_ciform. 1637cabdff1aSopenharmony_ci 1638cabdff1aSopenharmony_ci@item streamid=@var{string} 1639cabdff1aSopenharmony_ciA string limited to 512 characters that can be set on the socket prior 1640cabdff1aSopenharmony_cito connecting. This stream ID will be able to be retrieved by the 1641cabdff1aSopenharmony_cilistener side from the socket that is returned from srt_accept and 1642cabdff1aSopenharmony_ciwas connected by a socket with that set stream ID. SRT does not enforce 1643cabdff1aSopenharmony_ciany special interpretation of the contents of this string. 1644cabdff1aSopenharmony_ciThis option doesn’t make sense in Rendezvous connection; the result 1645cabdff1aSopenharmony_cimight be that simply one side will override the value from the other 1646cabdff1aSopenharmony_ciside and it’s the matter of luck which one would win 1647cabdff1aSopenharmony_ci 1648cabdff1aSopenharmony_ci@item srt_streamid=@var{string} 1649cabdff1aSopenharmony_ciAlias for @samp{streamid} to avoid conflict with ffmpeg command line option. 1650cabdff1aSopenharmony_ci 1651cabdff1aSopenharmony_ci@item smoother=@var{live|file} 1652cabdff1aSopenharmony_ciThe type of Smoother used for the transmission for that socket, which 1653cabdff1aSopenharmony_ciis responsible for the transmission and congestion control. The Smoother 1654cabdff1aSopenharmony_citype must be exactly the same on both connecting parties, otherwise 1655cabdff1aSopenharmony_cithe connection is rejected. 1656cabdff1aSopenharmony_ci 1657cabdff1aSopenharmony_ci@item messageapi=@var{1|0} 1658cabdff1aSopenharmony_ciWhen set, this socket uses the Message API, otherwise it uses Buffer 1659cabdff1aSopenharmony_ciAPI. Note that in live mode (see @option{transtype}) there’s only 1660cabdff1aSopenharmony_cimessage API available. In File mode you can chose to use one of two modes: 1661cabdff1aSopenharmony_ci 1662cabdff1aSopenharmony_ciStream API (default, when this option is false). In this mode you may 1663cabdff1aSopenharmony_cisend as many data as you wish with one sending instruction, or even use 1664cabdff1aSopenharmony_cidedicated functions that read directly from a file. The internal facility 1665cabdff1aSopenharmony_ciwill take care of any speed and congestion control. When receiving, you 1666cabdff1aSopenharmony_cican also receive as many data as desired, the data not extracted will be 1667cabdff1aSopenharmony_ciwaiting for the next call. There is no boundary between data portions in 1668cabdff1aSopenharmony_cithe Stream mode. 1669cabdff1aSopenharmony_ci 1670cabdff1aSopenharmony_ciMessage API. In this mode your single sending instruction passes exactly 1671cabdff1aSopenharmony_cione piece of data that has boundaries (a message). Contrary to Live mode, 1672cabdff1aSopenharmony_cithis message may span across multiple UDP packets and the only size 1673cabdff1aSopenharmony_cilimitation is that it shall fit as a whole in the sending buffer. The 1674cabdff1aSopenharmony_cireceiver shall use as large buffer as necessary to receive the message, 1675cabdff1aSopenharmony_ciotherwise the message will not be given up. When the message is not 1676cabdff1aSopenharmony_cicomplete (not all packets received or there was a packet loss) it will 1677cabdff1aSopenharmony_cinot be given up. 1678cabdff1aSopenharmony_ci 1679cabdff1aSopenharmony_ci@item transtype=@var{live|file} 1680cabdff1aSopenharmony_ciSets the transmission type for the socket, in particular, setting this 1681cabdff1aSopenharmony_cioption sets multiple other parameters to their default values as required 1682cabdff1aSopenharmony_cifor a particular transmission type. 1683cabdff1aSopenharmony_ci 1684cabdff1aSopenharmony_cilive: Set options as for live transmission. In this mode, you should 1685cabdff1aSopenharmony_cisend by one sending instruction only so many data that fit in one UDP packet, 1686cabdff1aSopenharmony_ciand limited to the value defined first in @option{payload_size} (1316 is 1687cabdff1aSopenharmony_cidefault in this mode). There is no speed control in this mode, only the 1688cabdff1aSopenharmony_cibandwidth control, if configured, in order to not exceed the bandwidth with 1689cabdff1aSopenharmony_cithe overhead transmission (retransmitted and control packets). 1690cabdff1aSopenharmony_ci 1691cabdff1aSopenharmony_cifile: Set options as for non-live transmission. See @option{messageapi} 1692cabdff1aSopenharmony_cifor further explanations 1693cabdff1aSopenharmony_ci 1694cabdff1aSopenharmony_ci@item linger=@var{seconds} 1695cabdff1aSopenharmony_ciThe number of seconds that the socket waits for unsent data when closing. 1696cabdff1aSopenharmony_ciDefault is -1. -1 means auto (off with 0 seconds in live mode, on with 180 1697cabdff1aSopenharmony_ciseconds in file mode). The range for this option is integers in the 1698cabdff1aSopenharmony_ci0 - @code{INT_MAX}. 1699cabdff1aSopenharmony_ci 1700cabdff1aSopenharmony_ci@item tsbpd=@var{1|0} 1701cabdff1aSopenharmony_ciWhen true, use Timestamp-based Packet Delivery mode. The default behavior 1702cabdff1aSopenharmony_cidepends on the transmission type: enabled in live mode, disabled in file 1703cabdff1aSopenharmony_cimode. 1704cabdff1aSopenharmony_ci 1705cabdff1aSopenharmony_ci@end table 1706cabdff1aSopenharmony_ci 1707cabdff1aSopenharmony_ciFor more information see: @url{https://github.com/Haivision/srt}. 1708cabdff1aSopenharmony_ci 1709cabdff1aSopenharmony_ci@section srtp 1710cabdff1aSopenharmony_ci 1711cabdff1aSopenharmony_ciSecure Real-time Transport Protocol. 1712cabdff1aSopenharmony_ci 1713cabdff1aSopenharmony_ciThe accepted options are: 1714cabdff1aSopenharmony_ci@table @option 1715cabdff1aSopenharmony_ci@item srtp_in_suite 1716cabdff1aSopenharmony_ci@item srtp_out_suite 1717cabdff1aSopenharmony_ciSelect input and output encoding suites. 1718cabdff1aSopenharmony_ci 1719cabdff1aSopenharmony_ciSupported values: 1720cabdff1aSopenharmony_ci@table @samp 1721cabdff1aSopenharmony_ci@item AES_CM_128_HMAC_SHA1_80 1722cabdff1aSopenharmony_ci@item SRTP_AES128_CM_HMAC_SHA1_80 1723cabdff1aSopenharmony_ci@item AES_CM_128_HMAC_SHA1_32 1724cabdff1aSopenharmony_ci@item SRTP_AES128_CM_HMAC_SHA1_32 1725cabdff1aSopenharmony_ci@end table 1726cabdff1aSopenharmony_ci 1727cabdff1aSopenharmony_ci@item srtp_in_params 1728cabdff1aSopenharmony_ci@item srtp_out_params 1729cabdff1aSopenharmony_ciSet input and output encoding parameters, which are expressed by a 1730cabdff1aSopenharmony_cibase64-encoded representation of a binary block. The first 16 bytes of 1731cabdff1aSopenharmony_cithis binary block are used as master key, the following 14 bytes are 1732cabdff1aSopenharmony_ciused as master salt. 1733cabdff1aSopenharmony_ci@end table 1734cabdff1aSopenharmony_ci 1735cabdff1aSopenharmony_ci@section subfile 1736cabdff1aSopenharmony_ci 1737cabdff1aSopenharmony_ciVirtually extract a segment of a file or another stream. 1738cabdff1aSopenharmony_ciThe underlying stream must be seekable. 1739cabdff1aSopenharmony_ci 1740cabdff1aSopenharmony_ciAccepted options: 1741cabdff1aSopenharmony_ci@table @option 1742cabdff1aSopenharmony_ci@item start 1743cabdff1aSopenharmony_ciStart offset of the extracted segment, in bytes. 1744cabdff1aSopenharmony_ci@item end 1745cabdff1aSopenharmony_ciEnd offset of the extracted segment, in bytes. 1746cabdff1aSopenharmony_ciIf set to 0, extract till end of file. 1747cabdff1aSopenharmony_ci@end table 1748cabdff1aSopenharmony_ci 1749cabdff1aSopenharmony_ciExamples: 1750cabdff1aSopenharmony_ci 1751cabdff1aSopenharmony_ciExtract a chapter from a DVD VOB file (start and end sectors obtained 1752cabdff1aSopenharmony_ciexternally and multiplied by 2048): 1753cabdff1aSopenharmony_ci@example 1754cabdff1aSopenharmony_cisubfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB 1755cabdff1aSopenharmony_ci@end example 1756cabdff1aSopenharmony_ci 1757cabdff1aSopenharmony_ciPlay an AVI file directly from a TAR archive: 1758cabdff1aSopenharmony_ci@example 1759cabdff1aSopenharmony_cisubfile,,start,183241728,end,366490624,,:archive.tar 1760cabdff1aSopenharmony_ci@end example 1761cabdff1aSopenharmony_ci 1762cabdff1aSopenharmony_ciPlay a MPEG-TS file from start offset till end: 1763cabdff1aSopenharmony_ci@example 1764cabdff1aSopenharmony_cisubfile,,start,32815239,end,0,,:video.ts 1765cabdff1aSopenharmony_ci@end example 1766cabdff1aSopenharmony_ci 1767cabdff1aSopenharmony_ci@section tee 1768cabdff1aSopenharmony_ci 1769cabdff1aSopenharmony_ciWrites the output to multiple protocols. The individual outputs are separated 1770cabdff1aSopenharmony_ciby | 1771cabdff1aSopenharmony_ci 1772cabdff1aSopenharmony_ci@example 1773cabdff1aSopenharmony_citee:file://path/to/local/this.avi|file://path/to/local/that.avi 1774cabdff1aSopenharmony_ci@end example 1775cabdff1aSopenharmony_ci 1776cabdff1aSopenharmony_ci@section tcp 1777cabdff1aSopenharmony_ci 1778cabdff1aSopenharmony_ciTransmission Control Protocol. 1779cabdff1aSopenharmony_ci 1780cabdff1aSopenharmony_ciThe required syntax for a TCP url is: 1781cabdff1aSopenharmony_ci@example 1782cabdff1aSopenharmony_citcp://@var{hostname}:@var{port}[?@var{options}] 1783cabdff1aSopenharmony_ci@end example 1784cabdff1aSopenharmony_ci 1785cabdff1aSopenharmony_ci@var{options} contains a list of &-separated options of the form 1786cabdff1aSopenharmony_ci@var{key}=@var{val}. 1787cabdff1aSopenharmony_ci 1788cabdff1aSopenharmony_ciThe list of supported options follows. 1789cabdff1aSopenharmony_ci 1790cabdff1aSopenharmony_ci@table @option 1791cabdff1aSopenharmony_ci@item listen=@var{2|1|0} 1792cabdff1aSopenharmony_ciListen for an incoming connection. 0 disables listen, 1 enables listen in 1793cabdff1aSopenharmony_cisingle client mode, 2 enables listen in multi-client mode. Default value is 0. 1794cabdff1aSopenharmony_ci 1795cabdff1aSopenharmony_ci@item timeout=@var{microseconds} 1796cabdff1aSopenharmony_ciSet raise error timeout, expressed in microseconds. 1797cabdff1aSopenharmony_ci 1798cabdff1aSopenharmony_ciThis option is only relevant in read mode: if no data arrived in more 1799cabdff1aSopenharmony_cithan this time interval, raise error. 1800cabdff1aSopenharmony_ci 1801cabdff1aSopenharmony_ci@item listen_timeout=@var{milliseconds} 1802cabdff1aSopenharmony_ciSet listen timeout, expressed in milliseconds. 1803cabdff1aSopenharmony_ci 1804cabdff1aSopenharmony_ci@item recv_buffer_size=@var{bytes} 1805cabdff1aSopenharmony_ciSet receive buffer size, expressed bytes. 1806cabdff1aSopenharmony_ci 1807cabdff1aSopenharmony_ci@item send_buffer_size=@var{bytes} 1808cabdff1aSopenharmony_ciSet send buffer size, expressed bytes. 1809cabdff1aSopenharmony_ci 1810cabdff1aSopenharmony_ci@item tcp_nodelay=@var{1|0} 1811cabdff1aSopenharmony_ciSet TCP_NODELAY to disable Nagle's algorithm. Default value is 0. 1812cabdff1aSopenharmony_ci 1813cabdff1aSopenharmony_ci@emph{Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY.} 1814cabdff1aSopenharmony_ci 1815cabdff1aSopenharmony_ci@item tcp_mss=@var{bytes} 1816cabdff1aSopenharmony_ciSet maximum segment size for outgoing TCP packets, expressed in bytes. 1817cabdff1aSopenharmony_ci@end table 1818cabdff1aSopenharmony_ci 1819cabdff1aSopenharmony_ciThe following example shows how to setup a listening TCP connection 1820cabdff1aSopenharmony_ciwith @command{ffmpeg}, which is then accessed with @command{ffplay}: 1821cabdff1aSopenharmony_ci@example 1822cabdff1aSopenharmony_ciffmpeg -i @var{input} -f @var{format} tcp://@var{hostname}:@var{port}?listen 1823cabdff1aSopenharmony_ciffplay tcp://@var{hostname}:@var{port} 1824cabdff1aSopenharmony_ci@end example 1825cabdff1aSopenharmony_ci 1826cabdff1aSopenharmony_ci@section tls 1827cabdff1aSopenharmony_ci 1828cabdff1aSopenharmony_ciTransport Layer Security (TLS) / Secure Sockets Layer (SSL) 1829cabdff1aSopenharmony_ci 1830cabdff1aSopenharmony_ciThe required syntax for a TLS/SSL url is: 1831cabdff1aSopenharmony_ci@example 1832cabdff1aSopenharmony_citls://@var{hostname}:@var{port}[?@var{options}] 1833cabdff1aSopenharmony_ci@end example 1834cabdff1aSopenharmony_ci 1835cabdff1aSopenharmony_ciThe following parameters can be set via command line options 1836cabdff1aSopenharmony_ci(or in code via @code{AVOption}s): 1837cabdff1aSopenharmony_ci 1838cabdff1aSopenharmony_ci@table @option 1839cabdff1aSopenharmony_ci 1840cabdff1aSopenharmony_ci@item ca_file, cafile=@var{filename} 1841cabdff1aSopenharmony_ciA file containing certificate authority (CA) root certificates to treat 1842cabdff1aSopenharmony_cias trusted. If the linked TLS library contains a default this might not 1843cabdff1aSopenharmony_cineed to be specified for verification to work, but not all libraries and 1844cabdff1aSopenharmony_cisetups have defaults built in. 1845cabdff1aSopenharmony_ciThe file must be in OpenSSL PEM format. 1846cabdff1aSopenharmony_ci 1847cabdff1aSopenharmony_ci@item tls_verify=@var{1|0} 1848cabdff1aSopenharmony_ciIf enabled, try to verify the peer that we are communicating with. 1849cabdff1aSopenharmony_ciNote, if using OpenSSL, this currently only makes sure that the 1850cabdff1aSopenharmony_cipeer certificate is signed by one of the root certificates in the CA 1851cabdff1aSopenharmony_cidatabase, but it does not validate that the certificate actually 1852cabdff1aSopenharmony_cimatches the host name we are trying to connect to. (With other backends, 1853cabdff1aSopenharmony_cithe host name is validated as well.) 1854cabdff1aSopenharmony_ci 1855cabdff1aSopenharmony_ciThis is disabled by default since it requires a CA database to be 1856cabdff1aSopenharmony_ciprovided by the caller in many cases. 1857cabdff1aSopenharmony_ci 1858cabdff1aSopenharmony_ci@item cert_file, cert=@var{filename} 1859cabdff1aSopenharmony_ciA file containing a certificate to use in the handshake with the peer. 1860cabdff1aSopenharmony_ci(When operating as server, in listen mode, this is more often required 1861cabdff1aSopenharmony_ciby the peer, while client certificates only are mandated in certain 1862cabdff1aSopenharmony_cisetups.) 1863cabdff1aSopenharmony_ci 1864cabdff1aSopenharmony_ci@item key_file, key=@var{filename} 1865cabdff1aSopenharmony_ciA file containing the private key for the certificate. 1866cabdff1aSopenharmony_ci 1867cabdff1aSopenharmony_ci@item listen=@var{1|0} 1868cabdff1aSopenharmony_ciIf enabled, listen for connections on the provided port, and assume 1869cabdff1aSopenharmony_cithe server role in the handshake instead of the client role. 1870cabdff1aSopenharmony_ci 1871cabdff1aSopenharmony_ci@item http_proxy 1872cabdff1aSopenharmony_ciThe HTTP proxy to tunnel through, e.g. @code{http://example.com:1234}. 1873cabdff1aSopenharmony_ciThe proxy must support the CONNECT method. 1874cabdff1aSopenharmony_ci 1875cabdff1aSopenharmony_ci@end table 1876cabdff1aSopenharmony_ci 1877cabdff1aSopenharmony_ciExample command lines: 1878cabdff1aSopenharmony_ci 1879cabdff1aSopenharmony_ciTo create a TLS/SSL server that serves an input stream. 1880cabdff1aSopenharmony_ci 1881cabdff1aSopenharmony_ci@example 1882cabdff1aSopenharmony_ciffmpeg -i @var{input} -f @var{format} tls://@var{hostname}:@var{port}?listen&cert=@var{server.crt}&key=@var{server.key} 1883cabdff1aSopenharmony_ci@end example 1884cabdff1aSopenharmony_ci 1885cabdff1aSopenharmony_ciTo play back a stream from the TLS/SSL server using @command{ffplay}: 1886cabdff1aSopenharmony_ci 1887cabdff1aSopenharmony_ci@example 1888cabdff1aSopenharmony_ciffplay tls://@var{hostname}:@var{port} 1889cabdff1aSopenharmony_ci@end example 1890cabdff1aSopenharmony_ci 1891cabdff1aSopenharmony_ci@section udp 1892cabdff1aSopenharmony_ci 1893cabdff1aSopenharmony_ciUser Datagram Protocol. 1894cabdff1aSopenharmony_ci 1895cabdff1aSopenharmony_ciThe required syntax for an UDP URL is: 1896cabdff1aSopenharmony_ci@example 1897cabdff1aSopenharmony_ciudp://@var{hostname}:@var{port}[?@var{options}] 1898cabdff1aSopenharmony_ci@end example 1899cabdff1aSopenharmony_ci 1900cabdff1aSopenharmony_ci@var{options} contains a list of &-separated options of the form @var{key}=@var{val}. 1901cabdff1aSopenharmony_ci 1902cabdff1aSopenharmony_ciIn case threading is enabled on the system, a circular buffer is used 1903cabdff1aSopenharmony_cito store the incoming data, which allows one to reduce loss of data due to 1904cabdff1aSopenharmony_ciUDP socket buffer overruns. The @var{fifo_size} and 1905cabdff1aSopenharmony_ci@var{overrun_nonfatal} options are related to this buffer. 1906cabdff1aSopenharmony_ci 1907cabdff1aSopenharmony_ciThe list of supported options follows. 1908cabdff1aSopenharmony_ci 1909cabdff1aSopenharmony_ci@table @option 1910cabdff1aSopenharmony_ci@item buffer_size=@var{size} 1911cabdff1aSopenharmony_ciSet the UDP maximum socket buffer size in bytes. This is used to set either 1912cabdff1aSopenharmony_cithe receive or send buffer size, depending on what the socket is used for. 1913cabdff1aSopenharmony_ciDefault is 32 KB for output, 384 KB for input. See also @var{fifo_size}. 1914cabdff1aSopenharmony_ci 1915cabdff1aSopenharmony_ci@item bitrate=@var{bitrate} 1916cabdff1aSopenharmony_ciIf set to nonzero, the output will have the specified constant bitrate if the 1917cabdff1aSopenharmony_ciinput has enough packets to sustain it. 1918cabdff1aSopenharmony_ci 1919cabdff1aSopenharmony_ci@item burst_bits=@var{bits} 1920cabdff1aSopenharmony_ciWhen using @var{bitrate} this specifies the maximum number of bits in 1921cabdff1aSopenharmony_cipacket bursts. 1922cabdff1aSopenharmony_ci 1923cabdff1aSopenharmony_ci@item localport=@var{port} 1924cabdff1aSopenharmony_ciOverride the local UDP port to bind with. 1925cabdff1aSopenharmony_ci 1926cabdff1aSopenharmony_ci@item localaddr=@var{addr} 1927cabdff1aSopenharmony_ciLocal IP address of a network interface used for sending packets or joining 1928cabdff1aSopenharmony_cimulticast groups. 1929cabdff1aSopenharmony_ci 1930cabdff1aSopenharmony_ci@item pkt_size=@var{size} 1931cabdff1aSopenharmony_ciSet the size in bytes of UDP packets. 1932cabdff1aSopenharmony_ci 1933cabdff1aSopenharmony_ci@item reuse=@var{1|0} 1934cabdff1aSopenharmony_ciExplicitly allow or disallow reusing UDP sockets. 1935cabdff1aSopenharmony_ci 1936cabdff1aSopenharmony_ci@item ttl=@var{ttl} 1937cabdff1aSopenharmony_ciSet the time to live value (for multicast only). 1938cabdff1aSopenharmony_ci 1939cabdff1aSopenharmony_ci@item connect=@var{1|0} 1940cabdff1aSopenharmony_ciInitialize the UDP socket with @code{connect()}. In this case, the 1941cabdff1aSopenharmony_cidestination address can't be changed with ff_udp_set_remote_url later. 1942cabdff1aSopenharmony_ciIf the destination address isn't known at the start, this option can 1943cabdff1aSopenharmony_cibe specified in ff_udp_set_remote_url, too. 1944cabdff1aSopenharmony_ciThis allows finding out the source address for the packets with getsockname, 1945cabdff1aSopenharmony_ciand makes writes return with AVERROR(ECONNREFUSED) if "destination 1946cabdff1aSopenharmony_ciunreachable" is received. 1947cabdff1aSopenharmony_ciFor receiving, this gives the benefit of only receiving packets from 1948cabdff1aSopenharmony_cithe specified peer address/port. 1949cabdff1aSopenharmony_ci 1950cabdff1aSopenharmony_ci@item sources=@var{address}[,@var{address}] 1951cabdff1aSopenharmony_ciOnly receive packets sent from the specified addresses. In case of multicast, 1952cabdff1aSopenharmony_cialso subscribe to multicast traffic coming from these addresses only. 1953cabdff1aSopenharmony_ci 1954cabdff1aSopenharmony_ci@item block=@var{address}[,@var{address}] 1955cabdff1aSopenharmony_ciIgnore packets sent from the specified addresses. In case of multicast, also 1956cabdff1aSopenharmony_ciexclude the source addresses in the multicast subscription. 1957cabdff1aSopenharmony_ci 1958cabdff1aSopenharmony_ci@item fifo_size=@var{units} 1959cabdff1aSopenharmony_ciSet the UDP receiving circular buffer size, expressed as a number of 1960cabdff1aSopenharmony_cipackets with size of 188 bytes. If not specified defaults to 7*4096. 1961cabdff1aSopenharmony_ci 1962cabdff1aSopenharmony_ci@item overrun_nonfatal=@var{1|0} 1963cabdff1aSopenharmony_ciSurvive in case of UDP receiving circular buffer overrun. Default 1964cabdff1aSopenharmony_civalue is 0. 1965cabdff1aSopenharmony_ci 1966cabdff1aSopenharmony_ci@item timeout=@var{microseconds} 1967cabdff1aSopenharmony_ciSet raise error timeout, expressed in microseconds. 1968cabdff1aSopenharmony_ci 1969cabdff1aSopenharmony_ciThis option is only relevant in read mode: if no data arrived in more 1970cabdff1aSopenharmony_cithan this time interval, raise error. 1971cabdff1aSopenharmony_ci 1972cabdff1aSopenharmony_ci@item broadcast=@var{1|0} 1973cabdff1aSopenharmony_ciExplicitly allow or disallow UDP broadcasting. 1974cabdff1aSopenharmony_ci 1975cabdff1aSopenharmony_ciNote that broadcasting may not work properly on networks having 1976cabdff1aSopenharmony_cia broadcast storm protection. 1977cabdff1aSopenharmony_ci@end table 1978cabdff1aSopenharmony_ci 1979cabdff1aSopenharmony_ci@subsection Examples 1980cabdff1aSopenharmony_ci 1981cabdff1aSopenharmony_ci@itemize 1982cabdff1aSopenharmony_ci@item 1983cabdff1aSopenharmony_ciUse @command{ffmpeg} to stream over UDP to a remote endpoint: 1984cabdff1aSopenharmony_ci@example 1985cabdff1aSopenharmony_ciffmpeg -i @var{input} -f @var{format} udp://@var{hostname}:@var{port} 1986cabdff1aSopenharmony_ci@end example 1987cabdff1aSopenharmony_ci 1988cabdff1aSopenharmony_ci@item 1989cabdff1aSopenharmony_ciUse @command{ffmpeg} to stream in mpegts format over UDP using 188 1990cabdff1aSopenharmony_cisized UDP packets, using a large input buffer: 1991cabdff1aSopenharmony_ci@example 1992cabdff1aSopenharmony_ciffmpeg -i @var{input} -f mpegts udp://@var{hostname}:@var{port}?pkt_size=188&buffer_size=65535 1993cabdff1aSopenharmony_ci@end example 1994cabdff1aSopenharmony_ci 1995cabdff1aSopenharmony_ci@item 1996cabdff1aSopenharmony_ciUse @command{ffmpeg} to receive over UDP from a remote endpoint: 1997cabdff1aSopenharmony_ci@example 1998cabdff1aSopenharmony_ciffmpeg -i udp://[@var{multicast-address}]:@var{port} ... 1999cabdff1aSopenharmony_ci@end example 2000cabdff1aSopenharmony_ci@end itemize 2001cabdff1aSopenharmony_ci 2002cabdff1aSopenharmony_ci@section unix 2003cabdff1aSopenharmony_ci 2004cabdff1aSopenharmony_ciUnix local socket 2005cabdff1aSopenharmony_ci 2006cabdff1aSopenharmony_ciThe required syntax for a Unix socket URL is: 2007cabdff1aSopenharmony_ci 2008cabdff1aSopenharmony_ci@example 2009cabdff1aSopenharmony_ciunix://@var{filepath} 2010cabdff1aSopenharmony_ci@end example 2011cabdff1aSopenharmony_ci 2012cabdff1aSopenharmony_ciThe following parameters can be set via command line options 2013cabdff1aSopenharmony_ci(or in code via @code{AVOption}s): 2014cabdff1aSopenharmony_ci 2015cabdff1aSopenharmony_ci@table @option 2016cabdff1aSopenharmony_ci@item timeout 2017cabdff1aSopenharmony_ciTimeout in ms. 2018cabdff1aSopenharmony_ci@item listen 2019cabdff1aSopenharmony_ciCreate the Unix socket in listening mode. 2020cabdff1aSopenharmony_ci@end table 2021cabdff1aSopenharmony_ci 2022cabdff1aSopenharmony_ci@section zmq 2023cabdff1aSopenharmony_ci 2024cabdff1aSopenharmony_ciZeroMQ asynchronous messaging using the libzmq library. 2025cabdff1aSopenharmony_ci 2026cabdff1aSopenharmony_ciThis library supports unicast streaming to multiple clients without relying on 2027cabdff1aSopenharmony_cian external server. 2028cabdff1aSopenharmony_ci 2029cabdff1aSopenharmony_ciThe required syntax for streaming or connecting to a stream is: 2030cabdff1aSopenharmony_ci@example 2031cabdff1aSopenharmony_cizmq:tcp://ip-address:port 2032cabdff1aSopenharmony_ci@end example 2033cabdff1aSopenharmony_ci 2034cabdff1aSopenharmony_ciExample: 2035cabdff1aSopenharmony_ciCreate a localhost stream on port 5555: 2036cabdff1aSopenharmony_ci@example 2037cabdff1aSopenharmony_ciffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555 2038cabdff1aSopenharmony_ci@end example 2039cabdff1aSopenharmony_ci 2040cabdff1aSopenharmony_ciMultiple clients may connect to the stream using: 2041cabdff1aSopenharmony_ci@example 2042cabdff1aSopenharmony_ciffplay zmq:tcp://127.0.0.1:5555 2043cabdff1aSopenharmony_ci@end example 2044cabdff1aSopenharmony_ci 2045cabdff1aSopenharmony_ciStreaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern. 2046cabdff1aSopenharmony_ciThe server side binds to a port and publishes data. Clients connect to the 2047cabdff1aSopenharmony_ciserver (via IP address/port) and subscribe to the stream. The order in which 2048cabdff1aSopenharmony_cithe server and client start generally does not matter. 2049cabdff1aSopenharmony_ci 2050cabdff1aSopenharmony_ciffmpeg must be compiled with the --enable-libzmq option to support 2051cabdff1aSopenharmony_cithis protocol. 2052cabdff1aSopenharmony_ci 2053cabdff1aSopenharmony_ciOptions can be set on the @command{ffmpeg}/@command{ffplay} command 2054cabdff1aSopenharmony_ciline. The following options are supported: 2055cabdff1aSopenharmony_ci 2056cabdff1aSopenharmony_ci@table @option 2057cabdff1aSopenharmony_ci 2058cabdff1aSopenharmony_ci@item pkt_size 2059cabdff1aSopenharmony_ciForces the maximum packet size for sending/receiving data. The default value is 2060cabdff1aSopenharmony_ci131,072 bytes. On the server side, this sets the maximum size of sent packets 2061cabdff1aSopenharmony_civia ZeroMQ. On the clients, it sets an internal buffer size for receiving 2062cabdff1aSopenharmony_cipackets. Note that pkt_size on the clients should be equal to or greater than 2063cabdff1aSopenharmony_cipkt_size on the server. Otherwise the received message may be truncated causing 2064cabdff1aSopenharmony_cidecoding errors. 2065cabdff1aSopenharmony_ci 2066cabdff1aSopenharmony_ci@end table 2067cabdff1aSopenharmony_ci 2068cabdff1aSopenharmony_ci@c man end PROTOCOLS 2069