Using Ascp4 for Streaming Video
Ascp4 can be used for streaming as well as regular file transfers. The syntax is similart to a regular ascp4 file transfer, but the source and destination are URI paths.
Required Configuration for Multicast-to-Multicast Transfers
The transfer user who authenticates the multicast-to-multicast video stream transfer must have no docroot configured in aspera.conf. A file restriction can be set instead to restrict access.
Run the following command to unset a docroot and set a file restriction:
$ asconfigurator -x "set_user_data;user_name,username;absolute,AS_NULL;file_restriction,|restriction"
The restriction can be set to allow all access (*) or limited by protocol, hostname or path:
| Restriction | Format Example |
|---|---|
| By protocol | udp://* tcp://* |
| By protocol and hostname | udp://hostname* |
| By protocol, hostname, and port | tcp://hostname:5000* |
Basic Ascp4 Usage for Streaming
$ ascp4 -l target_rate --mode=mode --host=remote_hostname --compression=none --user=username --read-threads=1 --write-threads=1 input_uri output_uri
- The ascp4 -l target rate option should be sent to a value that is equal to or greater than the bitrate of the video.
- ascp4 streaming supports two transfer directions: send and recv.
- The ascp4 command defaults to multiple threads, but for reliable and
in-order transport of streams you must use only one read and write thread by specifying
--read-threads=1 --write-threads=1. - The video stream source and destination can be udp://, tcp://, or file://. For more information, see Built-in I/O Providers
For command line usage examples, see Ascp4 Video Streaming Examples.
For detailed information about ascp4 options, see Ascp4 Command Reference.
Multicast URI Syntax
The input multicast URI and the output multicast URI uses the same syntax.multicast_protocol_scheme://stream_ip_address:port?option=value&option=value...The multicast protocol scheme can be either udp or mcast. If the IP address of your video stream is a multicast address, ascp4 uses multicast regardless of the protocol scheme (in other words, both udp and mcast use multicast). In order to use unicast addresses, you must use the udp scheme.
You can configure properties of the stream by adding options to the URI after the question mark (?), each separated by an ampersand (&). The following table describes the supported options.
| Option | Description | Default |
|---|---|---|
pktbatch={1|0} |
How to handle packet read and write. If 1, batch read and write UDP datagrams. If 0, read and write one packet at a time. | 1 |
batchmicros=N
|
Timeout for batching, in microseconds. | No default |
maxsize=maximum_size |
Maximum stream length | No default |
maxtime=maximum_time |
Maximum stream duration, in seconds | No default |
maxidle=maximum_time |
Maximum idle duration, in seconds | No default |
rcvbufsz=buffer_size |
Receive buffer size | 10MB |
sndbufsz=buffer_size |
Send buffer size | 10MB |
ifaddr=ip_address |
Multicast interface IP address | 0.0.0.0 |
srcaddr=ip_address |
Multicast source IP address | 0.0.0.0 |
ttl=hops |
Multicast time-to-live | 1 |
loopback=boolean |
Multicast loopback | 1 |