cannot call post recording process: Unable to fork() for ... -- Cannot allocate memory (Ubuntu)
Added by Raspberry Pi over 8 years ago
Hi all,
I've managed to get DVB-S + Raspi (Ubuntu) + tvheadned all working together, recording works as well - there is just one thing left that I cannot get done. The recorded files are temporarily stored on the RaspberryPI - after recording, I want to move them over to my NAS.
I tried "configuration" > Recording > Advnace view and "Post-processor command:" and entered just 'echo "foo"' to see if it's working. But even this fails with "spawn: Unable to fork() for "/bin/echo" -- Cannot allocate memory" in the log window.
cp/move/rsync fail with the same error message ...
Is there a way around this?
As a workaround I wanted to build a cron that moves the files after finishing recording - but the files don't appear in 'lsof' as open file - so I would just know that the file is finished if the file size dowsn't increase any more. So no luck again.
Would be glad to read some hints!
BTW: writing directly to the NAS is not an option as my LAN is too slow for HD recordings ...
Replies (2)
RE: cannot call post recording process: Unable to fork() for ... -- Cannot allocate memory (Ubuntu) - Added by Jonathan Thomson over 8 years ago
Not ideal but could you parse the API output of the upcoming DVR entries?
If you use cURL or wget to get the API data from
http://YourTVHeadendIP:9981/api/dvr/entry/grid_upcoming
...it shows a list of all upcoming (and indeed currently recording) programs. In that, if you use grep to search for "status":"Running","sched_status":"recording" you'll know some program is still recording. You can then just perform this check on a timer and when you get no match from grep, move all the files to wherever you want to store them.
Just one question though, moving the files breaks the DVR logs so how are you dealing with that? So each time a recording completes, a log file contains all the meta data (including where the file physically resides) which is then parsed by the TVHeadend web interface and any other client (such as Kodi) to know where to retrieve the file from. If you are moving files on batch I suspect you'll also need to update the log file matching the recording which I don't think is that difficult using grep and sed in conjunction with one another.
RE: cannot call post recording process: Unable to fork() for ... -- Cannot allocate memory (Ubuntu) - Added by Raspberry Pi over 8 years ago
Ah thanks for pointing to the API. Didn't know about it.
But good point about the metadata. Didn't think of it yet.
Currently I'm moving the records to the NAS and let KODI point to the NAS. But - as my network (incl. the RasPi) speed is too slow for HD streaming I'll probably just end up adding a real disc to the RasPi - Then there are also no more issues about moving files.
Thanks!