Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 10 months ago

Closed 10 months ago

#11618 closed Developer Task (Fixed)

Support playback of externally-produced .srt caption files for in-progress recordings

Reported by: stichnot Owned by: stichnot
Priority: minor Milestone: 0.27
Component: MythTV - Captions Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This is to provide better support for the third-party scripts described in http://www.mythtv.org/wiki/Captions_with_HD-PVR. These scripts allow an analog tuner to capture VBI closed captions via ccextractor while capturing HD video via the HD-PVR.

Attachments (0)

Change History (11)

comment:1 Changed 10 months ago by stichnot

8491c5e1a51a1c1d8c24e9e7c3810e0bb7890797 adds a more precise system event, REC_STARTED_WRITING, which is dispatched when data starts being captured to disk. Note that REC_STARTED is dispatched before the lengthy tuning / channel changing process.

comment:2 Changed 10 months ago by Jim Stichnoth <jstichnoth@…>

In c691ddf536856416a7f94ed8695aa24b622efc23/mythtv:

Disable minimum file size check for .srt files. Refs #11618

comment:3 follow-ups: Changed 10 months ago by Jim Stichnoth <jstichnoth@…>

In feb2e0fae2dc7e163cffd004da92d7654765fa1f/mythtv:

Support .srt files for in-progress recordings. Refs #11618

Allow a .srt file to be reloaded for an in-progress recording after
the last subtitle is reached. The backend is queried at most one a
second for an updated .srt file.

Still to do:

  1. Do the update check in a separate thread to avoid stuttering.
  1. Currently the REC_STARTED_WRITING event is not sent when the HD-PVR

switches to a new program during live TV, so the third-party script
ends up not generating .srt files for subsequent programs in a live TV
session.

  1. ccextractor buffers its output, so one needs to be at least 30

seconds behind real-time to get .srt captions. A better solution
would be to add the required functionality to mythccextractor.

comment:4 Changed 10 months ago by Jim Stichnoth <jstichnoth@…>

In ba75244a7f7e412bdb100b7741eaa6a6f0e6649b/mythtv:

Use RemoteFile::isOpen() instead of Open() to check for success.

Calling Open() was unnecessarily creating extra socket connections to
the backend, and the original socket connections from calling Open()
in the constructor were leaking and accumulating in both the frontend
and backend (refs #11341). Refs #11618

comment:5 Changed 10 months ago by Jim Stichnoth <jstichnoth@…>

In 79ac9afc0a75ab95094382902c790b8be8c8a69f/mythtv:

Ensure cardid is initialized for a new Live TV recording.

RecordingInfo::cardid wasn't being set to the correct value when
transitioning from a dummy recorder to the real recorder. As a
result, SendMythSystemRecEvent?() would report a cardid of 0 for the
real recording. Refs #11618

comment:6 in reply to: ↑ 3 Changed 10 months ago by stichnot

Replying to Jim Stichnoth <jstichnoth@…>:

2. Currently the REC_STARTED_WRITING event is not sent when the HD-PVR
switches to a new program during live TV, so the third-party script
ends up not generating .srt files for subsequent programs in a live TV
session.

This is incorrect, the REC_STARTED_WRITING event was in fact being sent in all cases, but sometimes with cardid=0, leading to the external script ignoring the event. Fixed in 79ac9afc0a75ab95094382902c790b8be8c8a69f.

comment:7 Changed 10 months ago by Jim Stichnoth <jstichnoth@…>

In 66f80e0bb35613b3d1510d060c0814f61499422a/mythtv:

Subtitles: Reset the external subtitle filename. Refs #11618

This ensures that during Live TV, .srt subtitles from the previous
program are not accidentally used for the next program.

comment:8 in reply to: ↑ 3 Changed 10 months ago by stichnot

Replying to Jim Stichnoth <jstichnoth@…>:

3. ccextractor buffers its output, so one needs to be at least 30
seconds behind real-time to get .srt captions.  A better solution
would be to add the required functionality to mythccextractor.

The main issue here is actually ccextractor's buffering of input. FILEBUFFERSIZE is defined to be 16MB which, at the script's suggested bitrate of 4.5Mb/s, takes around 30s to fill. Changing FILEBUFFERSIZE to something smaller, like 1MB, makes it much more practical for Live TV and in-progress recordings.

comment:9 Changed 10 months ago by Jim Stichnoth <jstichnoth@…>

In 3f377abe6a50d41a8572923e9be5711c3880ff2a/mythtv:

Subtitles: Reload .srt files in the background with a helper thread.

This avoids a brief stutter in the video thread when subtitles are
reloaded. Refs #11618.

comment:10 Changed 10 months ago by stichnot

  • Owner set to stichnot
  • Status changed from new to accepted

comment:11 Changed 10 months ago by stichnot

  • Resolution set to Fixed
  • Status changed from accepted to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.