Changes

Line 1: Line 1:  
==Server side configuration source code==
 
==Server side configuration source code==
 +
 +
'''NOTE: This is a "test server" version, dedicated for initial functionality testing (which could also be done via cloudview platform) with 1-2 cameras. Multithreaded (and multiple device) handling on the server side is up to the client to do additional development and/or necessary optimizations and modifications, to support more than 1-2 cameras at the same server instance.'''
 +
 +
Optionally - platforms that already support camera integrations could be used.
    
Together with the communication protocol, this server side source code can be downloaded and implemented upon personal servers for the ease of use and configuration, please see index.js, debug.js and protocol.js which can be copied into the server.  
 
Together with the communication protocol, this server side source code can be downloaded and implemented upon personal servers for the ease of use and configuration, please see index.js, debug.js and protocol.js which can be copied into the server.  
   −
Server files & source code can be downloaded [https://drive.teltonika.lt/f/51cf36cccc54430da753/?dl=1 here].  
+
Server files & source code can be downloaded [https://drive.teltonika.lt/f/e2a91c1a5f714123a544/?dl=1 here].  
    
Please see index.js, debug.js and protocol.js files. These files contain required support for camera downloads and they can be inserted straight into server. The folder can also be run as server and will work with file downloads, so if personal server is not available, there is always a possibility to use this default server.  
 
Please see index.js, debug.js and protocol.js files. These files contain required support for camera downloads and they can be inserted straight into server. The folder can also be run as server and will work with file downloads, so if personal server is not available, there is always a possibility to use this default server.  
Line 315: Line 319:  
'''Note: 0x000B command was added since 03.27.04.Rev.104 firmware version and would not work with older versions.'''
 
'''Note: 0x000B command was added since 03.27.04.Rev.104 firmware version and would not work with older versions.'''
 
<br>
 
<br>
   
Response command meta data:
 
Response command meta data:
 
{| class="wikitable"
 
{| class="wikitable"
Line 338: Line 341:  
|-  
 
|-  
 
|}
 
|}
 +
 +
==Converting Latitude and Longitude values to decimal==
 +
Latitude and Longitude values are being sent in HEX format, but to correctly parse them conversation from <b>HEX</b> to <b>Double</b>. Example:<br>
 +
The received value in HEX is 404B59A74E8E028D<br>
 +
<ol>
 +
<li>Convert the hexadecimal value to binary. The hex value <b>404B59A74E8E028D</b> can be converted to binary as <b>0100000001001011010110011010011101001110100011101110000001010001101</b>. </li>
 +
 +
<li>Determine the sign bit. The sign bit is the leftmost bit of the binary representation. A value of 0 indicates a positive number, while a value of 1 indicates a negative number. </li>
 +
 +
<li>Determine the exponent. The exponent is the next 11 bits after the sign bit. Subtract 1023 from the exponent value to obtain the actual exponent. In our example, the exponent bits "10000000100" correspond to the exponent value of 1028 (i.e., 2^10 + 2^3 = 1024 + 8 = 1032, and 1032 - 4 = 1028, since the bias for double precision is 1023). </li>
 +
 +
<li>Determine the significand. The significand is the remaining 52 bits after the sign bit and exponent. Add an implicit leading 1 to the significand to obtain a value between 1 and 2. In our example, the significand bits 0101101001110100011101010111010011100110000000010 correspond to a significand value of 1.3582693302319776. </li>
 +
 +
<li>Calculate the final value. The final value is determined by combining the sign bit, exponent, and significand according to the IEEE 754 standard for double-precision floating-point numbers. The formula is: (-1)^signbit x significand x 2^(exponent-1023). In our example, the final value is (-1)^0 x 1.3582693302319776 x 2^(1028-1023) = 54.7004183. <br>
 +
Therefore, the hexadecimal value 404B59A74E8E028D is equivalent to the double-precision floating-point value of approximately <b>54.7004183</b>. </ol>
 +
 +
[[File:HexToDecimal.png]]
    
==CRC-16 calculation==
 
==CRC-16 calculation==
Line 413: Line 433:  
For converting DualCam h265 videos to a more popular mp4 video format, a free open-source converter FFmpeg is used in the example. Although any other converter from h265 would work as well.
 
For converting DualCam h265 videos to a more popular mp4 video format, a free open-source converter FFmpeg is used in the example. Although any other converter from h265 would work as well.
   −
To convert DualCam video properly, the converter has to know the frame rate of the video. The frame rate is configured as Config Id: 66003 and could be either 20, 25, or 30 FPS. That same value could be obtained by using the metadata command (see more details at [[Teltonika_DualCam#Communication_protocol|File metadata response]] ('''CMD ID 0x000B''')).
+
To convert DualCam video properly, the converter has to know the frame rate of the video. The frame rate is configured as Config Id: 66003 and could be either 20, 25, or 30 FPS. That same value could be obtained by using the metadata command (see more details at File metadata response) ('''CMD ID 0x000B''').
    
Recommended parameters using the FFmpeg for the conversion:
 
Recommended parameters using the FFmpeg for the conversion:
Line 424: Line 444:     
<output> - file name of the video that will be converted to mp4.
 
<output> - file name of the video that will be converted to mp4.
 +
 +
==Additional audio converting from video file==
 +
This information is only for cameras that support sound recording
 +
 +
Please find attached files required for video converting, so there is also audio.
 +
 +
[https://drive.teltonika.lt/f/fd842e86a16344e681d8/?dl=1 Here]
 +
 +
When you receive a *.h265 file, you will need to convert it to *.mp4, by using the “VideoConverter.exe”.
 +
There is a *.bat file with an example.
 +
 +
The principle use is very simple. Instead of converting with the FFMPEG library, you just use the “VideoConverter.exe”:
 +
ZmConverter\VideoConverter.exe '''codec''' "path_to_input_file.h265" "path_to_converted_file.mp4"
 +
 +
Will receive with h265 codec:
 +
 +
[[File:Gauni_su_h265s.jpg|alt=|frameless|653x653px]]
 +
 +
To have the h264 codec:
 +
 +
[[File:H264s.jpg|alt=|frameless|660x660px]]
 +
 +
In the end, you will have this:
 +
 +
[[File:End_of_codec.jpg|alt=|frameless|658x658px]]
    
==Video files and conversion==
 
==Video files and conversion==