<div dir="ltr">I added my scripts to the wiki: <a href="https://www.mythtv.org/wiki/Captions_with_HD-PVR_alternate">https://www.mythtv.org/wiki/Captions_with_HD-PVR_alternate</a><div><br></div><div>These are working nicely with 2 HD-PVRs and 1 PVR-500 using zvbi2raw.  </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 16, 2014 at 10:24 AM, Mike Rice <span dir="ltr"><<a href="mailto:mikerice1969@gmail.com" target="_blank">mikerice1969@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Tue, Nov 11, 2014 at 8:16 PM, Bob <span dir="ltr"><<a href="mailto:mythtv@cox.net" target="_blank">mythtv@cox.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 11/11/2014 06:03 PM, Mike Rice wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I think I may try to start the vbi recording from a rec started writing event instead of a rec started event.  That may get me closer to what I need, and then ccextractor might add my delay better (or I'll use a perl script).<br>
</blockquote></span>
Let me know how well this works. I have a variable amount of delay in my captions. If I do a single recording the delay is around 30 seconds. If I have back-to-back recordings the delay is almost zero. I usually have to use a script to get the captions within 5 seconds, then I can use the frontend menu to fine tune.</blockquote><div><br></div></span><div>Looks like I am having pretty good success now.  Most of my recordings seem to be fairly in sync with the captions within a second or so (which can be easily adjusted in the frontend).  Here's what I did:</div><div><br></div><div>1. Run the hd-captions-start script when REC_STARTED_WRITING event is triggered instead of REC_STARTED.  For me there was a minimum pf 8 second delay between those two events.  Maybe more if the system was busy.</div><div><br></div><div>2. Removed all code that tried to determine the recording duration and adjust based on it.  Instead I just went with the idea of recorder on/captions on and recorder off/captions off.</div><div><br></div><div>3. In hd-captions-start just start recording the captions as soon as possible.  I left the code to kill vbi2raw in but it has never fired for me according to my logs.  Not sure I follow why that's needed.  I am assuming the REC_FINISHED event occurs when the tuner stops recording no matter what postroll/end late/early options you use.  If that's true then vbi2raw is almost certainly killed before the REC_STARTED_WRITING event occurs for the next recording, especially in my case where I have around 8 seconds between REC_STARTED and REC_STARTED_WRITING.  I will probably try to remove it to improve the timing a bit more.</div><div><br></div><div>4. In hd-captions-finalize (called at REC_FINISHED) I just kill the vbi2raw that was started in hd-captions-start then run ccextractor -in=raw -delay X and copy the resulting .srt file to the recording directory.  I also copy the .raw file to the recording directory along with a script that I can easily run to adjust the delay if I find out later it is off.  </div><div><br></div><div>5. Created a script to run on REC_DELETED to remove the .srt file, .raw file, and script.</div><div><br></div><div>Still need clean up my scripts a bit but it looks good.</div><div><br></div></div><br></div></div>
</blockquote></div><br></div>