feature: dvr
disconn3ct opened this issue · 3 comments
Has anyone considered a basic dvr function? It looks like there is a spot in the (literal) pipeline where it has effectively standard mp4 video that could be diverted to a file as well as playback.
- Connect USB storage, allow system to automatically mount it
- When goggles attached, if usb storage is present, send it to a file as well as the player:
| tee /storage/dvr-2220.mp4 |
- During streaming, automatically run
sync
to flush the write cache periodically
Alternately:
OUTFILE=/dev/null
- When storage is detected,
OUTFILE=/storage/dvr-2221.mp4
- When storage is detected,
- Include
| tee ${OUTFILE} |
in the pipeline. This has a very minor performance cost for non-dvr playback, extraneously sending the stream to/dev/null
- Still run the periodic syncs during streaming, which shouldn't impact except in dvr mode. (Ideally few/no writes should be going to the system device.)
In both approaches, closing the stream will automatically close the file. The periodic sync should defend (barely) against corruption on power-off, while still allowing a reasonable write cache. Corruption risks are primarily to the DVR storage, rather than the system volume.
I might hack something together if there is any interest. Having a second screen is huge for outreach where we fly but I don't want to lose my dvr
+1
I'm also going to hack together something to get it to at least dump the video out to a file. Let me know if you would like to get together on this.
Did you get anywhere with this?