Difference between revisions of ".CL Command-line tools"
(Created) |
|||
Line 5: | Line 5: | ||
Each tool support <code>-h</code> parameter to get help. | Each tool support <code>-h</code> parameter to get help. | ||
− | === sound4.''any''.cl-proc === | + | ===sound4.''any''.cl-proc=== |
This is the generic processor, which can be used for RTP or raw audio. | This is the generic processor, which can be used for RTP or raw audio. | ||
Line 12: | Line 12: | ||
Some parameters can be passed via environment variable. In this case, the help shows those variable. | Some parameters can be passed via environment variable. In this case, the help shows those variable. | ||
− | ==== License ==== | + | ====License==== |
You need to provide license information to the instance. | You need to provide license information to the instance. | ||
− | * <code>-u ''loginkey''</code> : User ID for License (''default from env'' <code>S4LOGINKEY</code>) | + | *<code>-u ''loginkey''</code> : User ID for License (''default from env'' <code>S4LOGINKEY</code>) |
− | * <code>-n ''radioname''</code> : Radioname for License (''default from env'' <code>RADIO_NAME)</code> | + | *<code>-n ''radioname''</code> : Radioname for License (''default from env'' <code>RADIO_NAME)</code> |
− | * ''env only'' <code>S4_AWS_ACCESS_KEY_ID</code> : the license key ID | + | *''env only'' <code>S4_AWS_ACCESS_KEY_ID</code> : the license key ID |
− | * ''env only'' <code>S4_AWS_SECRET_ACCESS_KEY</code> : the license key secret | + | *''env only'' <code>S4_AWS_SECRET_ACCESS_KEY</code> : the license key secret |
− | ==== Web interface ==== | + | ====Web interface==== |
Start a web browser to setup this instance. | Start a web browser to setup this instance. | ||
Parameters: | Parameters: | ||
− | * <code>-w ''http_port''</code> : port to listen for HTTP (current:0) | + | *<code>-w ''http_port''</code> : port to listen for HTTP (current:0) |
− | * <code>-s ''https_port''</code>: port to listen for HTTPS (current:0) | + | *<code>-s ''https_port''</code>: port to listen for HTTPS (current:0) |
HTTPS needs a certificate, which information is in env variables: | HTTPS needs a certificate, which information is in env variables: | ||
− | * <code>SSL_CERTIFICATE_PATH</code> : the certificate | + | *<code>SSL_CERTIFICATE_PATH</code> : the certificate |
− | * <code>SSL_PRIVATE_PATH</code> : the certificate private key | + | *<code>SSL_PRIVATE_PATH</code> : the certificate private key |
− | ==== Storage ==== | + | ====Storage==== |
The instance needs to have a storage directory to save its state and its presets. | The instance needs to have a storage directory to save its state and its presets. | ||
Parameters: | Parameters: | ||
− | * <code>-D ''storepath''</code> : Storage path (default: <code>STATE_DIR</code>) | + | *<code>-D ''storepath''</code> : Storage path (default: <code>STATE_DIR</code>) |
You can have multiple instances using the same storage folder, so they can share their presets. | You can have multiple instances using the same storage folder, so they can share their presets. | ||
Line 44: | Line 44: | ||
But in this case, you should give each a different statename, so each has its own settings and onair preset. | But in this case, you should give each a different statename, so each has its own settings and onair preset. | ||
− | * <code>-N ''statename''</code> : Storage state filename, if sharing storepath between instances | + | *<code>-N ''statename''</code> : Storage state filename, if sharing storepath between instances |
Also, if you want instances to follow the onair preset, you can set them the same onairname : changing preset on one instance will change for all at the same time. | Also, if you want instances to follow the onair preset, you can set them the same onairname : changing preset on one instance will change for all at the same time. | ||
− | * <code>-O ''onairname''</code> : Storage onair filename, if sharing storepath between instances | + | *<code>-O ''onairname''</code> : Storage onair filename, if sharing storepath between instances |
Special storage information : | Special storage information : | ||
− | * <code>-R</code> : Storage is read-only | + | *<code>-R</code> : Storage is read-only |
− | * <code>-S</code> : Storage state is read-only | + | *<code>-S</code> : Storage state is read-only |
<br /> | <br /> | ||
− | ==== Audio I/O ==== | + | ====Audio I/O==== |
Parameters: | Parameters: | ||
− | * <code>-i ''ip|lwr''</code> : Livewire channel in or UDP listening specific IP (use for broadcast) (default <code>RTP_SRC_IP</code>) | + | *<code>-i ''ip|lwr''</code> : Livewire channel in or UDP listening specific IP (use for broadcast) (default <code>RTP_SRC_IP</code>) |
− | * <code>-p ''port''</code> : UDP listening port (default: <code>RTP_SRC_PORT</code>=5000) | + | *<code>-p ''port''</code> : UDP listening port (default: <code>RTP_SRC_PORT</code>=5000) |
− | * <code>-I ''dstip|lwr''</code> : Livewire channel out or Send back to this IP if zero (default <code>RTP_DEST_IP</code>=0.0.0.0) | + | *<code>-I ''dstip|lwr''</code> : Livewire channel out or Send back to this IP if zero (default <code>RTP_DEST_IP</code>=0.0.0.0) |
− | * <code>-P ''dstport''</code> : Send back to this port (default: <code>RTP_DEST_PORT</code>=5004) | + | *<code>-P ''dstport''</code> : Send back to this port (default: <code>RTP_DEST_PORT</code>=5004) |
− | * <code>-B ''ip''</code> : IP to bind for input. Uses source IP if not given (default <code>RTP_BIND_IP</code>=0.0.0.0) | + | *<code>-B ''ip''</code> : IP to bind for input. Uses source IP if not given (default <code>RTP_BIND_IP</code>=0.0.0.0) |
− | * <code>-G ''ip''</code> : IP to bind for output (default: <code>RTP_OUT_BIND_IP</code>=0.0.0.0) | + | *<code>-G ''ip''</code> : IP to bind for output (default: <code>RTP_OUT_BIND_IP</code>=0.0.0.0) |
− | * <code>-t ''pt''</code> : Rcv/Send Payload Type (default: <code>RTP_PAYLOAD</code>=96) | + | *<code>-t ''pt''</code> : Rcv/Send Payload Type (default: <code>RTP_PAYLOAD</code>=96) |
− | * <code>-F ''format''</code> : Sample format (default: <code>RTP_SAMPLE_FORMAT</code>=S16_BE) (S16_LE, S16_BE, S24_LE, S24_BE, S32_LE, S32_BE, F32_LE, F32_BE) | + | *<code>-F ''format''</code> : Sample format (default: <code>RTP_SAMPLE_FORMAT</code>=S16_BE) (S16_LE, S16_BE, S24_LE, S24_BE, S32_LE, S32_BE, F32_LE, F32_BE) |
− | * <code>-f ''frames''</code> : Frames Per Output Packet (default: same as received) | + | *<code>-f ''frames''</code> : Frames Per Output Packet (default: same as received) |
− | * <code>-c ''channels''</code> : Channels in RTP stream (default: <code>RTP_CHANNELS</code>=2) | + | *<code>-c ''channels''</code> : Channels in RTP stream (default: <code>RTP_CHANNELS</code>=2) |
− | * <code>-r</code> : RAW mode, get audio from stdin in float32 native 48000Hz stereo, send it to stdout. | + | *<code>-r</code> : RAW mode, get audio from stdin in float32 native 48000Hz stereo, send it to stdout. |
− | ===== RTP Input/Output ===== | + | =====RTP Input/Output===== |
Example: process locally received audio on port 5004, send the processed to 10.3.1.25 port 5004 | Example: process locally received audio on port 5004, send the processed to 10.3.1.25 port 5004 | ||
<code>sound4.impact.cl-proc -i 127.0.0.1 -p 5004 -I 10.3.1.25 -P 5004 -F S16_BE -w 8080</code> | <code>sound4.impact.cl-proc -i 127.0.0.1 -p 5004 -I 10.3.1.25 -P 5004 -F S16_BE -w 8080</code> | ||
− | ===== AES67 Input/Output ===== | + | =====AES67 Input/Output===== |
Example: receive from 239.4.27.1, send to 239.4.83.1 | Example: receive from 239.4.27.1, send to 239.4.83.1 | ||
Line 84: | Line 84: | ||
Note: there is no advertising | Note: there is no advertising | ||
− | ===== Livewire Input/Output ===== | + | =====Livewire Input/Output===== |
Example: receive from channel 1001, send to 2001 | Example: receive from channel 1001, send to 2001 | ||
Line 91: | Line 91: | ||
Note: there is no advertising | Note: there is no advertising | ||
− | ===== Raw audio ===== | + | =====Raw audio===== |
This uses stdin and stdout for audio, so you can use another program to provide and to play audio. | This uses stdin and stdout for audio, so you can use another program to provide and to play audio. | ||
Line 100: | Line 100: | ||
For this sample, audio can be sent with <code>ffmpeg -re -i myfile.mp3 -map a:0 -acodec libmp3lame -f rtp udp://127.0.0.1:5000</code> | For this sample, audio can be sent with <code>ffmpeg -re -i myfile.mp3 -map a:0 -acodec libmp3lame -f rtp udp://127.0.0.1:5000</code> | ||
− | ==== Advanced parameters ==== | + | ====Advanced parameters==== |
− | * <code>-a ''key=value''</code> : Add parameter | + | *<code>-a ''key=value''</code> : Add parameter |
− | * <code>-m ''key=value''</code> : Add metadata | + | *<code>-m ''key=value''</code> : Add metadata |
For parameters and metadata, see libraries documentation. | For parameters and metadata, see libraries documentation. | ||
− | ==== Advanced access ==== | + | ====Advanced access==== |
− | * <code>-j ''json_port''</code> : port for TCP JSON (default: <code>PROC_PORT</code>=0) | + | *<code>-j ''json_port''</code> : port for TCP JSON (default: <code>PROC_PORT</code>=0) |
This starts a server for the [[Cloud JSON Protocol]]. It can be used to have a separate interface web server | This starts a server for the [[Cloud JSON Protocol]]. It can be used to have a separate interface web server | ||
− | === sound4.''any''.cl-server === | + | ===sound4.''any''.cl-server=== |
Separate interface web server, which can be used if you want a different container for processing and interface. | Separate interface web server, which can be used if you want a different container for processing and interface. | ||
− | * <code>-i ''process_ip''</code> : IP address of the process to connect to (env <code>PROC_IP</code>) | + | *<code>-i ''process_ip''</code> : IP address of the process to connect to (env <code>PROC_IP</code>) |
− | * <code>-p ''process_port''</code> : port of the process to connect to (env <code>PROC_PORT</code>) | + | *<code>-p ''process_port''</code> : port of the process to connect to (env <code>PROC_PORT</code>) |
For other parameters, see [[#Web interface|Web interface]] : | For other parameters, see [[#Web interface|Web interface]] : | ||
− | * <code>-w ''http_port''</code> : port to listen for HTTP (env <code>HTTP_PORT</code>) | + | *<code>-w ''http_port''</code> : port to listen for HTTP (env <code>HTTP_PORT</code>) |
− | * <code>-s ''https_port''</code> : port to listen for HTTPS (env <code>HTTPS_PORT</code>) | + | *<code>-s ''https_port''</code> : port to listen for HTTPS (env <code>HTTPS_PORT</code>) |
− | === sound4.''any''.cl-jack === | + | ===sound4.''any''.cl-jack=== |
[https://jackaudio.org/ JACK Audio Connection Kit] support. | [https://jackaudio.org/ JACK Audio Connection Kit] support. | ||
Parameters : | Parameters : | ||
− | * <code>-C ''jack_name''</code> : JACK client name | + | *<code>-C ''jack_name''</code> : JACK client name |
− | * <code>-S ''jack_session''</code> : JACK session name | + | *<code>-S ''jack_session''</code> : JACK session name |
See also [[#Web interface|Web interface]], [[#Storage|Storage]] and [[#Advanced access|Advanced access]]. | See also [[#Web interface|Web interface]], [[#Storage|Storage]] and [[#Advanced access|Advanced access]]. | ||
+ | [[Category:Cloud]] |
Revision as of 10:14, 14 February 2024
Each .CL library offers some command-line programs.
They can be used to provide input/output audio to the processing library.
Each tool support -h
parameter to get help.
Contents
sound4.any.cl-proc
This is the generic processor, which can be used for RTP or raw audio.
It is the preferred way to use it in a container (see Cloud Containerization).
Some parameters can be passed via environment variable. In this case, the help shows those variable.
License
You need to provide license information to the instance.
-u loginkey
: User ID for License (default from envS4LOGINKEY
)-n radioname
: Radioname for License (default from envRADIO_NAME)
- env only
S4_AWS_ACCESS_KEY_ID
: the license key ID - env only
S4_AWS_SECRET_ACCESS_KEY
: the license key secret
Web interface
Start a web browser to setup this instance.
Parameters:
-w http_port
: port to listen for HTTP (current:0)-s https_port
: port to listen for HTTPS (current:0)
HTTPS needs a certificate, which information is in env variables:
SSL_CERTIFICATE_PATH
: the certificateSSL_PRIVATE_PATH
: the certificate private key
Storage
The instance needs to have a storage directory to save its state and its presets.
Parameters:
-D storepath
: Storage path (default:STATE_DIR
)
You can have multiple instances using the same storage folder, so they can share their presets.
But in this case, you should give each a different statename, so each has its own settings and onair preset.
-N statename
: Storage state filename, if sharing storepath between instances
Also, if you want instances to follow the onair preset, you can set them the same onairname : changing preset on one instance will change for all at the same time.
-O onairname
: Storage onair filename, if sharing storepath between instances
Special storage information :
-R
: Storage is read-only-S
: Storage state is read-only
Audio I/O
Parameters:
-i ip|lwr
: Livewire channel in or UDP listening specific IP (use for broadcast) (defaultRTP_SRC_IP
)-p port
: UDP listening port (default:RTP_SRC_PORT
=5000)-I dstip|lwr
: Livewire channel out or Send back to this IP if zero (defaultRTP_DEST_IP
=0.0.0.0)-P dstport
: Send back to this port (default:RTP_DEST_PORT
=5004)-B ip
: IP to bind for input. Uses source IP if not given (defaultRTP_BIND_IP
=0.0.0.0)-G ip
: IP to bind for output (default:RTP_OUT_BIND_IP
=0.0.0.0)-t pt
: Rcv/Send Payload Type (default:RTP_PAYLOAD
=96)-F format
: Sample format (default:RTP_SAMPLE_FORMAT
=S16_BE) (S16_LE, S16_BE, S24_LE, S24_BE, S32_LE, S32_BE, F32_LE, F32_BE)-f frames
: Frames Per Output Packet (default: same as received)-c channels
: Channels in RTP stream (default:RTP_CHANNELS
=2)-r
: RAW mode, get audio from stdin in float32 native 48000Hz stereo, send it to stdout.
RTP Input/Output
Example: process locally received audio on port 5004, send the processed to 10.3.1.25 port 5004
sound4.impact.cl-proc -i 127.0.0.1 -p 5004 -I 10.3.1.25 -P 5004 -F S16_BE -w 8080
AES67 Input/Output
Example: receive from 239.4.27.1, send to 239.4.83.1
sound4.impact.cl-proc -i 239.4.27.1 -p 5004 -I 239.4.83.1 -P 5004 -F S24_BE -w 8080
Note: there is no advertising
Livewire Input/Output
Example: receive from channel 1001, send to 2001
sound4.impact.cl-proc -i 1001 -I 2001 -w 8080
Note: there is no advertising
Raw audio
This uses stdin and stdout for audio, so you can use another program to provide and to play audio.
Example: process RTP stream received on port 5000 and play it
ffmpeg -i rtp://127.0.0.1:5000 -ar 48000 -ac 2 -f f32le - | sound4.impact.cl-proc -r -w 8080 | ffplay -f f32le -ar 48000 -ac 2 -i -
For this sample, audio can be sent with ffmpeg -re -i myfile.mp3 -map a:0 -acodec libmp3lame -f rtp udp://127.0.0.1:5000
Advanced parameters
-a key=value
: Add parameter-m key=value
: Add metadata
For parameters and metadata, see libraries documentation.
Advanced access
-j json_port
: port for TCP JSON (default:PROC_PORT
=0)
This starts a server for the Cloud JSON Protocol. It can be used to have a separate interface web server
sound4.any.cl-server
Separate interface web server, which can be used if you want a different container for processing and interface.
-i process_ip
: IP address of the process to connect to (envPROC_IP
)-p process_port
: port of the process to connect to (envPROC_PORT
)
For other parameters, see Web interface :
-w http_port
: port to listen for HTTP (envHTTP_PORT
)-s https_port
: port to listen for HTTPS (envHTTPS_PORT
)
sound4.any.cl-jack
JACK Audio Connection Kit support.
Parameters :
-C jack_name
: JACK client name-S jack_session
: JACK session name
See also Web interface, Storage and Advanced access.