Is it possible to both capture (record) an RTSP stream and capture scene change events using a single ffmpeg command? I can almost do what I want with:
ffmpeg -i 'rtsp://mystream' \
-map 0:v -map 0:a -c:v copy -c:a copy -f segment \
-segment_time 300 -segment_format matroska -strftime 1 "%Y%m%d%H%M%S_video.mkv" \
-map 0:v -an -filter:v "select='gt(scene,0.1)'" -frames:v 1 "%Y%m%d%H%M%S_scenechange.png"
This gives me nice 300s stream segments saved to disk, and a scene.png when a scene change is detected. However, scene.png only appears when I terminate the process, and when I do, I only get the last scene event. Ideally I'd like to get a new PNG (or even better, a short video clip) anytime a scene change is detected, without interrupting the recording of video.mkv. I'm sure it can be done with pipes and multiple ffmpeg commands, but for simplicity's sake (and mostly my own curiosity at this point), I'd like to see what can be done with just a single process.