i try to use Jetson TK1 as a video recorder (DVR) and i successfully save video stream by this code
gst-launch-1.0 v4l2src device="/dev/video0" ! "video/x-raw,width=640,height=480,format=(string)YUY2" ! videoconvert ! omxh264enc ! qtmux ! filesink location=test.mp4
if i stop recording by Ctrl+C the output file is OK and i could play video output file successfully by VLC . but if i turn off the device while recording the output file is corrupted and will no longer be playable.
note that i use TK1 as a DVR and users can shutdown it suddenly.
what can i do to solve this problem?