Krad Radio/Commands
On this page we will list all commands to control krad radio and their parameters. Parameters with a default value specified in the table can be omitted. However, you need to specify them if you need to change the value of a parameter following a default one.
Most commands should be called like:
krad_radio sysname command whereas sysname is a unique identifier of the instance of krad radio you are targeting. This ID (sysname) has to be between 4 and 32 lowercase characters and numbers and must start with a character.
Commands that can be run without a sysname will mention that explicitly.
Station management and general commands
-v
Prints the krad radio version number. Use without a sysname
Example:
krad_radio -v
launch
Sets up a station by starting an instance of the krad_radio_daemon.
Example:
krad_radio sysname launch
destroy
Tears down a station by quitting the corresponding instance of the krad_radio_daemon.
Example:
krad_radio sysname destroy
setdir (directory)
?Sets working directory? and starts logging to a file in that directory. Snapshots of compositor-output is also stored there.
| Name | Type | Default value | Description |
|---|---|---|---|
| directory | string | mandatory | Path of directory to use for logfiles/snapshots |
Example:
krad_radio sysname setdir ~/krad_dir/
Notes:
- krad_radio_daemon will quit if the specified directory does not exist
logname
Returns the absolute path of the daemon's logfile or nothing if it doesn't do logging. Logging can be started by calling setdir.
Example:
krad_radio sysname logname
uptime
Shows how long the station has been running.
Example:
krad_radio sysname uptime
info
Displays generic info about your machine (hostname, architecture, kernel version)
Example:
krad_radio sysname info
Notes:
- Maybe we could print the version of krad_radio here or add another command for that
threads
Displays all krad radio threads that are currently running
Example:
krad_radio sysname threads
Notes:
- Not working? https://bugzilla.mozilla.org/show_bug.cgi?id=817271
Compositor commands
fps (numerator, denominator)
Sets the framerate used by the compositor for the resulting video. Needs to be called before the compositor produces output (before any source or transmitter/recorder is created). ?Default is 30 fps (or 30000/1001 fps)?
| Name | Type | Default value | Description |
|---|---|---|---|
| numerator | int | mandatory | Numerator of the framerate-fraction |
| denominator | int | 1 | Denominator of the framerate-fraction |
Examples:
krad_radio sysname fps 30krad_radio sysname fps 30000 / 1001
Notes:
- Shouldn't this display the current framerate when run w/o parameters? Or should it be as "setrate" and "rate"?
res (width, height)
Sets the resolution used by the compositor for the resulting video. This also sets the default resolution for recording and transmitting but these can scale to another resolution of you specify one when creating them. Needs to be called before the compositor produces output (before any source or transmitter/recorder is created). ?Default? 1280x700??
| Name | Type | Default value | Description |
|---|---|---|---|
| width | int | mandatory | Width of the image in pixel |
| height | int | mandatory | Height of the image in pixel |
Examples:
krad_radio sysname res 640 360krad_radio sysname res 320 200
Notes:
- Shouldn't this display the current resolution when run w/o parameters? Or should it be as "setrate" and "rate"?
vuon
Enables the display of a stereo VU-meter on the bottom of the video so you can see volume levels or whether the audio is in sync with the video. To be disabled using #vuoff.
Examples:
krad_radio sysname vuon
vuoff
Disables the display of the VU-meter that has been enabled using #vuon.
Examples:
krad_radio sysname vuoff
addtext (text, x, y, tickrate, scale, opacity, rotation, red, green, blue, font)
Adds a piece of text to the composited image. Most of the parameters can be modified later using the #settext PARAMETERS command.
| Name | Type | Default value | Description |
|---|---|---|---|
| text | string | mandatory | The text to be displayed |
| x | int | 32 | x-position where the text will be placed (which corner is placed there? middle? lower-left? upper-left?) |
| y | int | 32 | y-position where the text will be placed (which corner is placed there? middle? lower-left? upper-left?) |
| tickrate | int | 4 | Speed of animation (related to fps or not? higher value = faster or slower animation?) |
| scale | float | 20.0f | Scale of the text (Relative to resolution or not? units?) |
| opacity | float | 1.0f | 0 = transparent, 1 = opaque |
| rotation | float | 0 | degrees? max value = 1.0f or 359.99f ? |
| red | int | 244 | Text color, red component. 0-255 |
| green | int | 16 | Text color, green component. 0-255 |
| blue | int | 16 | Text color, blue component. 0-255 |
| font | string | sans | Font to be used for the text |
Examples:
krad_radio sysname addtext "some stupid text :D"krad_radio sysname addtext "https://github.com/kripton/KRAD_korg" 60 230 4 20.0f 1.0f 0.0f 0 255 0krad_radio sysname addtext "http://gist.github.com/4107143" 60 280 4 20.0f 1.0f 0.0f 255 0 0
setport (number, x, y, width, height, crop_x, crop_y, crop_width, crop_height, opacity, rotation
Modifies how a video input source is composited for the final image.
| Name | Type | Default value | Description |
|---|---|---|---|
| number | int | mandatory | Id of the port to be modified. Find out via #lc or #ls |
| x | int | mandatory | x-position where the port will be shown |
| y | int | mandatory | y-position where the port will be shown |
| width | int | mandatory | width to scale the port to (display width on the composited image) |
| height | int | mandatory | height to scale the port to (display height on the composited image) |
| crop_x | int | mandatory | x-value of the upper left corner of the cropping-region? after scaling? |
| crop_y | int | mandatory | y-value of the upper left corner of the cropping region? after scaling? |
| crop_width | int | mandatory | width of the region to be cropped to (after scaling?) |
| crop_height | int | mandatory | height of the region to be cropped to (after scaling?) |
| opacity | float | mandatory | Opacity of the port in the final composited image (0 = fully transparent, 1 = fully opaque) |
| rotation | float | mandatory | (degrees of rotation. max value = 359.99f or 0.99f?) |
Examples:
krad_radio sysname setport 2 0 40 160 120 0 0 160 120 1 0
addsprite (filename, x, y, tickrate, scale, opacity, rotation)
Adds a sprite (picture) to the composited picture. Currently, JPEG and PNG-images are supported.
| Name | Type | Default value | Description |
|---|---|---|---|
| filename | string | mandatory | The file to be displayed (relative to which directory?) |
| x | int | 0 | x-position where the image will be placed (which corner is placed there? middle? lower-left? upper-left?) |
| y | int | 0 | y-position where the image will be placed (which corner is placed there? middle? lower-left? upper-left?) |
| tickrate | int | 4 | Speed of animation (related to fps or not? higher value = faster or slower animation?) |
| scale | float | 1.0f | Scale of the image (1.0f is original size) |
| opacity | float | 1.0f | 0 = transparent, 1 = opaque |
| rotation | float | 0.0f | degrees? max value = 1.0f or 359.99f ? |
Examples:
krad_radio sysname addsprite /home/user/somefile.png 0 0 4 1.0f 0.8f 0.0f
Notes:
- There is such a thing as an "animated sprite" but I don't know how that works. Oneman can you explain plz?
Mixer commands
input (name, channels)
Creates an (always jack?) audio input to the internal audio mixer.
| Name | Type | Default value | Description |
|---|---|---|---|
| name | string | mandatory | Name of the input port |
| channels | int | 2 | Number of input channels. If this is greater than 8, the daemon will quit! |
Examples:
krad_radio sysname input mainkrad_radio sysname input mega 8
Notes:
- The jack client name is always the name of the station
- The jack ports of the client are named all have "name_" as prefix (name = value of parameter name). If you defined the channel number to be one, the jack port will have the value of the parameter name as name
- The port names will have these suffixes, in order: Left, Right, RearLeft, RearRight, Center, Sub, BackLeft, BackRight
rate
Will display the current used sample rate of the internal mixer.
Examples:
krad_radio sysname rate
Link commands
transmit (avmode, hostname, port, mountpoint, password, codecs, width, height, video_bitrate, audio_bitrate)
Sends the composited video, mixed audio or both to another instance of krad radio (that needs to be set-up for this using #listen_on (port)) or to an icecast-server.
| Name | Type | Default value | Description |
|---|---|---|---|
| avmode | ENUM (audio, video, audiovideo) | mandatory | What to transmit (audio only, video only or both) |
| hostname | string | mandatory | Hostname or IP-address to send the stream to |
| port | int | mandatory | TCP-port to send the stream to |
| mountpoint | string | mandatory | Mountpoint (name of the stream) to be used. Should start with a slash. |
| password | string | mandatory | Password for authentication with the server. Can be anything if sending to another KR-instance (really?). |
| codecs | string | NULL (means which ones?) | Codecs used to encode the audio and video. No need for spaces :) |
| width | int | 0 (= width of compositor's output) | width to the video |
| height | int | 0 (= height of compositor's output) | height of the video |
| video_bitrate | int | 0 (= what?) | Bitrate used to encode the video. (Unit ?) |
| audio_bitrate | string (why not int?) | "" (= what?) | Bitrate used to encode the audio. (Unit ?) |
Examples:
krad_radio sysname transmit audiovideo 127.0.0.1 12000 /test.webm MyPass "vp8 vorbis" 640 360 100krad_radio sysname transmit audio mywebradiohost.com 8000 /default.ogg MyPass "vorbis"krad_radio sysname transmit video another-kr-host.net 16000 /cam-2.ogg nopass "theora"
Notes:
- The daemon might quit if the password is wrong or the connection fails
- The daemon will not reconnect after the connection breaks
- Further encoding parameters (Theora quality, VP8 quantizer values, Opus parameters) can be set (globally?) using the #update (parameter, value) command
capture (video_source, device, width, height, fps_numerator, fps_denominator, avmode, audio_input, codec)
Opens a capture device and sends the data to the compositor. There is also a test pattern generator that can be started using the capture command.
| Name | Type | Default value | Description |
|---|---|---|---|
| video_source | ENUM (test, info, x11, decklink, v4l2) | mandatory | Defines the type of device to be captured |
| device | string | "" | Device to be opened. "dev/videoX" for v4l2 whereas "" means "/dev/video0" |
| width | int | 0 = native source width | width of the input video |
| height | int | 0 = native source height | height of the input video |
| fps_numerator | int | 0 = native source framerate | framerate of the input video |
| fps_denominator | int | 0 = native source framerate | framerate of the input video |
| avmode | ENUM (audio, video, audiovideo) | "audiovideo" for video_source = decklink, "video" otherwise | What to capture (audio only, video only or both). What if the device sends an encoded stream with audio? does such cam exist? |
| audio_input | string | "" | ??? (only used when video_source = decklink). What if I want to capture a v4l2-cam with sound via alsa? |
| codec | string | "" | ??? |
Examples:
krad_radio sysname capture testkrad_radio sysname capture v4l2 /dev/video1 640 480
Notes:
- The daemon might quit if the device does not exist or is not readable. (verified?)
- video_source = test generates an animated test screen with a RGB color test field, the current time, the elapsed time and the station name
- video_source = info generates a static test screen with the station name and VU meters (which are not static of course)
play (filename/hostname, port, mountpoint)
Plays back a locally stored file or a remote HTTP-stream (e.g. from an icecast-server) and adds it to the compositor.
| Name | Type | Default value | Description |
|---|---|---|---|
| filename/hostname | string | mandatory | Either the filename of the file to be played (relative to which directory?) or the Hostname/IP-address of the system hosting the stream |
| port | int | mandatory if stream | TCP-port on which stream is hosted |
| mountpoint | string | mandatory if stream | Mountpoint (name of the stream) to be played. Should start with a slash |
Examples:
krad_radio sysname play ~/somevideo.webmkrad_radio sysname play 127.0.0.1 8000 /mywebcam.ogg
Notes:
- The daemon might quit if the file does not exist, the stream-host cannot be connected to or there's no stream at the mountpoint. (verified?)
TODO
ls tag tags stag remoteon remoteoff webon weboff oscon oscoff setrate mix lm ll lc tone output rmport plug unplug map mixmap xmms2 noxmms2 listen_on listen_off link transmitter_on transmitter_off closedisplay display lstext rmtext lssprites rmsprite setsprite comp snap jsnap update receive record