Opened 14 years ago

Closed 13 years ago

#1748 closed patch (fixed)

External text-based subtitle file support for the internal video player

Reported by: Pekka Jääskeläinen <pekka.jaaskelainen@…> Owned by: danielk
Priority: minor Milestone: 0.20
Component: mythtv Version: head
Severity: medium Keywords: external subtitle files
Cc: Ticket locked: no

Description

Adds text-based subtitle support to the internal video player.

Such subtitles are provided in external files with extensions like '.srt', '.txt', or '.sub'. The implementation uses a parser taken from Xine to read in the subtitles.

Following formats are supported by the parser: MicroDVD, SubRip?, SubViewer?, SAMI, VPlayer, RT, Sub Station Alpha, PJS, MPSUB, AQTitle, JacobSub?, Subviewer2, Subrip09, and Mplayer sub 2.

Attachments (7)

external_text_subtitle_file_support.diff (62.5 KB) - added by Pekka Jääskeläinen <pekka.jaaskelainen@…> 14 years ago.
patch against trunk
external_text_subtitle_file_support.v2.diff (62.3 KB) - added by Pekka Jääskeläinen <pekka.jaaskelainen@…> 14 years ago.
patch against trunk, removed usage of my debugging header debug.h
1748.patch (62.1 KB) - added by danielk 14 years ago.
updated patch
external_text_subtitle_file_support.v3.patch (65.8 KB) - added by Pekka Jääskeläinen <pekka.jaaskelainen@…> 14 years ago.
fixed the issues danielk pointed out
external_text_subtitle_file_support.v4.patch (66.3 KB) - added by Pekka Jääskeläinen <pekka.jaaskelainen@…> 14 years ago.
fixed a bug
external_text_subtitle_file_support.v5.patch (66.3 KB) - added by Pekka Jääskeläinen <pekka.jaaskelainen@…> 14 years ago.
added #include <stdint.h> to subtitleparser.h
external_text_subtitle_file_support.v5.2.patch (66.3 KB) - added by Pekka Jääskeläinen <pekka.jaaskelainen@…> 14 years ago.
added #include <stdint.h> to subtitleparser.h

Download all attachments as: .zip

Change History (15)

Changed 14 years ago by Pekka Jääskeläinen <pekka.jaaskelainen@…>

patch against trunk

comment:1 Changed 14 years ago by Pekka Jääskeläinen <pekka.jaaskelainen@…>

Owner: changed from Isaac Richards to danielk

Changed 14 years ago by Pekka Jääskeläinen <pekka.jaaskelainen@…>

patch against trunk, removed usage of my debugging header debug.h

Changed 14 years ago by danielk

Attachment: 1748.patch added

updated patch

comment:2 Changed 14 years ago by danielk

Resolution: invalid
Status: newclosed

Pekka, a few problems:

  • TABs are bad.
  • Please use the same bracketing as the rest of MythTV.
  • QStrings are not thread safe, use a mutex and qdeepcopy when allowing more than one thread to access a string.
  • make all get methods const methods.
  • using a linear search for the current subtitle will not deal with seeking all that well. Using the STL binary search find would be pretty easy.
  • passing iterators around is kind of scary, these can be invalidated by a change to the underlying structure. If you reload the subtitles you can easilly get a segfault.
  • osd.cpp has the patch in #1515 applied; please remove this.

Please reopen the ticket when the patch is ready.

Changed 14 years ago by Pekka Jääskeläinen <pekka.jaaskelainen@…>

fixed the issues danielk pointed out

comment:3 Changed 14 years ago by Pekka Jääskeläinen <pekka.jaaskelainen@…>

Resolution: invalid
Status: closedreopened

Changed 14 years ago by Pekka Jääskeläinen <pekka.jaaskelainen@…>

fixed a bug

comment:4 Changed 14 years ago by Pekka Jääskeläinen <pekka.jaaskelainen@…>

The attached version fixes a bug occuring on some Qt versions. Some Qt versions do not accept full paths in the search string when querying directory contents, so the directory had to be given separately or no entries were found.

Thanks for raptorjr for tracking this out.

Changed 14 years ago by Pekka Jääskeläinen <pekka.jaaskelainen@…>

added #include <stdint.h> to subtitleparser.h

Changed 14 years ago by Pekka Jääskeläinen <pekka.jaaskelainen@…>

added #include <stdint.h> to subtitleparser.h

comment:5 Changed 14 years ago by Pekka Jääskeläinen <pekka.jaaskelainen@…>

The uploaded patches (v5, v5.2) are equal, it just got uploaded twice due to a refresh I did because of a database locked error.

comment:6 Changed 14 years ago by danielk

Resolution: fixed
Status: reopenedclosed

(In [10067]) Fixes #1748. Adds external subtitle file support for internal video player.

This is basically MythTV glue to the xine support for external subtitles, so any subtitle supported by xine should now be supported by MythTV. The subtitles are only loaded if they have the same base name as the video file, and end with one of the standard subtitle extensions.

comment:7 Changed 13 years ago by jlagop -- jlagop A T gmail.com --

Resolution: fixed
Status: closedreopened
Type: patchenhancement

(hope this is the right place...)When subtitles in the file are in UTF-8, with some accents or other characters(ñ,Ñ,¿,¡,... spanish charset mainly), strange symbols are displayed on screen. Maybe I can help on solvind this issue, if some help on where to start looking is given (fontname? QString issues?... Sorry, no much knowledge about myth coding). Thanks.

comment:8 Changed 13 years ago by Isaac Richards

Resolution: fixed
Status: reopenedclosed
Type: enhancementpatch

Open new tickets for new issues.

Note: See TracTickets for help on using tickets.