A c++ backend rest server provide a simple api for client to demux and docde network video stream or video file
VideoProcessingService is a rest server aim to provide a simple api for application or web developer to get information or data from a video streaming(RTSP, RTMP, HLS, etc.) or a video file, developers can get the following information and data from this service
- Video
- Image width and height
- Video length with milliseconds
- RGB data and its related pts
- Audio
- PCM raw data and its related pts
The following module have been implement and integrate to the processing flow
-
Demo file
Provide a sample demostrate how to get video data and information from this service and showing image with OpenCV and playback audio with RtAudio -
Test file
Provide a sample demostrate how to get video data and information directly from C++ backend and showing image with OpenCV and playback audio with RtAudio (This method do not need the reset server, but need to compile all c++ backend and integrate to your project) -
Todo
- Plugin for Qt
- Plugin for flutter
# pull image from dockerhub
sudo docker pull andywang0607/video-processing-service
# Run docker (you can use another port)
sudo docker run --rm -p 9080:9080 andywang0607/video-processing-service
-
Prepare third-party library
- Setup vcpkg
$ git clone https://github.com/microsoft/vcpkg $ cd vcpkg $ bootstrap-vcpkg.bat - Install required library
$ ./vcpkg install ffmpeg:x64-linux $ ./vcpkg install pistache:x64-linux $ ./vcpkg install nlohmann-json:x64-linux
- Setup vcpkg
-
Build this project
$ cd $PROJECTPATH $ mkdir build $ cd build $ cmake .. $ make
This is my weekend project just a practice for building a rest service with c++.
Get decode video and audio data from this service is not a efficent methoud indeed,
But it is quite simple and easy for developer to write a video player in every ui framework