You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-2
Original file line number
Diff line number
Diff line change
@@ -100,16 +100,35 @@ Make sure you have [Elixir](https://elixir-lang.org/) installed. The first call
100
100
101
101
## CLI
102
102
103
-
The CLI API is similar to the Elixir API, for example:
103
+
The CLI API is a direct mapping of the Elixir API:
104
+
*`:input` and `:output` options of `Boombox.run/2` are mapped to `-i` and `-o` CLI arguments respectively.
105
+
* Option names, like `:some_option`, are mapped to CLI arguments by removing the colon, adding a leading double hyphen and replacing all underscores with hyphens, like `--some-option`.
106
+
* Option values mappings depend on the option's type:
107
+
- String values, like `"some_value"`, are mapped to CLI arguments by stripping the quotes, like `some_value`.
108
+
- Atom values, like `:some_value`, are mapped to CLI arguments by stripping the leading colon, like `some_value`.
109
+
- Integer values are identical in elixir and CLI.
110
+
- Binary values, like `<<161, 63>>`, are represented in CLI as their representation in base 16, like `a13f`.
Copy file name to clipboardExpand all lines: lib/boombox.ex
+29-36
Original file line number
Diff line number
Diff line change
@@ -22,54 +22,47 @@ defmodule Boombox do
22
22
]
23
23
24
24
@typedoc"""
25
-
Some encodings can/must be accompanied with encoding specific parameters:
26
-
* AAC:
27
-
- bitrate_mode - MUST be provided for both RTP input and output. Defines which mode should be assumed/set when depayloading/payloading.
28
-
- audio_specific_config - MUST be provided for RTP input. Contains crucial information about the stream and has to be obtained from a side channel.
29
-
* H264 and H265:
30
-
- vpss (H265 only), ppss, spss - MAY be provided for RTP input. picture and sequence parameter sets, could be obtained from a side channel. They contain information about the encoded stream.
25
+
When configuring a track for a media type (video or audio), the following options are used:
26
+
* <media_type>_encoding - MUST be provided to configure given media type. Some options are encoding-specific. Currently supported encodings are: AAC, Opus, H264, H265.
27
+
* <media_type>_payload_type, <media_type>_clock rate - MAY be provided. If not, an unofficial default will be used.
28
+
The following encoding-specific parameters are available for both RTP input and output:
29
+
* aac_bitrate_mode - MUST be provided for AAC encoding. Defines which mode should be assumed/set when depayloading/payloading.
In order to configure a RTP input a receiving port MUST be provided and the media that will be received
42
+
MUST be configured. Media configuration is explained further in `t:common_rtp_opt/0`.
47
43
48
-
@typedoc"""
49
-
In order to configure RTP input both a receiving port and media configurations must be provided.
50
-
At least one media type needs to be configured.
44
+
The following encoding-specific parameters are available for RTP input:
45
+
* audio_specific_config - MUST be provided for AAC encoding. Contains crucial information about the stream and has to be obtained from a side channel.
46
+
* vps (H265 only), pps, sps - MAY be provided for H264 or H265 encodings. Parameter sets, could be obtained from a side channel. They contain information about the encoded stream.
51
47
"""
52
48
@typein_rtp_opts::[
53
-
{:port,:inet.port_number()}
54
-
|{:track_configs,
55
-
[
56
-
{:audio,rtp_track_config()}
57
-
|{:video,rtp_track_config()}
58
-
]}
49
+
common_rtp_opt()
50
+
|{:port,:inet.port_number()}
51
+
|{:audio_specific_config,binary()}
52
+
|{:vps,binary()}
53
+
|{:pps,binary()}
54
+
|{:sps,binary()}
59
55
]
60
56
61
57
@typedoc"""
62
-
In order to configure RTP output the destination and media configurations must be provided.
63
-
At least one media type needs to be configured.
58
+
In order to configure a RTP output the target port and address MUST be provided (can be provided in `:target` option as a `<address>:<port>` string)
59
+
and the media that will be sent MUST be configured. Media configuration is explained further in `t:common_rtp_opt/0`.
0 commit comments