Integration of photo and video capable devices to Traccar

Aliaksei 2 years ago

Dear Traccar team,

We have the following scheme of operation: device <=> flespi => Traccar. The streaming of parsed device messages from flespi to Traccar is done the following way.

These messages are received by Traccar using FlespiProtocolDecoder which was originally implemented by our team and now is being maintained by you.

Now we added to flespi video and photo functionality with already integrated Teltonika Dualcam and Dashcam, Streamax and Howen.

In the integration between flespi and Traccar everything works smoothly however we would like to add to the message the link to a stored media (photo or video) or as an alternative upload it to the Traccar (if no external links are possible in Traccar). The link is available inside media.video object (url field) of JSON message that is send to Traccar from flespi. Sample JSON of such message with the media data is the following:

{"channel.id":2913,"device.id":100,"device.name":"XXXX","device.type.id":157,"ident":"abcde","media.video":{"created":1696946841,"meta":{"duration":5.804444,"has_audio":true,"height":1280,"type":"video","video_codec":"h264","width":720},"mime":"video/mp4","name":"VID_2023-10-10_14-07-21+0000.mp4","size":2534058,"url":"https://media.flespi.io/E8BD9933CDED15080000358023036F0F6200000000000000D51F7A8CF551A7B8","uuid":"E8BD9933CDED15080000358023036F0F6200000000000000D51F7A8CF551A7B8"},"peer":"telegram","position.latitude":54.715732,"position.longitude":25.278173,"position.speed":0,"protocol.id":35,"server.timestamp":1696946844.582111,"timestamp":1696946841}

The goal is to provide Traccar with video/photo functionality when the user is able to access media by the link preferably inside the Modern Web App. Can you suggest under which position constant to store the link to the image to that everything will work beautifully and natively inside Traccar? Something like:

position.set(Position.KEY_PHOTO_URL, ((JsonString) UrlValue).getString());
position.set(Position.KEY_VIDEO_URL, ((JsonString) UrlValue).getString());

In general if you can point me into a place where all these keys are listed we can enhance the integration between flespi and Traccar so that more flespi parameters can be binded to Traccar parameters.

Anton Tananaev2 years ago

We don't support external images. It has to be a local one.

Aliaksei 2 years ago

Can you name a sample of protocol that can be reviewed with such functionality to copy into FlespiDecoder?

Anton Tananaev2 years ago

Just search for KEY_IMAGE or KEY_VIDEO keys in the code.

Aliaksei 2 years ago

Thanks Anton!