Using PHP to manipulate subtitle .srt files (PHPStorm + XDebug)
Channel:
Subscribers:
4,950
Published on ● Video Link: https://www.youtube.com/watch?v=c10syy2bpwI
Hi guys, this is a video where I do some live PHP programming in PHPStorm with Xdebug.
I wanted to strip some subtitles from a movie, where entries are just describing noise '(SCREAMING)' instead of actual dialogue.
So I made a simple PHP script that reads a .srt file, strips all the lines that follow the '(text)' pattern and write that to a new output file.
00:00 Intro
00:44 Setup project in PHPStorm, read input.srt file
05:12 Split and store subtitles in local array
11:20 Strip unwanted subtitles, debug and write new output.srt
21:42 Testing the new subtitles