Hello,
I’m having an issue getting the mp4 module to write video to file successfully. My setup is simple
video => SISO => mp4
when I stream jpeg snapshots from the video while the recording is taking place, I get a good stream. But when I try to close the video, I get error output.
Here’s my clean up code:
static void cleanup_mmf(void)
{
printf("[VIDEO_SESSION] cleanup_mmf called\n");
if (g_vs.siso_video_mp4) {
printf("[VIDEO_SESSION] siso_video_mp4 pausing\n");
siso_pause(g_vs.siso_video_mp4);
}
if (g_vs.mp4_ctx) {
printf("[VIDEO_SESSION] mp4_ctx stopping\n");
// mm_module_ctrl(g_vs.mp4_ctx, CMD_MP4_STOP, 0);
mm_module_ctrl(g_vs.mp4_ctx, CMD_MP4_STOP, 0);
}
if (g_vs.video_ctx) {
printf("[VIDEO_SESSION] video_ctx stream stopping\n");
mm_module_ctrl(g_vs.video_ctx, CMD_VIDEO_STREAM_STOP, 0);
}
if (g_vs.siso_video_mp4) {
printf("[VIDEO_SESSION] siso_video_mp4 deleting\n");
siso_delete(g_vs.siso_video_mp4);
g_vs.siso_video_mp4 = NULL;
}
if (g_vs.video_ctx) {
printf("[VIDEO_SESSION] video_ctx closing\n");
mm_module_close(g_vs.video_ctx);
g_vs.video_ctx = NULL;
}
if (g_vs.mp4_ctx) {
printf("[VIDEO_SESSION] mp4_ctx closing\n");
mm_module_close(g_vs.mp4_ctx);
g_vs.mp4_ctx = NULL;
}
printf("[VIDEO_SESSION] calling video_voe_release\n");
video_voe_release();
printf("[VIDEO_SESSION] video_voe_release called\n");
}
And here’s the output:
[VIDEO_SESSION] cleanup_mmf called
[VIDEO_SESSION] siso_video_mp4 pausing
[VIDEO_SESSION] mp4_ctx stopping
Stop MP4 recording
[VIDEO_SESSION] video_ctx stream stopping
finish output task
hal_video_output_task closed
hal_voe_send2voe too long 112107 cmd 0x00000207 p1 0x00000000 p2 0x00000000
hal_voe_ready 0x0 0x1718
[VIDEO_SESSION] siso_video_mp4 deleting
[VIDEO_SESSION] video_ctx closing
[VIDEO_SESSION] mp4_ctx closing
Stop MP4 recording
It don't init the buffer
STORAGE_ERROR -> STORAGE_IDLE
[VIDEO_SESSION] mp4_error_cb called
mp4_muxer_close
SD_DeInit
[VIDEO_SESSION] calling video_voe_release
[VIDEO_SESSION] video_voe_release called
After this the SD card is not readable, until I reboot and then it is readable. But there was no mp4 file written on the SD card.
I’m happy to provide more data on the initialization or anything else if that helps. Hoping someone can give me a clue as to what could be the cause.
thanks
Khaled