Streaming already encoded data to network on linux

169 views Asked by At

I have a usb 3.0 basler camera connected to an odroid board. I grab frames via camera sdk using c++ and encode it by a hardware encoder(which is way faster than software encoder, almost 10 times with 30 fps with 2.0 mp image). I want to stream it over the network on rtsp to receive from another pc in order to process it. What I have done so far is, encoding the grabbed frames by the hardware encoder and keep them in the memory or disk.

If you ask why I prefer a way like this, there will be many of odroid boards and all them will have a 2.0 mp usb camera and all them need to be processed and stored on a workstation. This workstation and all odroid boards will be connected to the same network.

I checked both ffserver and libvlc to stream this frame by frame encoded data but no result as of now. These streamers require to access the media file or device itself to grab and encode itself then stream, which is not suitable for my situation. In other words, I need to be able to manipulate the data to be sent, I will be the one to prepare it. As I see so far, they don't allow me to feed them with my encoded data. (If they already do it, It would be great to know)

I dont have that experienced both on linux and streaming and don't know how to achieve it.

If you point me in the right direction, I would be glad.

Thanks in advance.

1

There are 1 answers

3
szatmary On BEST ANSWER

I am going to assume h.264. Write your stream as annex b to stdout. Pipe to to ffmpeg. ‘ffmpeg -i - -codec copy rtsp://whatever’