neik 835 Posted March 18, 2020 Share Posted March 18, 2020 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! Link to comment Share on other sites More sharing options...
Luke 37019 Posted March 18, 2020 Share Posted March 18, 2020 @@PenkethBoy may have some tips. 1 Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted March 19, 2020 Share Posted March 19, 2020 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 1 Link to comment Share on other sites More sharing options...
Mibok 118 Posted March 30, 2020 Share Posted March 30, 2020 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 1 Link to comment Share on other sites More sharing options...
t1m 8 Posted April 5, 2020 Share Posted April 5, 2020 did anyone copy this script? the pastebin has been removed. if so, if you post it here, I will adapt it for you. Link to comment Share on other sites More sharing options...
muzicman0 59 Posted April 26, 2020 Share Posted April 26, 2020 (edited) 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 April 26, 2020 by muzicman0 Link to comment Share on other sites More sharing options...
neik 835 Posted May 2, 2020 Author Share Posted May 2, 2020 (edited) 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. script_subs.txt Edited May 2, 2020 by neik Link to comment Share on other sites More sharing options...
t1m 8 Posted May 2, 2020 Share Posted May 2, 2020 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! Link to comment Share on other sites More sharing options...
neik 835 Posted May 7, 2020 Author Share Posted May 7, 2020 @@t1m, were you able to have a look yet? Link to comment Share on other sites More sharing options...
t1m 8 Posted May 7, 2020 Share Posted May 7, 2020 AH Sorry I downloaded it but got side tracked and forgot. I will look this evening. 1 Link to comment Share on other sites More sharing options...
neik 835 Posted May 27, 2020 Author Share Posted May 27, 2020 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? Link to comment Share on other sites More sharing options...
dovedescent7 3 Posted September 27, 2020 Share Posted September 27, 2020 On 5/27/2020 at 5:29 AM, neik said: @@t1m, were you able to have a look at it yet? I want to attemt to use this, but I'm hoping there is nothing malicious in this code! Help? This is EXACTLY what I have been looking for though. Questions: 1. This script is In Danish or German but I only speak and type in English. Will the language difference affect how it works? 2. Could someone explain to me, as if I was a child, how I could apply this to my Emby server? 3.Can I create a scheduled task to scan my library daily to extract newly downloaded video's subtitles? Link to comment Share on other sites More sharing options...
neik 835 Posted September 27, 2020 Author Share Posted September 27, 2020 18 minutes ago, dovedescent7 said: I want to attemt to use this, but I'm hoping there is nothing malicious in this code! There is not otherwise I wouldnt post it here! 18 minutes ago, dovedescent7 said: 1. This script is In Danish or German but I only speak and type in English. Will the language difference affect how it works? The script is extracting English and German subs (if available) only. You would need to adapt it to your language. 25 minutes ago, dovedescent7 said: 3.Can I create a scheduled task to scan my library daily to extract newly downloaded video's subtitles? Within Emby idk but you could surely run a cronjob. PS: If you're worried about "your" data then simply create a test setup to learn what the script does... Link to comment Share on other sites More sharing options...
rbjtech 4223 Posted October 7, 2020 Share Posted October 7, 2020 It's a bit of a hack - but this is what I use as part of my media prep script ... "C:\Tools\eac3to\eac3to.exe" -demux "%%x" for %%f in ("\batch\temp\*English*.srt") do copy "%%f" "%%~dx%%~px%%~nx.en.srt" for %%f in ("\batch\temp\*Force*.srt") do copy "%%f" "%%~dx%%~px%%~nx.forced.en.srt" for %%f in ("\batch\temp\*Alien*.srt") do copy "%%f" "%%~dx%%~px%%~nx.forced.en.srt" It basically uses eac3to to demux all the streams, it then copies any .srt files with English in the filename (eac3 named) including SDH etc to the media location. It does the same with forced subs. It then deletes the temp demux files. Nasty, but it works a treat .. Link to comment Share on other sites More sharing options...
Lepresidente 5 Posted May 9, 2021 Share Posted May 9, 2021 I modified the script above to work with my unraid setup and did some code cleanup as well, you might need to do some changes to work natively with out using docker It is hosted on my github page https://github.com/LePresidente/unraid_scripts/blob/master/extract_subtitles.txt 1 Link to comment Share on other sites More sharing options...
marauder 17 Posted November 16, 2021 Share Posted November 16, 2021 I made this one recently. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now