Automatically Replace all instances of the Color Prefix 0x with &H when loading ass/ssa subtitles

Want to help the VideoLAN project? Designers, testers, translators, please come...
This is NOT about GETTING some help.
Forum rules
Please read the forum's rules carefully before posting. This forum should not be used to post VLC usage related questions.
Kamijou Touma
New Cone
New Cone
Posts: 5
Joined: 19 May 2015 22:08

Automatically Replace all instances of the Color Prefix 0x with &H when loading ass/ssa subtitles

Postby Kamijou Touma » 19 May 2015 22:20

Here is an example of a header that will result in Black Subtitles in VLC

Code: Select all

;------------------------------------------------ [V4 Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding ; Normal styles Style: Default, Augie, 32, 0xecffff,0,0,0x003164,0,0,1,2,2,2,20,20,10,0,0 Style: Note, Augie, 25, 0xecffff,0,0,0x777c7f,0,0,1,2,2,6,20,20,10,0,0 ; OP styles Style: English, Inkblob, 25, 0x25d7fd,0,0,0x002899,0,0,1,2,2,2,20,20,15,0,0 Style: Romaji, Koshgarian-Ligh, 19, 0xfff4e6,0,0,0x74491e,0,0,1,1,2,6,20,20,15,0,0 Style: Kanji, Mona, 24, 0xffe8cc,0,0,0x8e5a26,0,0,1,2,2,6,20,20,15,0,0 Style: Kanji-LT, Mona, 24, 0xfff0d0,0,0,0x8e5a26,0,0,1,2,2,5,20,20,50,0,0 Style: Kanji-RT, Mona, 24, 0xfff0d0,0,0,0x8e5a26,0,0,1,2,2,7,20,20,50,0,0 ; ED styles Style: ED-English,Amazone BT, 35, 0xf1e8f7,0,0,0x30204b,-1,0,1,1,2,2,20,20,8,0,0 Style: ED-Romaji, Footlight MT Light, 21, 0xfff4e6,0,0,0x74491e, 0,0,1,1,2,6,20,20,15,0,0 Style: ED-Kanji, MS PMincho, 24, 0xffe8cc,0,0,0x8e5a26, 0,0,1,2,2,6,20,20,15,0,0 ;------------------------------------------------
http://i.imgur.com/DMA77xE.png < image of the issue


Here is an example of a header that will result in properly colored subtitles in VLC

Code: Select all

;------------------------------------------------ [V4 Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding ; Normal styles Style: Default, Augie, 32, &Hecffff,0,0,&H003164,0,0,1,2,2,2,20,20,10,0,0 Style: Note, Augie, 25, &Hecffff,0,0,&H777c7f,0,0,1,2,2,6,20,20,10,0,0 ; OP styles Style: English, Inkblob, 25, &H25d7fd,0,0,&H002899,0,0,1,2,2,2,20,20,15,0,0 Style: Romaji, Koshgarian-Ligh, 19, &Hfff4e6,0,0,&H74491e,0,0,1,1,2,6,20,20,15,0,0 Style: Kanji, Mona, 24, &Hffe8cc,0,0,&H8e5a26,0,0,1,2,2,6,20,20,15,0,0 Style: Kanji-LT, Mona, 24, &Hfff0d0,0,0,&H8e5a26,0,0,1,2,2,5,20,20,50,0,0 Style: Kanji-RT, Mona, 24, &Hfff0d0,0,0,&H8e5a26,0,0,1,2,2,7,20,20,50,0,0 ; ED styles Style: ED-English,Amazone BT, 35, &Hf1e8f7,0,0,&H30204b,-1,0,1,1,2,2,20,20,8,0,0 Style: ED-Romaji, Footlight MT Light, 21, &Hfff4e6,0,0,&H74491e, 0,0,1,1,2,6,20,20,15,0,0 Style: ED-Kanji, MS PMincho, 24, &Hffe8cc,0,0,&H8e5a26, 0,0,1,2,2,6,20,20,15,0,0 ;------------------------------------------------
http://i.imgur.com/7oPGRKl.png < image of the fix

http://i.imgur.com/y2ImD3v.png < comparison with mpc-hc


HandBrake currently Shares this issue with VLC but i have already talked to some of their devs about it and i will be committing a patch that does what the title of this thread says
Last edited by Kamijou Touma on 19 May 2015 23:19, edited 1 time in total.

Rodeo
New Cone
New Cone
Posts: 3
Joined: 19 May 2015 22:26
VLC version: 2.2.1
Operating System: Mac OS

Re: Automatically Replace all instances of the Color Prefix 0x with &H when loading ass/ssa subtitles

Postby Rodeo » 19 May 2015 22:50

I said that I'd look into it, but made no promises of a patch or even an ETA :P

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Automatically Replace all instances of the Color Prefix 0x with &H when loading ass/ssa subtitles

Postby Jean-Baptiste Kempf » 19 May 2015 23:00

It's a libass bug, I think
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Rodeo
New Cone
New Cone
Posts: 3
Joined: 19 May 2015 22:26
VLC version: 2.2.1
Operating System: Mac OS

Re: Automatically Replace all instances of the Color Prefix 0x with &H when loading ass/ssa subtitles

Postby Rodeo » 19 May 2015 23:08

It's a libass bug, I think
I thought so too, but I can't seem to find a definitive reference as to whether colors coded as 0x<foo> are valid. Whether it's a workaround or a fix, making it available in libass would be easiest anyway.

Rodeo
New Cone
New Cone
Posts: 3
Joined: 19 May 2015 22:26
VLC version: 2.2.1
Operating System: Mac OS

Re: Automatically Replace all instances of the Color Prefix 0x with &H when loading ass/ssa subtitles

Postby Rodeo » 19 May 2015 23:09

Aegisub also fails to parse the colors in the header above, FWIW.

Kamijou Touma
New Cone
New Cone
Posts: 5
Joined: 19 May 2015 22:08

Re: Automatically Replace all instances of the Color Prefix 0x with &H when loading ass/ssa subtitles

Postby Kamijou Touma » 19 May 2015 23:25

Made a feature request on Aegisub UserVoice http://aegisub.uservoice.com/forums/126 ... ssa-header
and on HandBrake https://forum.handbrake.fr/viewtopic.php?f=26&t=32481

Both will pretty much be following along with this thread for the time being instead of info being all over the place

Cant make a patch till we know for sure what the culprit is after all :)

Kamijou Touma
New Cone
New Cone
Posts: 5
Joined: 19 May 2015 22:08

Re: Automatically Replace all instances of the Color Prefix 0x with &H when loading ass/ssa subtitles

Postby Kamijou Touma » 21 May 2015 23:44

Added a git issue on libass so they can take a look and give us feedback

https://github.com/libass/libass/issues/178

I honestly still find it weird that mpc-hc can render color with that prefix 0x but meh :| heck if libass ends up just making 0x parse the same way as &H instead of just replacing 0x with &H when it's parsed than that works too.

But thats only if that's the issue.

Kamijou Touma
New Cone
New Cone
Posts: 5
Joined: 19 May 2015 22:08

Re: Automatically Replace all instances of the Color Prefix 0x with &H when loading ass/ssa subtitles

Postby Kamijou Touma » 22 May 2015 00:01

Confirmed a known libass "low-priority" issue by a collaborator

He said he will spend some time working on a full fix.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Automatically Replace all instances of the Color Prefix 0x with &H when loading ass/ssa subtitles

Postby Jean-Baptiste Kempf » 22 May 2015 10:18

Added a git issue on libass so they can take a look and give us feedback

https://github.com/libass/libass/issues/178

I honestly still find it weird that mpc-hc can render color with that prefix 0x but meh :| heck if libass ends up just making 0x parse the same way as &H instead of just replacing 0x with &H when it's parsed than that works too.

But thats only if that's the issue.
MPC-HC uses VSFilter, which is a mess, implementing many things outside of spec.

Since there is no real spec, what is implemented in VSFilter is the de-facto spec... Nice... Not.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.



Return to “Contribute and help the VideoLAN project”

Who is online

Users browsing this forum: No registered users and 11 guests