Jump to content

Auto PGS to SRT Converter


K-O-K

Recommended Posts

Hi, let me start off by saying that Emby its the best streaming server out there! Nice job and keep going!

I think it would be great to have an automatic feature that convert's .pgs subtitles inside .mkv files to .srt.

Let me give you an example of use case that's actually what I'm dealing right now:

I have a 55" LG 4K TV and i'm using the Emby app whis is beautiful btw.
I have several 4K HEVC BluRay movies in .mkv files in the server that have .pgs subtitles and different audio tracks for langs., the thing is that for me to be able to watch those movies I had to turn off all the transcoding options in my user profile.
If I turn on the transcoding options, it tries to burn the subtitles by transcoding the Video file.

 

I think that instead of transcoding the video file, it should be doing something like converting those .pgs existing subtitles to .srt files that are compatible with most DLNA devices.

I think it would be awsome if we could cron this to run on the less server busy hours so the .srt file is ready to play whenever is needed instead of doing it on the fly when maybe there's no enough CPU resources.

 

 

  • Like 1
Link to comment
Share on other sites

Hi.  Trying to convert graphic subs to text would probably be a pretty tall order.

 

Why not just use our subtitle search features to obtain text subs for your items?

Link to comment
Share on other sites

Hi.  Trying to convert graphic subs to text would probably be a pretty tall order.

 

Why not just use our subtitle search features to obtain text subs for your items?

Hi Ebr, Thanks for your prompt reply,

 

I know it isn't straight forward to convert graph text to plain text, but I know it's possible, maybe I'm wrong, but I read there are some OCR Open Source softwares that maybe can be integrated with Emby to acomplish that, perhaps via a pluggin. I think it's a really interesting feature that can beat the competition, and be attractive for users.

 

About the subtitle search, believe me, I've tried, but I can't find any subtitle thats a perfect match for my movie, and since we don't have the subtitle adjustment/sync feature, there's nothing I can do to use those but to manually edit them which could be a pain.

  • Like 1
Link to comment
Share on other sites

There is and I've been playing with this a lot but would suggest not doing this unless it's impossible to download an SRT or other text based subtitle from an online source first.  OCR is always problematic in some way, shape or form.

Link to comment
Share on other sites

Exactly, I think his is useful when you have a movie file with pgs subtitles and you can't find a srt subtitle match for it.

Even if you had the option for adjusting the subtitle offset, I'ts way better to "convert" the subtitle file type beacuse you know for a fact that It will be the best subtitle you can find, the perfect match and everything.

 

Consider also that sometimes hearing impaired people would benefit from this since often the english .pgs subtitles are CC and most of the times you just find regular subtitles out there.

Link to comment
Share on other sites

I'ts way better to "convert" the subtitle file type beacuse you know for a fact that It will be the best subtitle you can find, the perfect match and everything.

 

That assumes a "perfect" OCR solution...

Link to comment
Share on other sites

That assumes a "perfect" OCR solution...

 

Sure nothing's perfect, but i'ts doable, you can mark the feature as "experimental" while it gets mature enough.

 

I'm sure that you havn't had the chance to strugle with subtitles, but I can tell you, it can be a pain! Sometime's you download a subtitle that starts great but as the movie goes forward it gets awful, even misspelling, gets out of sync, etc.

 

The OCR solution can't be worst than that, and you can be sure that at least it will be in-sync with the movie.

 

Also, keeping in mind that the OCR proccess should know whats "reading", meaning that it knows the type of input, It can be polish to get near perfect.

 

Just a thought. :)

Link to comment
Share on other sites

Personally I don't think something like belongs in Emby for a few reasons.

1) This process isn't speedy and won't work in real time.

2) It would have an extremely small amount of users who need or would use it.

3) Emby already supports downloading subs that will work with your media.

 

For the oddball movie that you can't find a reliable SRT for you can manually convert these yourself offline.

This would be a good thing to try anyway in order to get a feel for speeds and accuracy.

This will also allow you to convert movies you need now.

 

To get started have a read of these:

http://hometheatersns.blogspot.com/2014/06/how-to-extract-pgs-subtitles-and-convert-pgs-to-srt--from-mkv.html

http://best-tablet-converter.com/2014/07/15/how-to-convert-pgs-to-srt-subtitles-with-suprip/

 

That will give you a couple of options.

Link to comment
Share on other sites

Personally I don't think something like belongs in Emby for a few reasons.

1) This process isn't speedy and won't work in real time.

2) It would have an extremely small amount of users who need or would use it.

3) Emby already supports downloading subs that will work with your media.

 

For the oddball movie that you can't find a reliable SRT for you can manually convert these yourself offline.

This would be a good thing to try anyway in order to get a feel for speeds and accuracy.

