OK. That makes sense, I hadn't considered memory as an issue as I've only run on 512M units. It is probably MP4Box running out of memory and bailing out during its conversion, so .mp4 never gets produced and the .h264 is cleaned up. I'll do a bit of further checking on this.piecam wrote:HI Robert,
I finally limited the issue of not converting h264 to MP4 to two PI B+ 256MB. All the other 3 PI B+ 512MB are working fine. Therefore, I swapped these two 256MB model out for two 512MB model; and it works fine.
I would attribute this issue to some possible "not enough memory" cause. I was wondering whether you have some insights from your code that this RPI CAM might dictate minimum 512MB to work fine. FYI, I did have 128MB carved out for PI CAM in both 256MB model and 512MB model.
Hope you can confirm that this might be the issue.
Thanks a lot.
Edit: Below are a couple of screenshots with the top command. These are on a B+ (Pi1) 512MB unit with standard raspbian.
First is normal background with one browser client attached, motion detection active and no recording / MP4Box.
Second is just after a manual recording is stopped so MP4Box is operational. Note that motion was off in this case so freeing up some memory.
Most interesting part is KiB Used which indicates MP4Box may be using quite a bit which in turn may take it over the top on an 256MB machine particularly if 128MB is reserved.
I can't see any MP4Box options to control memory usage. First thing to check would be if you can reduce the 128MB reserve a bit.