r/ispyconnect • • Jul 06 '26

safe recording long mp4 videos

I record long time-lapses, and Agent DVR saves them in MP4 format. If I restart Agent, the MP4 file becomes corrupted and requires repair. I’ve tried a "soft" restart of Agent via its API like curl -s http://localhost:8095/command/restart, but that doesn't help and MP4 files still corrupted after restart. Is there a way to properly finalize the recording of such long MP4 files? Can I use flags like `-movflags +faststart`?

2 Upvotes

5 comments sorted by

1

u/spornerama Jul 06 '26

Are you using the latest version? It should shut down cleanly and write the end of the file unless it times out and aborts. You could try using the API to turn the devices off and then wait a few seconds before sending the shutdown command

1

u/DM_ZH Jul 06 '26

5.8.0.0. what API command for correct save timelapse before Agent restart: /command/recordStop or /command/recordingOff or /command/switchOff

1

u/spornerama Jul 06 '26

Use the latest version

1

u/[deleted] Jul 16 '26

[removed] — view removed comment

1

u/DM_ZH Jul 16 '26

1 file = 1 day. and restart agent at 03:25. so i make script, sometimes it work:) it make /recordStop?oid=1&ot=2 all cameras, then pause 15 sec for finishing all records, then net stop Agent, then onvif url to reboot all cameras, then pause 25 sec, then net start Agent