RGB565_video icon indicating copy to clipboard operation
RGB565_video copied to clipboard

Can't play a 2nd video

Open ojaksch opened this issue 3 years ago • 7 comments

Great library and examples! I'v adopted the main routine of SD_MJPEG_video to play two videos, one after the other. The 1st video plays fine, the 2nd not at all. The videos are mjpeg's at 320x240/25fps without audio. What I'm missing here?

uint8_t *mjpeg_buf = (uint8_t *)malloc(MJPEG_BUFFER_SIZE);
File vFile = SD.open(file1);
mjpeg.setup(vFile, mjpeg_buf, gfx, true);
  while (mjpeg.readMjpegBuf()) {
    mjpeg.drawJpg();
  }
vFile.close();
free(mjpeg_buf);

uint8_t *mjpeg_buf = (uint8_t *)malloc(MJPEG_BUFFER_SIZE);
File vFile = SD.open(file2);
mjpeg.setup(vFile, mjpeg_buf, gfx, true);
  while (mjpeg.readMjpegBuf()) {
    mjpeg.drawJpg();
  }
vFile.close();
free(mjpeg_buf);

ojaksch avatar Apr 26 '21 15:04 ojaksch

I think you don't need free and re-malloc the buffer.

moononournation avatar Apr 26 '21 22:04 moononournation

And also get update to avoid re-malloc in mjpeg class

moononournation avatar Apr 26 '21 23:04 moononournation

Thanks for the update, but still can't play a 2nd video. I'l send you the access to the modified code of your example as a playground/test.

ojaksch avatar Apr 27 '21 08:04 ojaksch

In case you haven't received the invitation to the mentioned repo, here is the link: https://github.com/ojaksch/SD_MJPEG_video3 Simple and stupid code, just to play two videos in a row.

ojaksch avatar May 02 '21 11:05 ojaksch

Thanks for your invitation, but I am still fighting in my code.

「Larry @.***>」在 2021年5月2日週日,19:40 寫道:

In case you haven't received the invitation to the mentioned repo, here is the link: https://github.com/ojaksch/SD_MJPEG_video3 Simple and stupid code, just to play two videos in a row.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/moononournation/RGB565_video/issues/8#issuecomment-830795931, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADE5WW7Z5AO6JF7GCKKATOTTLU23XANCNFSM43TCDMDA .

moononournation avatar May 03 '21 02:05 moononournation

我也遇到同样问题,无法播放同一个目录的第2个视频,感觉像是什么资源没释放,导致无法读视频文件

v5blueskyer avatar Nov 30 '21 13:11 v5blueskyer

Just reworked my sketch and included the MJPEG routine of your GFX_Library_for_Arduino. Now playning some videos one after the other is is working fine. So for me the problen is "solved" and I'd like to close this issue, if nobody else is complaining...

ojaksch avatar Jan 21 '22 13:01 ojaksch