Jump to content


Photo

Script to extract subs


  • Please log in to reply
10 replies to this topic

#1 neik OFFLINE  

neik

    Advanced Member

  • Members
  • 1155 posts
  • Local time: 12:08 AM

Posted 18 March 2020 - 04:52 PM

Hello,

 

I have been looking for a script that extracts the internal subs of my files so I can convert them to external SRT if necessary (e.g. sub/idx or pgs).

I found this script (https://pastebin.com/MmKQjjYB) in the web and it works like a charm but if a file for instance has two english subs (one normal and one SDH) the first extracted gets overwritten by the second one.

I would like to keep both so I could have a look at both but do not know how I need to adopt the script.

 

Does anyone have a hint?

Anything is appreciated, thank you!



#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 157215 posts
  • Local time: 06:08 PM

Posted 18 March 2020 - 05:02 PM

@PenkethBoy may have some tips.


  • neik likes this

#3 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 4315 posts
  • Local time: 11:08 PM
  • LocationWarrington,UK

Posted 19 March 2020 - 10:09 AM

sorry its a bash script and not my area

 

but a quick look shows it would overwrite any "duplicate" sub language - so needs adjusting to account for duplicates

 

SDH subs are for the hearing impaired so descriptive rather than normal subs 


  • neik likes this

#4 Mibok OFFLINE  

Mibok

    Advanced Member

  • Members
  • 275 posts
  • Local time: 04:08 PM

Posted 30 March 2020 - 07:34 PM

If your media is in mkv, you can try MKVcleaver (it requires MKVtoolnix) it has a gui but you can add multiple files and select the tracks you want to extract, however it doesn't delete te subs from within the source file.

Enviado desde mi Inco Aurora II mediante Tapatalk
  • neik likes this

#5 t1m OFFLINE  

t1m

    Advanced Member

  • Members
  • 35 posts
  • Local time: 06:08 PM

Posted 04 April 2020 - 09:03 PM

did anyone copy this script? the pastebin has been removed. if so, if you post it here, I will adapt it for you.



#6 muzicman0 OFFLINE  

muzicman0

    Advanced Member

  • Members
  • 169 posts
  • Local time: 03:08 PM
  • LocationSoCal

Posted 26 April 2020 - 11:07 AM

Have you tried CCExtractor?  I use it in a script I posted for recorded TV, and has full access via CLI.  Seems to work great, but I am not sure of it only works on Closed Captions, or if it would work on subs in movies as well.

 

EDIT: I tried extracting subtitles on a Blu-ray rip that I have, and I couldn't make it work, so it looks like it only works on Closed Captions.  Sorry.  


Edited by muzicman0, 26 April 2020 - 11:19 AM.


#7 neik OFFLINE  

neik

    Advanced Member

  • Members
  • 1155 posts
  • Local time: 12:08 AM

Posted 02 May 2020 - 06:10 AM

did anyone copy this script? the pastebin has been removed. if so, if you post it here, I will adapt it for you.

 

Sorry for the delay, didn't see your post earlier.

 

Please see attached the current script and thank you for your willing to help.

Attached Files


Edited by neik, 02 May 2020 - 06:11 AM.


#8 t1m OFFLINE  

t1m

    Advanced Member

  • Members
  • 35 posts
  • Local time: 06:08 PM

Posted 02 May 2020 - 06:12 AM

Sorry for the delay, didn't see your post earlier.

Please see attached the current script and thank you for your willing to help.


Thanks!

#9 neik OFFLINE  

neik

    Advanced Member

  • Members
  • 1155 posts
  • Local time: 12:08 AM

Posted 07 May 2020 - 05:32 AM

@t1m, were you able to have a look yet?



#10 t1m OFFLINE  

t1m

    Advanced Member

  • Members
  • 35 posts
  • Local time: 06:08 PM

Posted 07 May 2020 - 06:42 AM

AH Sorry I downloaded it but got side tracked and forgot. I will look this evening.
  • neik likes this

#11 neik OFFLINE  

neik

    Advanced Member

  • Members
  • 1155 posts
  • Local time: 12:08 AM

Posted 27 May 2020 - 05:29 AM

AH Sorry I downloaded it but got side tracked and forgot. I will look this evening.


@t1m, were you able to have a look at it yet?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users