I'm looking for a way to mux mjpeg (compressed) video data into a video container like mp4 or avi. (I'll also need to add audio in the future). Since i use FFMPEG in other parts of my project as well i'd like to do it using those libraries if possible. I'm not looking for command line FFMPEG use! I've tried to use the muxing example in ffmpeg with that i can only create a (very large) .mjpeg file with video information. This is not what I am looking for.
edit: I have output the yuvj422p stream to jpeg images and I want to put this into a mp4 container. Using ffmpeg commandline this works:
ffmpeg -i yuvy%01d.jpg -vcodec mjpeg out.mp4
I would like to do this directely in my code (without creating jpeg images first ofcourse)
I fixed it doing the following:
I used the muxing example and in stead of using the encode functions i just skipped it and directly loaded the JPEG data into the packet. To set up the OutputContext i used guess format functions and i set the codec to MJPEG. I changed the PTS data to a frame counter. since all frames are chronologic anyway.