Over the past few weeks, I have been struggling with the ffmpeg API, as I cannot find clear documentation, and it is also difficult to search, since all the solutions that I find on the Internet do not include the API c, but the ffmpeg.c command line. I am creating a program that is supposed to capture video from a webcam and audio, show frames on the screen and record both audio and frames in a video file. I also use QT as the basis for this project.
I managed to show the frames on the screen and even record them, but my problem is recording both audio and video. I decided to create a simpler test program that only saves the stream to a file without showing frames on the screen, starting with the remuxing.c example in the ffmpeg documentation. My code is as follows:
av_interleaved_write_frame returns an error with video packets. The final file shows only the first frame, but the sound looks normal.
On the console, this is what is printed:
Input
It seems to me that this is a simple problem to solve, but I really basically do not know about the ffmpeg API, if someone can lead me in the right direction, it will be great!
Thanks!
source share