Rockbox

  • Status New
  • Percent Complete
    0%
  • Task Type Patches
  • Category Video
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 2
  • Private
Attached to Project: Rockbox
Opened by Antoine Cellerier - 2007-06-02
Last edited by Antoine Cellerier - 2007-10-14

FS#7252 - SubRip (srt) subtitle support in MPEG Player. (Edit: +overlay timebar)

This patch adds SubRip subtitle support to MPEG Player.
http://wiki.multimedia.cx/index.php?title=SubRip

Files need to have the same name as the video file with a “.srt” extension.

I know that the OSD rendering is not implement in a way that linuxstb and jhMikeS would like but I still wanted to post the patch here in case anyone felt like adapting it. (Current OSD only renders on top of the video area, it can be adapted to add other OSD channels … like display a seek bar, volume control, playback state, etc.)

Enjoy,

Edit: I’ve also added a timebar display (when changing the volume)

Anonymous Submitter commented on 2007-06-02 20:30

I miss fast forward and rewind more than every other feature like sub titles…but it sounds nice.

Pablo commented on 2007-07-20 22:34

I just posted a request for this!!
then I discovered the Patches section and found this!
I´ll try it as soon as I discover how to install it

Andrea Minini Saldini commented on 2007-08-23 14:55

Is this available in any precompiled build? Does it work with recent versions of the code?

Martin H*** commented on 2007-09-21 16:35

Has to be synced, i think.

Antoine Cellerier commented on 2007-09-30 16:15

Updated patch to make it apply with latest SVN (r14918).

benoit commented on 2007-10-09 14:37

Can it be applied together with the new mpegplayer http://www.rockbox.org/tracker/task/7487 ?
It fails for me (applying the 7487 before this patch).

Antoine Cellerier commented on 2007-10-11 12:39

I can't tell if it will … depends if those two patches change the same lines of code or not. (+ due to recent mpegplayer changes, the patch might need a re-sync. I'll probably update it this week end)

benoit commented on 2007-10-11 12:42

ok, I'll keep looking at your updates and try again !

Antoine Cellerier commented on 2007-10-14 15:15

Updated to work with revision 15105.

Antoine Cellerier commented on 2007-10-14 17:46

Added a time bar display (enabled for 3 seconds when any volume related button is pressed … I didn't want to add another button).

Antoine Cellerier commented on 2007-10-14 20:48

Fix date function used. (Fixes subs when starting the video after seeking)

benoit commented on 2007-10-15 11:42

I tried to apply it, it seems to successfuly patch but doesn't compile.
I patch from the /path_to_source/apps/plugins/mpegplayer directory and when compiling I get this error :

subtitles.c: In function `uint8_buffer_putsxyofs':
subtitles.c:320: error: too few arguments to function
subtitles.c:328: error: too few arguments to function
make[3]: * [/home/user/rockbox15TEC/testBuid/apps/plugins/mpegplayer/subtitles.o] Error 1
make[2]:
* [mpegplayer] Error 2
make[1]: * [rocks] Error 2
make:
* [build] Error 2

Antoine Cellerier commented on 2007-10-15 12:14

Was that applied on a clean svn checkout? (Are you using something like the multifont patch? I've seen reports on the unsupported builds forum that my patch doesn't work with it and your error seems to be on font related functions)

benoit commented on 2007-10-15 12:29

I'm trying on a clean SVN right now

benoit commented on 2007-10-15 12:43

OK, this time it compiles, but the simulator "segmentation-faults" when I launch a video, maybe it is usual on the simulator.
I'll try to combine it with other patches, excluding the multifont.

Antoine Cellerier commented on 2007-10-15 13:01

It worked fine on the iPod Video simulator yesterday (well … I had segfaults some of the time when changing the start point, not sure if they're subs related though)

Edit: you could try runing the sim in gdb to see where it segfaults (and post a backtrace here … or fix it yourself :) )

benoit commented on 2007-10-15 15:08

What device are you using for your tests ?
I just tried on my Gigabeat F40 for real and it displayed the 1st sentence of my .srt file. Then at the time of displaying the 2nd, the device froze totally.
I can give you the mini-clip and srt file, I did the srt myself just for testing, it's some crap text :
http://snk5ever.free.fr/taek1.mpg http://snk5ever.free.fr/taek1.srt

benoit commented on 2007-10-15 15:10

I don't knwo if this has an importance but the file was made with a unix carriage return software.

Antoine Cellerier commented on 2007-10-15 15:19

The subs file looks valid. I'll give it a try when I get back home (the only issue might be a segfault when the last sub line is read … since I never really tested it all the way to the end of the movie).

Antoine Cellerier commented on 2007-10-15 20:12

This patch add lots of error checking in the subs parsing function (which fixes all the segfaults I was able to come up with while editing the subtitles file).
It also restricts overlay rendering to normal video playback (== it's disabled for video thumbnails when setting the start time)

I guess that the next step(s) would be to:
* Make it possible to configure a delay (in case subs and video/audio aren't exactly synced)
* Make it possible to choose the subtitle's position on the video (ie: at the bottom of the screen instead of at the top …)
* …

Edit: Updated patch to make sure that the last line was always displayed. (Nice test video btw :) )

Antoine Cellerier commented on 2007-10-15 21:23

About the multifont patch, if you're applying it with this patch you'll need to add a 3rd argument of rb→get_lcdgetcurfont() (or maybe just 0) to the two functions which trigger a compile error (font_get_bits and font_get_width).

Antoine Cellerier commented on 2007-10-30 16:59

Benoit, have you been able to test the patch again? (and get it to work correctly)

Phil Light commented on 2008-03-15 21:14

Synced to current SVN.

Currently when seeking in a file, you will see all subtitles up to that point in the video quickly flash by. This should be very simple to fix.

Phil Light commented on 2008-03-15 21:42

Oops. Now based on the patch from 15th Oct, with timebar removed. Works correctly when seeking as well.

Marcoen Hirschberg commented on 2008-06-28 19:56

Just tried it. Works pretty well, although I would prefer the text on the bottom of the screen and lines longer than the screen width are broken off. Maybe I should work on it :)

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing