I'm new here. I'm trying to stream some images processed with opencv on a LAN using ffmpeg. I saw this: Pipe raw OpenCV images to FFmpeg but it doesn't work for me, it creates only noise. I think the data I'm sending are not in the right format. I also have a look to this: How to send opencv video's to ffmpeg but (looking at the last answer) the option -f jpeg_pipe give me error.
What I do now:
- I have a RGB Mat called "composedImage"
- I send in output with: std::cout << composedImage; The output are the pixels values separated by comma
- then I call:
./example | ffmpeg -f rawvideo -pixel_format bgr24 -video_size 160x120 -framerate 20 -i - -f udp://192.168.1.79:1234
- I try to read using VLC (it didn't work) and with ffplay:
ffplay -f rawvideo -pixel_format gray -video_size 160x120 -framerate 30 udp://192.168.1.79:1234
Here it seems so easy: http://ffmpeg.org/ffmpeg-formats.html#rawvideo
I have also tried to write the image and sent it, but I have errors. Probably it tries to send before the image is complete.
Thank you for your help.