Page 1 of 1

Can You Decode DVB Subtitles

Posted: 21 Mar 2012 22:11
by M_Pink
Hi all.
Iv got a bit of a silly idea and could use some help just thinking it through.

My overall task is advert detection and removal from .ts DVB streams.

My silly idea is that by using an external Subtitle file I could locate the positions of adverts by compeer it against the internal subtitle stream.
Once you get the locations of the adverts it would seam very easy to remove them.

The 1st big problem i see is Decoding the subtitle stream back into text and time-stamps.

Iv not done much reading on this yet.
I read something about the subtitle streams being in a bitmap format and not in text so this probably isnt going to be very easy.
Im hoping that theres some good free bitmap to text translation tools out there i could use.
With the lengths that websites goto for anti-bot registration im guessing bitmap text reading software is easily obtainable.


Very 1st thing i need to do is get my hands on a Subtitle stream.
Is this something that VLC can currently do for me ?
Iv seen something about demuxing but im not sure how to use it yet.
Ill be off to read my way through the help files in just a moment.


Anyways theres my thoughts and plans so can anyone help with some useful links or suggestions about decoding subtitle streams ?
Any help would be greatly appreciated

Re: Can You Decode DVB Subtitles

Posted: 22 Mar 2012 08:45
by Lotesdelere
VLC might be able to extract the subtitle stream but it won't convert it to another format.

However, it should be easier to use dedicated tools such as:

Project-X demuxer:
http://sourceforge.net/projects/project-x/
http://www.oozoon.de/tag/tools-projectx/

Subtitles editors and convertors:
SubExtractor: http://subextractor.codeplex.com
Subtitle Edit: http://www.nikse.dk/SubtitleEdit

Re: Can You Decode DVB Subtitles

Posted: 22 Mar 2012 12:26
by M_Pink
Excellent.
Thanks Very much :D.

I had just given up on trying to using VLC to demux and started downloading project-x.
Iv now got my demuxed .sup stream out of my .ts stream and have converted it to a .srt file with the help of SubtitleEdit.
Its not perfect but i think it will be good enough.
Now its time to do a comparison with a .srt from www.opensubtitles.org

Ill let you know how i get on ;)

Re: Can You Decode DVB Subtitles

Posted: 22 Mar 2012 19:34
by M_Pink
:D

Proof Of Concept
Image
Image

The top image is a list of times i entered whilst watching the film and the lower image is a list of sync errors based on a subtitle comparison.
That is enough to get me excited about the idea.

I still have a little cleaning up to do.
The start and end should be very easy to fix.
The adverts will never be perfect but i should be able to convert the code to fail safe and well it gives you a good place to start your search.

Just in case anyone is interested Php Code

Need to do a shed load of reading about project-x now and see if a cant get it to do a mux and crop.