Streambuilder Monitor usage¶
While the Streambuilder service is running, you can get various information about the current state. For some modules, it is possible to change the parameters. These actions are performed through the http interface of the Streambuilder monitor. The configuration specifies the address of the monitor server - a tcp or unix socket can be specified:
monitor_address "0.0.0.0:22085" monitor_address "unix:/var/run/streambuilder/Channel.sock"
Streambuilder Monitor requests¶
Current working configuration¶
curl http://0.0.0.0:22085/config echo -e "GET /config HTTP/1.0\r\n" |sudo socat - /var/run/streambuilder/Channel.sock echo -e "GET /config HTTP/1.0\r\n" |sudo nc -U /var/run/streambuilder/sb_nst.sock
monitor answer
monitor_address 0.0.0.0:22701 logger { level { default 2 } readable_time yes listen "unix:/var/run/streambuilder/Channel.s" filename /var/log/streambuilder/Channel/streambuilder.log } stream { ...
Analizer module short information¶
monitor answer
Demuxer.v.0: tb 1/90000, pts: 6040811365 [67120.126], dts: 6040793365 [67119.926] VDecoder#Demuxer.v.0: tb 1/90000, pts: 6040784365 [67119.826], dts: 6040784365 [67119.826] VideoFilter: tb 1/90000, pts: 6040784365 [67119.826], dts: 6040784365 [67119.826] ImageResampler#resize_854x480: tb 1/90000, pts: 6040784365 [67119.826], dts: 6040784365 [67119.826] __logo#v_480p: tb 1/90000, pts: 6040784365 [67119.826], dts: 6040784365 [67119.826] v_480p: tb 1/25, pts: 1677989 [67119.560], dts: 1677987 [67119.480] AVRenum.v_480p: tb 1/25, pts: 26645 [ 1065.800], dts: 26643 [ 1065.720] Demuxer.a.0: tb 1/90000, pts: 6040733245 [67119.258], dts: 6040733245 [67119.258] ADecoder#Demuxer.a.0: tb 1/90000, pts: 6040733245 [67119.258], dts: 6040733245 [67119.258] AudioResampler: tb 1/90000, pts: 6040733245 [67119.258], dts: 6040733245 [67119.258] a_b128000: tb 1/44100, pts: 2959956757 [67119.201], dts: 2959956757 [67119.201] AVRenum.a_b128000: tb 1/44100, pts: 46985192 [ 1065.424], dts: 46985192 [ 1065.424]
Analizer module information¶
monitor answer
{ "channels": [ { "name": "CMoreStarsN", "status": "running", "uptime": "1323.6179999999999", "videostreams": [ { "name": "Demuxer.v.0", "status": "running", "uptime": "1323.6179999999999", "size": { "width": "1920", "height": "1080" }, ...
Common requests to modules¶
You can run queries against a specific module in the configuration. The request has the format <http-address of the monitor>/module/<module>/log, for example
curl http://0.0.0.0:22085/module/Logger/log
monitor answer
Logger:packet(dts=74651[2986.040] pts=74653[2986.120] P size=6235 stream(V name="AVRenum.v_480p" codec="h264_qsv" nv12 bitrate=1000000 timebase=1/25 extradatasize=49 848x480 fps=25/1 aspect=1/1 channel("CMoreStarsN" 1619430902910470 1/1000000))) Logger:packet(dts=131681255[2985.970] pts=131681255[2985.970] duration=1024[0.0232] I size=451 stream(A name="AVRenum.a_b128000" codec="libfdk_aac" bitrate=128000 timebase=1/44100 extradatasize=2 44100Hz ssize=2 sample_fmt="s16 16 " stereo channel("CMoreStarsN" 1619430902910470 1/1000000))) Logger:packet(dts=131682279[2985.993] pts=131682279[2985.993] duration=1024[0.0232] I size=343 stream(A name="AVRenum.a_b128000" codec="libfdk_aac" bitrate=128000 timebase=1/44100 extradatasize=2 44100Hz ssize=2 sample_fmt="s16 16 " stereo channel("CMoreStarsN" 1619430902910470 1/1000000))) ... Logger:packet(dts=74652[2986.080] pts=74652[2986.080] P size=3429 stream(V name="AVRenum.v_480p" codec="h264_qsv" nv12 bitrate=1000000 timebase=1/25 extradatasize=49 848x480 fps=25/1 aspect=1/1 channel("CMoreStarsN" 1619430902910470 1/1000000)))
It is also possible to query multiple service configuration modules at the same time. The request has the format <http-address of the monitor>/log?module=<module>&module=<module>
curl "http://0.0.0.0:22701/log?module=v_480p&module=a_b128000"
monitor answer
v_480p:packet(dts=1736082[69443.280] pts=1736087[69443.480] P size=14303 stream(V name="v_480p" codec="h264_qsv" nv12 bitrate=1000000 timebase=1/25 extradatasize=49 848x480 fps=25/1 aspect=1/1 channel("CMoreStarsN" 1619430902910470 1/1000000))) v_480p:packet(dts=1736083[69443.320] pts=1736085[69443.400] P size=2505 stream(V name="v_480p" codec="h264_qsv" nv12 bitrate=1000000 timebase=1/25 extradatasize=49 848x480 fps=25/1 aspect=1/1 channel("CMoreStarsN" 1619430902910470 1/1000000))) a_b128000:packet(dts=3062440724[69443.100] pts=3062440724[69443.100] duration=1024[0.0232] I size=342 stream(A name="a_b128000" codec="libfdk_aac" bitrate=128000 timebase=1/44100 extradatasize=2 44100Hz ssize=2 sample_fmt="s16 16 " stereo channel("CMoreStarsN" 1619430902910470 1/1000000))) a_b128000:packet(dts=3062441749[69443.124] pts=3062441749[69443.124] duration=1024[0.0232] I size=355 stream(A name="a_b128000" codec="libfdk_aac" bitrate=128000 timebase=1/44100 extradatasize=2 44100Hz ssize=2 sample_fmt="s16 16 " stereo channel("CMoreStarsN" 1619430902910470 1/1000000)))
It is also possible to make requests to modules to receive data passing through these modules in protobuf format
curl -s http://0.0.0.0:22085/module/Demuxer/pb >output.pb
Streambuilder modules¶
SceneDetector¶
Status query¶
GET /module/SceneDetector/status
Example of HTTP status query
curl http://127.0.0.1:22085/module/SceneDetector%231/status
Monitor response: “Ok” - normal signal (the picture is changing), “static” - static scene (slowly changing, for example, a stadium), freeze - the image is frozen or the screen with a static background
An image of the current scene¶
GET /module/SceneDetector/pic
Request a JPG image of the current scene:
curl http://127.0.0.1:22085/module/SceneDetector%231/pic
SceneDetector#1 - module name in configuration, %23 - # symbol url escaped
Channel name request¶
GET /module/SceneDetector/channel
Channel name request:
curl http://127.0.0.1:22085/module/SceneDetector%231/channel
—
AudioTrackSelector¶
HTTP API¶
Retrieving values:
curl http://127.0.0.1:22085/module/AudioTrackSelector%23main/showtrack curl http://127.0.0.1:22085/module/AudioTrackSelector%23main/gettrack
Setting new values:
curl "http://127.0.0.1:22085/module/AudioTrackSelector%23main/settrack?left=0&right=1"
—
Analyzer¶
The module is connected implicitly. Analyzes the information transmitted between the Streambuilder modules and issues it via the HTTP interface upon request
GET /module/Analyzer/dumpInfo
Short information
GET /module/Analyzer/shortInfo
—
PNGOverlay¶
Undo ovelay
GET /module/PNGOverlay/off
Enable overlay
GET /module/PNGOverlay/on
Get state
GET /module/PNGOverlay/getstate
Change overlay
GET /module/PNGOverlay/setshifts?x=<N>&y=<N>
Request example:
curl http://127.0.0.1:22085/module/PNGOverlay/setshifts?x=-3%25&y=10%25 echo -e "GET /module/PNGOverlay/setshifts?x=-8%25&y=3%25 HTTP/1.0\r\n" |socat - /var/run/streambuilder/Channel.sock
get current position
GET /module/PNGOverlay/getshifts
resizing
GET /module/PNGOverlay/setsize?x=<N>&y=<N>
<N> as in configuration
Request example:
curl http://127.0.0.1:22085/module/PNGOverlay/setsize?x=6%25&y=6%25
get dimensions
GET /module/PNGOverlay/getsize
—
FillGap¶
Counting the number of errors in the incoming stream
GET /module/FillGap/lost
Requests are made separately for each FillGap configuration module
Examples¶
video stream request
curl http://127.0.0.1:22085/module/FillGap%23video/lost
answer
{ "name": "VDecoder#Demuxer.v.0", "lost": "26", "time": "2015-Sep-30 10:40:04" }
audio stream request
curl http://127.0.0.1:22085/module/FillGap%23audio/lost
answer
{ "name": "ADecoder#Demuxer.a.0", "lost": "1", "time": "2015-Sep-30 10:40:28" }