{"library":"sdp-transform","title":"SDP Transform","description":"sdp-transform is a robust JavaScript library designed for parsing and writing Session Description Protocol (SDP) strings, following the grammar defined by RFC4566, RFC5245, and other relevant standards. The current stable version is 3.0.0, published in late 2025. It differentiates itself by rigorously adhering to RFC specifications, automatically coercing numerical values to integers during parsing while keeping other values as strings. The library is built to be easily extendable for custom grammar, making it suitable for a wide range of WebRTC and multimedia signaling applications. It provides core functionalities to convert SDP strings into a structured JavaScript object and vice-versa, facilitating manipulation and generation of SDP messages. While there isn't an explicit release cadence, the project shows active maintenance with regular updates prior to the v3 release.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install sdp-transform"],"cli":null},"imports":["import { parse } from 'sdp-transform';","import { write } from 'sdp-transform';","import * as sdpTransform from 'sdp-transform';","import { parseParams } from 'sdp-transform';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { parse, write } from 'sdp-transform';\n\nconst sdpStr = \"v=0\\r\\n\" +\n  \"o=- 20518 0 IN IP4 203.0.113.1\\r\\n\" +\n  \"s= \\r\\n\" +\n  \"t=0 0\\r\\n\" +\n  \"c=IN IP4 203.0.113.1\\r\\n\" +\n  \"a=ice-ufrag:F7gI\\r\\n\" +\n  \"a=ice-pwd:x9cml/YzichV2+XlhiMu8g\\r\\n\" +\n  \"a=fingerprint:sha-1 42:89:c5:c6:55:9d:6e:c8:e8:83:55:2a:39:f9:b6:eb:e9:a3:a9:e7\\r\\n\" +\n  \"m=audio 54400 RTP/SAVPF 0 96\\r\\n\" +\n  \"a=rtpmap:0 PCMU/8000\\r\\n\" +\n  \"a=rtpmap:96 opus/48000\\r\\n\" +\n  \"a=ptime:20\\r\\n\" +\n  \"a=sendrecv\\r\\n\" +\n  \"a=candidate:0 1 UDP 2113667327 203.0.113.1 54400 typ host\\r\\n\" +\n  \"a=candidate:1 2 UDP 2113667326 203.0.113.1 54401 typ host\\r\\n\" +\n  \"m=video 55400 RTP/SAVPF 97 98\\r\\n\" +\n  \"a=rtpmap:97 H264/90000\\r\\n\" +\n  \"a=fmtp:97 profile-level-id=4d0028;packetization-mode=1\\r\\n\" +\n  \"a=rtpmap:98 VP8/90000\\r\\n\" +\n  \"a=sendrecv\\r\\n\" +\n  \"a=candidate:0 1 UDP 2113667327 203.0.113.1 55400 typ host\\r\\n\" +\n  \"a=candidate:1 2 UDP 2113667326 203.0.113.1 55401 typ host\\r\\n\";\n\nconst parsedSdp = parse(sdpStr);\nconsole.log('Parsed SDP object:', JSON.stringify(parsedSdp, null, 2));\n\n// Modify the parsed SDP object (example: change audio port)\nif (parsedSdp.media && parsedSdp.media[0]) {\n  parsedSdp.media[0].port = 54402;\n}\n\nconst modifiedSdpStr = write(parsedSdp);\nconsole.log('Modified SDP string:\\n', modifiedSdpStr);\n\n// Example of using a helper parser\nif (parsedSdp.media && parsedSdp.media[1] && parsedSdp.media[1].fmtp && parsedSdp.media[1].fmtp[0]) {\n  import { parseParams } from 'sdp-transform';\n  const fmtpParams = parseParams(parsedSdp.media[1].fmtp[0].config);\n  console.log('Parsed fmtp parameters:', fmtpParams);\n}","lang":"typescript","description":"This quickstart demonstrates parsing an SDP string into a structured object, modifying it, and then writing the object back to an SDP string. It also shows how to use a helper function like `parseParams`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}