You asked: This is 1 camera on board and 3 test streams flvmuxed to an rtmp server and recorded locally. Takes all night to crash.
For people looking for a four way streaming and record solution this might be an interesting gstreamer pipeline. Change out the videotestsrc to other cameras. My current version is mixing the onboard and USB cams
export LD_LIBRARY_PATH=/home/ubuntu/gst-1.8.3/lib/arm-linux-gnueabihf
if [[ $PATH != *"gst-1.8.3"* ]]
then
export PATH=/home/ubuntu/gst-1.8.3/bin:$PATH ;
echo "fixed Path to gstreamer"
fi
gst-launch-1.0 -e nvcamerasrc fpsRange="20.0 20.0" ! 'video/x-raw(memory:NVMM), width=(int)640, height=(int)480, format=(string)I420, framerate=(fraction)20/1' ! \
nvvidconv flip-method=2 ! 'video/x-raw, format=(string)I420' ! clockoverlay halignment=left valignment=top text="CAM1" ! mix.sink_0 \
videotestsrc pattern="zone-plate" kx2=20 ky2=20 kt=1 ! 'video/x-raw,format=(string)I420, framerate=20/1, width=640, height=480' ! \
textoverlay font-desc="Sans 24" text="CAM2" valignment=top halignment=left ! mix.sink_1 \
videotestsrc pattern="snow" ! 'video/x-raw,format=(string)I420, framerate=20/1, width=640, height=480' ! \
textoverlay font-desc="Sans 24" text="CAM3" valignment=top halignment=left ! mix.sink_2 \
videotestsrc pattern="ball" ! 'video/x-raw,format=(string)I420, framerate=20/1, width=640, height=480' ! \
textoverlay font-desc="Sans 24" text="CAM4" valignment=top halignment=left ! mix.sink_3 \
audiotestsrc wave=5 freq=4000 ! 'audio/x-raw,format=S16LE,rate=32000,depth=16,channels=1' ! audioconvert ! faac bitrate=32000 ! aacparse ! muxout. \
videomixer name=mix \
sink_0::xpos=0 sink_0::ypos=0 sink_0::zorder=0 \
sink_1::xpos=640 sink_1::ypos=0 sink_1::zorder=1 \
sink_2::xpos=0 sink_2::ypos=480 sink_2::zorder=2 \
sink_3::xpos=640 sink_3::ypos=480 sink_3::zorder=3 ! queue ! \
omxh264enc control-rate=4 bitrate=4000000 quality-level=0 iframeinterval=60 ! \
'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! muxout. \
flvmux streamable=true name=muxout ! tee name=t1 ! rtmpsink location="rtmp://localhost/teststream/live live=1" async=false \
t1. ! multifilesink next-file=4 max-file-duration=10000000 max-file-size=10000000 name=muxf post-messages=true location="recfile%02d.flv" async=false blocksize=16384