This will also allow you to convert movies you need now.

 

To get started have a read of these:

http://hometheatersns.blogspot.com/2014/06/how-to-extract-pgs-subtitles-and-convert-pgs-to-srt--from-mkv.html

http://best-tablet-converter.com/2014/07/15/how-to-convert-pgs-to-srt-subtitles-with-suprip/

 

That will give you a couple of options.

 

I agree with this.

Link to comment
Share on other sites

  • 8 months later...
rbjtech

Here is a 3rd part tool that can do it.  I use it all the time.  It can be scripted from the command-line as well.

https://www.nikse.dk/SubtitleEdit/

 

I use Subtitle Edit all the time - it's OCR is good, on an entire PGS movie it may pick out 10 words that it cannot recognize. 

 

I also use it to re-sync SRT subtitles if there is no other option.

 

It's well worth a look - and agree with the others, this sort of functionality is best left to specialist programs such as this.

Link to comment
Share on other sites

Mibok

In my experience you never get perfect results with OCR, it usually take me a couple of hours sometimes an entire afternoon to do that work using Subtitle Edit or some other tools, while it works ok in general lines you often see it takes "I" instead or lower case "L", it struggles with italics taking for example "ae" as a single character that doesn't recognize, character names are other common problem. And is something that is not gonna get better sooner in any OCR software as the technology hasn't evolved that much.

 

 But you can try run Subtitle edit with a single pass and apply some of the included "Common fixes" and you'll get something usable but keep in mind that it WILL have some errors that might ruin the experience of the movie.

 

 Honestly i think that having the alternative of transcoding or downloading the str subs there is no urge to having this tool, but if you want to do it anyway (like i do in most of the cases) the tools are out there and they are fairly easy to use you just need to do some tweaking afterwards.

  • Like 1
Link to comment
Share on other sites

  • 8 months later...
dovedescent7

I run Subtitle Edit and turn off the OCR feature because 99.9% of the time i'm in need of PGS subs from a UHD MKV that is a real release with real legit made subs, and they come out perfect every time without OCR.

I do this because the OCR process takes so long, and without OCR on it gives me the converted PGS to SRT within seconds.

 

I dont see why something like this couldn't be baked into Emby, for English at least. And if OCR makes it too heavyweight just don't enable it in emby.

 

But i have no clue how to make software and no idea if Subtitle Edit is open source or not. lol

 

"Just bake it in" sounds cool though! 

  • Thanks 1
Link to comment
Share on other sites

Deathsquirrel

Sure nothing's perfect, but i'ts doable, you can mark the feature as "experimental" while it gets mature enough.

 

I'm sure that you havn't had the chance to strugle with subtitles, but I can tell you, it can be a pain! Sometime's you download a subtitle that starts great but as the movie goes forward it gets awful, even misspelling, gets out of sync, etc.

 

The OCR solution can't be worst than that, and you can be sure that at least it will be in-sync with the movie.

 

Also, keeping in mind that the OCR proccess should know whats "reading", meaning that it knows the type of input, It can be polish to get near perfect.

 

Just a thought. :)

Try these tools.  They suck.  I started a project to create my own SRT subs from the PGS subs in my blu-ray rips.  It was taking me ages to get pretty mediocre results and that wasn't ages ago, it was a few months.

Link to comment
Share on other sites

I run Subtitle Edit and turn off the OCR feature because 99.9% of the time i'm in need of PGS subs from a UHD MKV that is a real release with real legit made subs, and they come out perfect every time without OCR.

I do this because the OCR process takes so long, and without OCR on it gives me the converted PGS to SRT within seconds.

 

I dont see why something like this couldn't be baked into Emby, for English at least. And if OCR makes it too heavyweight just don't enable it in emby.

 

But i have no clue how to make software and no idea if Subtitle Edit is open source or not. lol

 

"Just bake it in" sounds cool though! 

 

 The problem with using native PGS is that you increase a lot the chance of the server needing to transcode for buring in the subs. Besides Emby Theater i don't know of any other app that play PGS directly, and in your case that your media is 4k UHD transcoding could be a great cpu hogger.

Link to comment
Share on other sites

Deathsquirrel

 The problem with using native PGS is that you increase a lot the chance of the server needing to transcode for buring in the subs. Besides Emby Theater i don't know of any other app that play PGS directly, and in your case that your media is 4k UHD transcoding could be a great cpu hogger.

Shield with the Android client plays them, as does Kodi.

  • Like 2
Link to comment
Share on other sites

Shield with the Android client plays them, as does Kodi.

 

That is correct but it is also correct that, if you need subs on a regular basis, you are much better off obtaining text ones somehow.  I'm just not sure this type of conversion is mature enough to make it worth the effort.

