node-red-contrib-uddf-to-srt
v1.2.8
Published
Convert UDDF to SRT
Downloads
13
Readme
NOTE: this node has dependance on "xml2js", make sure this one installed on you npm environment before proceeding with uddf-to-srt installation.
To submit a bug: [email protected] Curent version of this node is tested with Apple Watch Ultra and iPhone diving case (Oceanic+), as well as with generic data extraction to uddf from Subsurface app.
The node called "uddf-to-srt" converts UDDF (Unified Dive Data Format), which is essentially an XML file containing various metadata about the diver, dive, computer, dive site, and dive profile, into SRT (SubRip Subtitle) format. This conversion involves parsing the entire UDDF data into JSON format, then selecting specific parameters such as dive time, depth, temperature (converted from Kelvin to Celsius), no-decompression time, and ascent rate. Note that for other set of parameters this node will try to adjust dynamically to all available and add them. These parameters are then formatted into SRT segments on output at msg.payload like:
1 00:00:00,000 --> 00:00:15,000 Dive Time: 00:00:00,000, Depth: 0.00m, Temp: 28.93°C No Deco Time: 100 minutes, Ascent Rate: 0.0 m/s 2 00:00:15,000 --> 00:00:30,000 Dive Time: 00:00:15,000, Depth: 0.10m, Temp: 28.93°C No Deco Time: 100 minutes, Ascent Rate: 0.0 m/s...
There are two nodes in the bundle. The second one, "uddf-to-srt-mini," performs the same task but with fewer parameters included in the SRT data. For example, it only includes dive time and depth (the minimum set of parameters):
1 00:00:00,000 --> 00:00:15,000 Dive Time: 00:00:00,000, Depth: 0.00m 2 00:00:15,000 --> 00:00:30,000 Dive Time: 00:00:15,000, Depth: 0.10m...
Setting in node ui: Time Shift (seconds) will allow to shift the time in seconds +/- to synchronize the srt content actual in dive in content of the video. The output (msg.payload) of these nodes is SRT data, which can be saved with the file extension *.srt. This SRT file can then be uploaded to platforms like YouTube or video editors to attach timed subtitles to your diving video. Setting in node ui: Time Shift (seconds) will allow to shift the time in seconds +/- to synchronize the srt content actual in dive in content of the video. Note that if subtitles timing will be below 00:00:00 (like 23:59:45) it will be not added to the actual timeline of srt in the video. Other output (msg.json) give you set of {counter: counter, startTime: startTime, endTime: endTime, vdetails: jsonDetails}