Jump to content


Photo

Subtitle and Italic

Enigma2

  • Please log in to reply
80 replies to this topic

Re: Subtitle and Italic #21 littlesat

  • PLi® Core member
  • 57,102 posts

+698
Excellent

Posted 27 January 2011 - 15:31

Indeed gstreamer....

Re: Subtitle and Italic #22 libolibo

  • Senior Member
  • 81 posts

0
Neutral

Posted 27 January 2011 - 15:40

Confirm it happens in gstramer

/lib/gui/esubtitle.cpp at line 719 method subrip_unescape_formatting

Re: Subtitle and Italic #23 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 27 January 2011 - 15:44

copy/paste error? /lib/gui/esubtitle.cpp is the e2 file.

Re: Subtitle and Italic #24 littlesat

  • PLi® Core member
  • 57,102 posts

+698
Excellent

Posted 27 January 2011 - 16:22

Strange.... de esubtitle.cpp only contains 318 lines???

Re: Subtitle and Italic #25 libolibo

  • Senior Member
  • 81 posts

0
Neutral

Posted 27 January 2011 - 16:28

My bad !

from here
git://anongit.freedesktop.org/gstreamer/gst-plugins-base
gst/subparse/gstsubparse.c #719

Re: Subtitle and Italic #26 littlesat

  • PLi® Core member
  • 57,102 posts

+698
Excellent

Posted 27 January 2011 - 16:31

I think we should not patch in gstreamer but reverse/fix it in E2.

Re: Subtitle and Italic #27 libolibo

  • Senior Member
  • 81 posts

0
Neutral

Posted 27 January 2011 - 16:39

Agree littlesat but it was just to point out where the encoding is happening.

Re: Subtitle and Italic #28 libolibo

  • Senior Member
  • 81 posts

0
Neutral

Posted 27 January 2011 - 21:49

I think at least this commit is a needed bugfix

https://github.com/l...987539e2ab72b99

It makes no sense trying to match a "<" and then run all that replace_all statements for converting escaped chars.
If we unescape it's because we know the string is escaped, so why trying to look for a "<" ??

Re: Subtitle and Italic #29 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 27 January 2011 - 23:26

yes, it's the quickest workaround for now, I'll commit it

Re: Subtitle and Italic #30 littlesat

  • PLi® Core member
  • 57,102 posts

+698
Excellent

Posted 28 January 2011 - 09:10

Thanks libolibo... a nice example of helping us as pli is opensource!!!

Re: Subtitle and Italic #31 libolibo

  • Senior Member
  • 81 posts

0
Neutral

Posted 28 January 2011 - 11:08

Super!! I can see your commit on git!
I am quite confused about the deployment workflow.
Shall I just wait next night build and do a opkg update or do I have to re-flash my box?

Re: Subtitle and Italic #32 littlesat

  • PLi® Core member
  • 57,102 posts

+698
Excellent

Posted 28 January 2011 - 11:17

If you're using wlan you should reflash or downgrade a packager. Otherwise you can just use the opkg 'trick'.

Re: Subtitle and Italic #33 libolibo

  • Senior Member
  • 81 posts

0
Neutral

Posted 29 January 2011 - 12:24

Too bad I am not on a wlan (no drivers for my wifi usb key so far with the given kernel)

This morning (29/01) I have made an update (not from console but from the "remote control") and still got this result... how can I ensure I am running the latest version with "our" patch?

Posted Image
http://cl.ly/1r3S3P161A1k09212Q1G

this is the .srt piece of code:
23
00:01:14,648 --> 00:01:16,248
<i>Move it.</i>
<i>Don't you dare fall.</i>

Could it be that the each segment is in one string and that's why we don't match the </i><i> in the middle of the string :-)

Re: Subtitle and Italic #34 littlesat

  • PLi® Core member
  • 57,102 posts

+698
Excellent

Posted 29 January 2011 - 12:35

Then it seems both lines come as one element... <i>Move it</i>\n<i>Don't you dare fall.<i> because the <i> at the begin and the </i> at the end is indeed removed.... In addition no italic font is selected as for italian and bold there is no special font selected in /usr/share/enigma2/skin_subtitle.xml. All fonts are the same there!!!

There is more work to do to fix this DMM software. A quick fix could be to remove all <i> and </i> etc... from the subtitle string... or rendering each element line by line and change the skin_subtitle.xml aswell.

Re: Subtitle and Italic #35 libolibo

  • Senior Member
  • 81 posts

0
Neutral

Posted 29 January 2011 - 12:44

I say we might check if we have:
1) unescape function
2) regular expression function
3) html strip function

do you know have any knowledge about which libraries function are available in E2 framework ?

Re: Subtitle and Italic #36 littlesat

  • PLi® Core member
  • 57,102 posts

+698
Excellent

Posted 29 January 2011 - 13:11

The quickest work-a-round for now will be editing the srt file so all <i> marker etc are removed from it... then you do not see italic, but also not these markers.

Another quick fix could be simply to remove all <i> markers etc in eSubtitle.cpp and not change the font as it does not currently works at all. Then the subtitles are looking good... but the font is also not change to bold or italic.

In a short term we could consider by removing the '<' detection and simply remove all the <i> </i> <b> </b> markers from the string. What we could do for high lightning... replace the <i> by < and the </i> bij > so these lines are displayed as <Move It.> <Don't you dare fall.> so we still have some information here that these text are a bit different. - or what we could do is instead if italian and bold change the font color by using excape codes. So </i> and </b> is replace by white and <i> is e.g. yellow and <b> is e.g. green (we can change colors in one line).

Please note I'm only creating work-a-rounds here. To fix it complete a lot more has to be done... I do know if this will add a lot af value as there are not many subtitles with italic etc... At least I never saw one before.

Re: Subtitle and Italic #37 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 29 January 2011 - 14:17

I think we should match opening and closing tags.
Only works if they stay within a single element of course, but I think so far this has always been the case.

Re: Subtitle and Italic #38 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 29 January 2011 - 14:19

do you know have any knowledge about which libraries function are available in E2 framework ?


don't you dare linking to libpanga ;)
(though that would obviously provide all the tools to parse panga layout)

we have to stick to a simple manual parser, just make it a bit more intelligent.

Re: Subtitle and Italic #39 littlesat

  • PLi® Core member
  • 57,102 posts

+698
Excellent

Posted 29 January 2011 - 14:23

But in this case one element can contain two lines..... were parts of the text could be italian or bold...

Re: Subtitle and Italic #40 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 29 January 2011 - 14:45

then we simply decide whether or not the whole element should be normal/italic/bold.
In this case, that would have worked, as the whole element is italic.
Easiest would be to follow the latest found tag.



3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users