I wanted to share about my experience trying to use this script thru events instead of a user job. I already use mythlink.pl thru the record started and recordings deleted/expired events so I can get access to my recordings thru Plex.
The script: https://www.mythtv.org/wiki/Transcode_Mpeg2_to_H264 (v2.)
1- Figured out how to add a finished recording event
Found the event names here:
https://code.mythtv.org/doxygen/mythsys ... ource.html
2- Added to the settings table using "mysql -u root mythconverg". It should be done thru mythtv-setup but I just hate starting an X session for that tool. So bloody painful.
Previously, I copied the script under /usr/local/bin/ and made it executable with chmod a+x
INSERT INTO mythconverg.settings (value,data,hostname) values ('EventCmdRecFinished','/usr/local/bin/transcode-h264-v2.py --chanid "%CHANID%" --starttime "%STARTTIMEUTC%" --tzoffset "-05" --verbose all >> /var/log/mythtv/transcode-h264-v2.log','[backend hostname]')
The tzoffset depends on your location. I don't quite understand why it's needed at all but the script requires it for the moment.
Verbosity is optional, so is the redirection to the log file.
3- Commented out line 195-197 so it can run without having a jobid:
Code: Select all
# job.update({'status':job.PAUSED,
# 'comment':'Waited %d secs for the commercial flagging job' % (waititer*POLL_INTERVAL) \
# + ' currently running on this recording to complete.'})
Also, I commented out the break at line 204. If I understand correctly, that's to get out of a while loop when the condition is still true. We don't want that here.. I think.
Anyway, I hope that helps or, at least, does not confuse anyone.
Cheers!
cythraul