2

The intention here is to capture those audio + video bytes from Camera, then optimise with an appropriate Qt class (suggestions welcome) and send them over TCP to a server. The server sends back those bytes to another client to be played. This is how we intend to establish basic VoIP (Voice/Video over Internet Protocol).

Checked many Qt APIs, but couldn't find any which gives a ready made utility for the same. Some of the Qt forums suggest that we should use 3rd party libraries. Other SO Qns, don't address my specific issue.

Don't want to capture those bytes first in a temporary file and then read from there, as it's not efficient compared to getting in-memory bytes.

Questions:

  • Are there any APIs available in Qt, which allow the capturing of live streaming bytes?
  • If not, then what are the alternatives in C++ for cross platforms?
iammilind
  • 68,093
  • 33
  • 169
  • 336
  • 1
    1 - no, 2 - offtopic, but still try gstreamer – dtech Dec 15 '17 at 06:18
  • @dtech, in my limited knowledge, I learned that some of the Qt APIs can capture the video bytes in a file or send it via QUrl. Isn't it surprising that, they don't have a simple API to capture the bytes? I had seen GStreamer, but thought of using Qt's native utilities first. Is there any other alternatives within Qt? i.e. with adding little complexity, we can achieve the VoIP. – iammilind Dec 15 '17 at 06:26
  • 1
    Qt is very limited in this regard, it can play videos and it can record webcam videos to disk, that's it, and even that doesn't work on all platforms. It is not modular, it is not customizable. It cannot even do something as simple and basic as make a video of a sequence of images. – dtech Dec 15 '17 at 06:38

1 Answers1

0

Founded in Qt documentation. Seems that your case.

The QCamera class provides interface for system camera devices. QCamera can be used with QCameraViewfinder for viewfinder display, QMediaRecorder for video recording and QCameraImageCapture for image taking. You can use QCameraInfo to list available cameras and choose which one to use.

stanislav888
  • 374
  • 2
  • 9
  • We have checked multiple APIs in QCamera and QMediaRecorder, but couldn't find how to get the byte stream for audio + video. A comment under the Qn says, no such APIs in Qt. Can you help with those particular APIs as mentioned in the Qn. It will be good, if you update your answer with such useful info. – iammilind Dec 15 '17 at 13:06
  • 1
    I have only one quick idea. Write stream into special kind of file. On Unix that can be "pipes". on windows I don;t know. That special files should not write stream on disk, but transfer that stream to another application or thread. (Another end of pipes). – stanislav888 Dec 15 '17 at 13:24