Link to comment
Share on other sites

  • 2 months later...
K1ng_Lear

So, to bring this up again. If a converter will be implemented, it should have a Vobsub support, too. 
 

To the subtitle search tool I can only say that it is very painful to find an marching one. The most subs are incredible out of time or going out of time during play so that a simple offset setting don‘t solve the problem. 
 

The simplest solution from user site, but the most challenging from dev site, would be a full support for the sub formats in the clients.  ;)  I know that this will be never happen, so a converter, maybe as scheduled task, will be the best alternative. The tool I am using works very fine with English but I have to start every transfer by hand. 

Link to comment
Share on other sites

  • 2 years later...
Ronstang
On 2/26/2020 at 3:27 PM, dovedescent7 said:

I run Subtitle Edit and turn off the OCR feature because 99.9% of the time i'm in need of PGS subs from a UHD MKV that is a real release with real legit made subs, and they come out perfect every time without OCR.

Thank you.....this statement made me revisit SubtitleEdit.....which is hands down the best Subtitle software out there....but I had given up on trying to use it to convert PGS subs (which I have a crap-ton of) and searching online is hit or miss and you have to check them and often re-sync them.  I did not know you could do this without OCR which is horrible.  So I tried it with the Tesseract 5.2.0 option and downloaded the two language packs I needed.  Boy does this work AWESOME!!! It was relatively fast, extremely accurate and it only stopped and prompted for a decision mostly for Proper Names and oddball contractions.  Plus, it perfectly maintained the formatting with italics, capitalizatin, brackets etc. 

So my new procedure is to use MKVCleaver to extract the subs....convert them with SE...use MKVToolNix to save the MKV file sans the PGS subs....delete the original MKV....rename the new MKV.  This works well, plus I keep the PGS subs externally just in case but this way I have them if I need them but emby ignores them but it doesn't matter because the SRT subs are basically clones of them.

Thanks so much.....solved a big problem  for me.  Now I just need to figure out why my ripped and encoded Blu-Rays have a second video track in them of ZERO duration that keep emby from playing them but I get rid of it when I make the new MKV as described above so it really isn't a big deal.

Link to comment
Share on other sites

rbjtech
14 hours ago, Ronstang said:

Thank you.....this statement made me revisit SubtitleEdit.....which is hands down the best Subtitle software out there....but I had given up on trying to use it to convert PGS subs (which I have a crap-ton of) and searching online is hit or miss and you have to check them and often re-sync them.  I did not know you could do this without OCR which is horrible.  So I tried it with the Tesseract 5.2.0 option and downloaded the two language packs I needed.  Boy does this work AWESOME!!! It was relatively fast, extremely accurate and it only stopped and prompted for a decision mostly for Proper Names and oddball contractions.  Plus, it perfectly maintained the formatting with italics, capitalizatin, brackets etc. 

So my new procedure is to use MKVCleaver to extract the subs....convert them with SE...use MKVToolNix to save the MKV file sans the PGS subs....delete the original MKV....rename the new MKV.  This works well, plus I keep the PGS subs externally just in case but this way I have them if I need them but emby ignores them but it doesn't matter because the SRT subs are basically clones of them.

Thanks so much.....solved a big problem  for me.  Now I just need to figure out why my ripped and encoded Blu-Rays have a second video track in them of ZERO duration that keep emby from playing them but I get rid of it when I make the new MKV as described above so it really isn't a big deal.

In the latest beta software - @softworkz has done a great deal of work with subtitles and PGS OCR recognition is now included.  Maybe worth a trial and see how it compares to the above methods.

image.png.116b50af3218e266a49dea973c8a7b0f.png

  • Thanks 2
Link to comment
Share on other sites

Ronstang

@rbjtechWhen it says use OCR conversion doe that mean upon playing the movie the first time it automatically creates an SRT subtitle file and places it in the media folder?  I doubt it matters, I am sure this is a valiant effort but I have never seen any OCR that does not need some corrections.  It takes me a few minutes a sub to let it run and add proper names and make small corrections and then place the SRT file in the correct folder....then I don't have to rely on anything.

I have a giant Blu-Ray collection but have just started to really rip and add them so I can do this as I add them which is not much effort.  Right now I am doing the ones I already have but that is a small number, probably only 100.

 

Edited by Ronstang
Link to comment
Share on other sites

Ronstang

The one nice thing about using Subtitle Edit here is that with each film the next can go faster as over time your library of names and slang builds up such that it requires less and less intervention.

Link to comment
Share on other sites

rbjtech

Sure - agree 100% - I use subtitle edit too if I need to - but just thought I'd mention it as maybe the real-time conversion is 'good enough' .. :)

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...