At work, we're building a system to allow users to remotely start/stop recordings of h.264 video cameras (Axis Q1755 cameras). We end up with a system that executes a command in the background something like: cvlc --sout file/mp4:$FILENAME.mp4 rtsp://user:p455w0rd@10.10.2.2/axis-media/media.amp?videocodec=h264&videokeyframeinterval=4. We send the process a SIGINT when we want to end the recording.
This works to get the video to disk, but for some reason, the audio ends up ~2 sec ahead of the video. The --desync option is documented to work only on playback, so offers no help here. Any suggestions on fixing this?