Hello everybody and thank you for reading !
Here is my problem : I have a program piping raw video frames to the standard output. This program is using OpenCV to capture and process the video and outputs directly the processed frames. The loop is synced to the framerate I chose. I'm using ffmpeg to read from the standard input and everything works fine for the video. But now that I added the sound I have a big problem : a growing delay is occuring and I really need to get rid of it. So here is my idea, but I really need your help :
I have to find a way to include a timestamp information to the raw video. To be understandable by ffmpeg, it needs to be a known raw video compatible container. And then I will need to use the container API and pipe it to the standard output in my program. I really do not know what to use in the jungle of video formats and codecs, and I don't event know how to enable timestamp synchronizing in ffmpeg...
If anyone has an idea, i am really interested here. For information, here is the command line i use to pipe the raw video :
./myprogram | ffmpeg -y -f alsa -i pulse -ac 2 -f rawvideo -vcodec rawvideo -r 24 -s 640x480 -pix_fmt bgr24 -i - -vcodec libx264 -pix_fmt yuv420p -r 24 -f flv -ar 44100 out.flv;
Thand you very much,
Roland