Difference between revisions of ".CL Command-line tools"
(Created) |
m (sound4.any.cl-proc: added Kubernetes Leader Election) |
||
(8 intermediate revisions by the same user not shown) | |||
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 |
+ | |||
+ | See also [[Cloud Process Configuration Storage]] | ||
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 |
− | + | ====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). ''NOTE: payload 97 allows receiving payload 96 or 97, to ease compatibility'' |
− | * <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: | + | *<code>-f ''frames''</code> : Frames Per Output Packet. Same as input if zero (default: <code>RTP_FRAMES</code>=0) |
− | * <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. | ||
− | ==== | + | ==== Kubernetes Leader Election ==== |
+ | Linux only, with environment variables: | ||
+ | |||
+ | * <code>LEADERELECTION_LEASENAME</code> : lease name | ||
+ | * <code>LEADERELECTION_NAMESPACE</code> : lease namespace | ||
+ | * Optional: | ||
+ | ** <code>LEADERELECTION_IFACE_IP</code> : define ID with this interface IP instead of hostname | ||
+ | ** <code>LEADERELECTION_WAITFORCREATE</code> : block before creating instance instead of after | ||
+ | ** <code>LEADERELECTION_LEASEDURATION</code> : lease duration | ||
+ | ** <code>LEADERELECTION_RENEWDEADLINE</code> : lease renew deadline | ||
+ | ** <code>LEADERELECTION_RETRYPERIOD</code> : lease retry period | ||
+ | |||
+ | When both <code>LEADERELECTION_LEASENAME</code> and <code>LEADERELECTION_NAMESPACE</code> are set and working, only one pod will process. | ||
+ | |||
+ | Duration are Go duration strings, like 3s, 100ms, ... | ||
+ | |||
+ | The pod needs access to apiGroups 'coordination.k8s.io' resources 'leases' for 'get', 'update', 'list' (and 'create' if not pre-created). | ||
− | * <code>-j ''json_port''</code> : port for TCP JSON (default: <code>PROC_PORT</code>=0) | + | ====Advanced access==== |
+ | |||
+ | *<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 === | + | Warning: there is no authentication protection on this socket, even if the web interface has some set up. |
+ | |||
+ | ====Web access authentication==== | ||
+ | Details are in the process library documentation. | ||
+ | |||
+ | If the storage '''is not yet initialized''', you can choose how to protect the web access. | ||
+ | |||
+ | There are 2 modes: | ||
+ | |||
+ | *Setup mode: you define a setup account, which can then create an administrator account. The setup account always keeps the access and can delete the administrator. | ||
+ | *Admin mode: you define the administrator, which will be the single administrator. | ||
+ | |||
+ | To select the mode, you have to put in the parameters | ||
+ | |||
+ | *SETUP_USER (and optionally SETUP_SECRET) to select Setup mode | ||
+ | *ADMIN_USER (and optionally ADMIN_SECRET) to select Admin mode | ||
+ | *none: the web access is opened, no login will be asked | ||
+ | |||
+ | If you do not set the xxx_SECRET, then the setup password will be randomly generated and print in logs (at info severity). | ||
+ | |||
+ | ===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=== | ||
+ | Linux [https://jackaudio.org/ JACK Audio Connection Kit] support. | ||
− | === sound4.''any''.cl- | + | Parameters : |
− | [https:// | + | |
+ | *<code>-C ''jack_name''</code> : JACK client name | ||
+ | *<code>-S ''jack_session''</code> : JACK session name | ||
+ | |||
+ | See also [[#Web interface|Web interface]], [[#Storage|Storage]] and [[#Advanced access|Advanced access]]. | ||
+ | ===sound4.''any''.cl-pipewire=== | ||
+ | Linux [https://pipewire.org/ PipeWire] support. | ||
Parameters : | Parameters : | ||
− | * <code>-C '' | + | *<code>-C ''name''</code> : client 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]] |
Latest revision as of 14:33, 7 June 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.
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
See also Cloud Process Configuration Storage
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). NOTE: payload 97 allows receiving payload 96 or 97, to ease compatibility-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. Same as input if zero (default:RTP_FRAMES
=0)-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.
Kubernetes Leader Election
Linux only, with environment variables:
LEADERELECTION_LEASENAME
: lease nameLEADERELECTION_NAMESPACE
: lease namespace- Optional:
LEADERELECTION_IFACE_IP
: define ID with this interface IP instead of hostnameLEADERELECTION_WAITFORCREATE
: block before creating instance instead of afterLEADERELECTION_LEASEDURATION
: lease durationLEADERELECTION_RENEWDEADLINE
: lease renew deadlineLEADERELECTION_RETRYPERIOD
: lease retry period
When both LEADERELECTION_LEASENAME
and LEADERELECTION_NAMESPACE
are set and working, only one pod will process.
Duration are Go duration strings, like 3s, 100ms, ...
The pod needs access to apiGroups 'coordination.k8s.io' resources 'leases' for 'get', 'update', 'list' (and 'create' if not pre-created).
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
Warning: there is no authentication protection on this socket, even if the web interface has some set up.
Web access authentication
Details are in the process library documentation.
If the storage is not yet initialized, you can choose how to protect the web access.
There are 2 modes:
- Setup mode: you define a setup account, which can then create an administrator account. The setup account always keeps the access and can delete the administrator.
- Admin mode: you define the administrator, which will be the single administrator.
To select the mode, you have to put in the parameters
- SETUP_USER (and optionally SETUP_SECRET) to select Setup mode
- ADMIN_USER (and optionally ADMIN_SECRET) to select Admin mode
- none: the web access is opened, no login will be asked
If you do not set the xxx_SECRET, then the setup password will be randomly generated and print in logs (at info severity).
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
Linux 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.
sound4.any.cl-pipewire
Linux PipeWire support.
Parameters :
-C name
: client name
See also Web interface, Storage and Advanced access.