0

Is there a way to send data by encoding the data in JSON format using C++? I need to stream video frames and some information about each frame over the network! I tried using sockets but I was unable to synchronize frames and their corresponding information!

2
  • There's a few JSON libraries for C++. If the problem is more with the socket behavior than the contents of what's being sent over them, some socket stuff might be necessary. As written, this is a somewhat unanswerably broad question because we don't really know exactly what problem you're experiencing. Commented Feb 22, 2021 at 3:18
  • Seeing that you said "you tried" so you should be able to post a minimal reproducible example to describe the problem you're having. Commented Feb 22, 2021 at 3:27

1 Answer 1

1

You can use socket and add unique frame number to your json, for example frame send

{
   "data":"ADFF..",
   //....
   "frame_id":"1234"
   }

And response should be like that

{
"frame_id":"1234",
"result":"ok"
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.