first of all, you have to understand the difference between sending raw bitmap data, and sending a compressed image as a jpeg or png or something.
when you understand that, you should be able explain why you see “noise” in that first album you gave.
next… you should check the actual size and number of channels of the data in frame
(after video.read(frame);
)
it is probably 640 x 480 and you fixed that by changing the VideoCapture resolution.
third… you are probably sending BGR color data. check that it looks correct using imshow
.
ffmpeg is told to expect bgr24
so this should result in a proper picture. it is not, so either you aren’t sending BGR24 or ffmpeg isn’t interpreting it as BGR24.
you haven’t shown your source code. it is probably causing this. show your source code.