Post processing problem, filesystem sync?
Added by Tom Horan over 10 years ago
Hi all,
I have a HandBrakeCLI job that I want to use to reduce the size of some recordings. The script runs perfectly when run manually, but fails when run as a post processing (Skip Commercials) script.
When run from tvheadend as the post-processing script, it runs - full paths, permissions etc are all fine, but when HandBrakeCLI runs it doesnt find any frames in the .mkv file. I run the exact script and path moments later it works fine.
I thought it might a memory buffer / filesystem sync, so I'm calling /usr/bin/sync (I've seen this in other scripts too) but doesnt seem to make any difference. I threw in some arbitary sleep time, up to 5 mins, but still getting the same problem.
The filesize and timestamp for the .mkv tvheadend recording looks fine, but I cannot seem to work around this issue.
Has anyone seen similar? It's as if tvheadend isnt closing the file handle and clearing buffers until after the post processing.
I'm running Ubuntu 12.04 with tvheadend 3.4.27, (disks are in a RAID stripe if that makes any difference).
I'd appreciate any thoughts or feedback.
Regards,
Tom
Replies (1)
RE: Post processing problem, filesystem sync? - Added by Andrew Blank almost 10 years ago
I had to run HandBrakeCLI as sudo user in my script. To do this without password prompt I did this:
sudo visudo
then added this line
hts ALL=NOPASSWD: /usr/bin/HandBrakeCLI
Then pressed ctrl-x to close and Y then enter to save.
After that I was able to use sudo HandBrakeCLI in my script
my script: https://tvheadend.org/boards/4/topics/14932