nrkno / sofie-atem-connection

Sofie ATEM Connection: A Part of the Sofie TV Studio Automation System
https://github.com/nrkno/Sofie-TV-automation/
MIT License
129 stars 36 forks source link

Extract audio bitrates from SRSU #129

Closed bevand10 closed 1 year ago

bevand10 commented 1 year ago

A test across a wireshark-captured SRSU packet, where the stream AV settings xml are known to be 6mbit and 128kbit, returns:

node readSRSU.js
SRSU.hex
<Buffer 46 42 43 4c 69 76 65 00 00 00 00 00 00 50 72 70 00 00 00 00 00 00 00 00 00 20 43 50 43 43 64 50 07 01 05 03 00 00 00 00 00 01 00 00 00 50 72 70 00 00 ... 1306 more bytes>
{ from: 0, len: 64 }
{ serviceName: 'FBCLive' }
{ from: 64, len: 512 }
{ url: 'rtmps://a.rtmps.youtube.com/live2' }
{ from: 576, len: 512 }
{ key: 'p233-****-****-****-424h' }
{ from: 1088, len: 4 }
{ lowVideoBitrate: 6000000 }
{ from: 1092, len: 4 }
{ hiVideoBitrate: 6000000 }
{ from: 1104, len: 4 }
{ lowAudioBitrate: 128000 }
{ from: 1108, len: 4 }
{ hiAudioBitrate: 128000 }
bevand10 commented 1 year ago

Abandon as more work required to implement STAB cmd...

node readSRSU.js
SRSU.hex
<Buffer 04 50 00 00 53 52 53 55 46 42 43 4c 69 76 65 00 00 00 00 00 00 50 72 70 00 00 00 00 00 00 00 00 00 20 43 50 43 43 64 50 07 01 05 03 00 00 00 00 00 01 ... 1314 more bytes>
{ from: 0, len: 4 }
{ buflen: 1104 }
{ from: 4, len: 4 }
{ cmd: 'SRSU' }
{ from: 8, len: 64 }
{ serviceName: 'FBCLive' }
{ from: 72, len: 512 }
{ url: 'rtmps://a.rtmps.youtube.com/live2' }
{ from: 584, len: 512 }
{ key: 'p233-****-****-****-424h' }
{ from: 1096, len: 4 }
{ lowVideoBitrate: 6000000 }
{ from: 1100, len: 4 }
{ hiVideoBitrate: 6000000 }
{ from: 1104, len: 4 }
{ buflen2: 16 }
{ from: 1108, len: 4 }
{ cmd2: 'STAB' }
{ from: 1112, len: 4 }
{ lowAudioBitrate: 128000 }
{ from: 1116, len: 4 }
{ hiAudioBitrate: 128000 }
Julusian commented 1 year ago

https://github.com/LibAtem/LibAtem/blob/master/LibAtem/Commands/Streaming/StreamingAudioBitratesCommand.cs is a good reference for new commands :)