'How to use FFmpeg to generate a pure black stream and push to RTMP by code in C++

I'm new in FFmpeg. I want to generate a pure black stream using FFmpeg, and I don't want to use the FFmpeg command. I know below command can work.

ffmpeg -f lavfi -i color=size=1920x1080:rate=25:color=black -f flv rtmp://172.16.63.123:9911/live/33bld

So, someone knows how to generate a pure black stream and push to RTMP by code in C++? Thanks a lot.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source