Unable to Convert H264 Encoded Buffer to MP4 File

Hi tpm ,

I appreciate your prompt response. However, it’s worth noting that my specific requirements differ from the code provided above.

  1. If the camera devices disconnect, I’ll insert dummy error messages into the buffer list. This is essential to account for any interruptions in the camera feed.

  2. My primary goal is to convert the H.264 encoded video buffers into a single MP4 file. This file will contain both video and audio data.

  3. To achieve this, I’ll work with two appsrc elements. One will handle the video buffers, and the other will manage the audio buffers. These elements ensure the proper handling and synchronization of audio and video data.

  4. In the event of any errors occurring during the recording process or prior to the recording, I will include error buffers. For instance, if the intended recording duration is 5 minutes and a camera disconnects after 3 minutes, the remaining two minutes will contain error buffers in the buffer list to account for this interruption.

  5. The final step involves taking the complete buffer list, which includes both video, audio, and error message buffers, and converting it into a single, coherent fragmented MP4 file. This consolidated file ensures that all data, including any error messages, is encapsulated in a single MP4 format for further analysis or playback.

Flow Diagram:

Is it possible to buffer the data to external storage, such as a non-RAM or external memory source, when continuously recording data, as the memory usage tends to increase, potentially leading to a performance slowdown? I’d like to store the data in an external memory to address this issue.

Regards,
Sulthan