Repository: yt-dlp
Issue: `--split-chapters` flag to split not only video but also the subtitle file according to chapters
Labels: bug,enhancement,triage

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm asking a question and **not** reporting a bug or requesting a feature
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [X] I've verified that I'm running yt-dlp version **2023.03.04** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar questions **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)

### Please make sure the question is worded well enough to be understood

the `--split-chapters` flag worked wonderfully well to split a video into chapters. 
However when I do a similar thing to its auto-generated (or embedded) subtitle file, it just gives me one unsplit subtitle file.

Tried the one from https://github.com/yt-dlp/yt-dlp/issues/2182#issuecomment-1003368410 but of no use.

`yt-dlp "https://www.youtube.com/watch?v=abbdJ4Yfm54&ab_channel=RoadsideCoder" -S res,ext:mkv:m4a --embed-subs --split-chapters --sponsorblock-remove  "all"`

Am I missing something here?

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output
```
[debug] Command-line config: ['https://www.youtube.com/watch?v=abbdJ4Yfm54&ab_channel=RoadsideCoder', '-S', 'res,ext:mkv:m4a', '--embed-subs', '--split-chapters', '--sponsorblock-remove', 'all', '-vU']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (pip)
[debug] Python 3.11.2 (CPython arm64 64bit) - macOS-12.5-arm64-arm-64bit (OpenSSL 1.1.1t  7 Feb 2023)
[debug] exe versions: ffmpeg 5.1.2 (setts), ffprobe 5.1.2
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1786 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.03.04, Current version: stable@2023.03.04
yt-dlp is up to date (stable@2023.03.04)
[youtube] Extracting URL: https://www.youtube.com/watch?v=abbdJ4Yfm54&ab_channel=RoadsideCoder
[youtube] abbdJ4Yfm54: Downloading webpage
[youtube] abbdJ4Yfm54: Downloading android player API JSON
[info] abbdJ4Yfm54: Downloading subtitles: live_chat
[debug] Sort order given by user: res, ext:mkv:m4a
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, res, vext:mkv(2), aext:m4a(8), quality, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, hasaud, id
[SponsorBlock] Fetching SponsorBlock segments
[debug] SponsorBlock query: https://sponsor.ajay.app/api/skipSegments/7e18?service=YouTube&categories=%5B%22music_offtopic%22%2C+%22intro%22%2C+%22interaction%22%2C+%22filler%22%2C+%22sponsor%22%2C+%22outro%22%2C+%22selfpromo%22%2C+%22preview%22%5D&actionTypes=%5B%22skip%22%2C+%22poi%22%2C+%22chapter%22%5D
WARNING: Some SponsorBlock segments are from a video of different duration, maybe from an old version of this video
[SponsorBlock] No matching segments were found in the SponsorBlock database
[debug] Default format spec: bestvideo*+bestaudio/best
[info] abbdJ4Yfm54: Downloading 1 format(s): 248+140
[info] Writing video subtitles to: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].live_chat.json
[debug] Invoking youtube_live_chat downloader on "https://www.youtube.com/watch?v=abbdJ4Yfm54&bpctr=9999999999&has_verified=1"
[youtube_live_chat] Downloading live chat
[youtube_live_chat] Total fragments: unknown (live)
[download] Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].live_chat.json
[download] 100% of  163.14KiB in 00:00:02 at 61.58KiB/s
[debug] Invoking dashsegments downloader on "https://rr8---sn-bpb5oxu-3c2r.googlevideo.com/videoplayback?expire=1679622568&ei=SK0cZKIg_pz1_A_RiouwAQ&ip=2a09%3Abac1%3A36c0%3A2c60%3A%3Aca%3Acb&id=o-AOP4kQxLp-mwgdaGSQbT47vVm9TceUqd0dvpXH2Suq6M&itag=248&source=youtube&requiressl=yes&mh=Wx&mm=31%2C29&mn=sn-bpb5oxu-3c2r%2Csn-cvh76nes&ms=au%2Crdu&mv=m&mvi=8&pl=64&initcwndbps=282500&spc=99c5CYfpiKYhsVBPJTK-wpn-GWPjKxM&vprv=1&svpuc=1&mime=video%2Fwebm&gir=yes&clen=206084391&dur=2943.240&lmt=1644763946314570&mt=1679600701&fvip=2&keepalive=yes&fexp=24007246&c=ANDROID&txp=5437434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAMkG7SrUqmQdMSrOtubbKtrmghIBKm_w213waXnBDplSAiEAlujIIhTFmUgs8orhUgBzAYp4EPVkFRIXstWmPbi0Vuk%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgCNBwLAF6duCZyPH3Q5StwZLUm7I4sF9hgK00NLcCG3gCIQCJo_kkGksOrQZb2qT-MlUrUzvPi09LlLUX0MT0DwSxAg%3D%3D"
[dashsegments] Total fragments: 20
[download] Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].f248.webm
[download] 100% of  196.54MiB in 00:00:45 at 4.34MiB/s
[debug] Invoking dashsegments downloader on "https://rr8---sn-bpb5oxu-3c2r.googlevideo.com/videoplayback?expire=1679622568&ei=SK0cZKIg_pz1_A_RiouwAQ&ip=2a09%3Abac1%3A36c0%3A2c60%3A%3Aca%3Acb&id=o-AOP4kQxLp-mwgdaGSQbT47vVm9TceUqd0dvpXH2Suq6M&itag=140&source=youtube&requiressl=yes&mh=Wx&mm=31%2C29&mn=sn-bpb5oxu-3c2r%2Csn-cvh76nes&ms=au%2Crdu&mv=m&mvi=8&pl=64&initcwndbps=282500&spc=99c5CYfpiKYhsVBPJTK-wpn-GWPjKxM&vprv=1&svpuc=1&mime=audio%2Fmp4&gir=yes&clen=47634580&dur=2943.291&lmt=1644763429390409&mt=1679600701&fvip=2&keepalive=yes&fexp=24007246&c=ANDROID&txp=5432434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAP0F-fH-attNuw4GDbix564ZZNlbfDSfgMcSaSRcZA2MAiAdOj6lI-OTWK0DUeT4UaBPBKTSN8GeFRqC9yVrBmjueg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgCNBwLAF6duCZyPH3Q5StwZLUm7I4sF9hgK00NLcCG3gCIQCJo_kkGksOrQZb2qT-MlUrUzvPi09LlLUX0MT0DwSxAg%3D%3D"
[dashsegments] Total fragments: 5
[download] Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].f140.m4a
[download] 100% of   45.43MiB in 00:00:10 at 4.30MiB/s
[Merger] Merging formats into "Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].f248.webm' -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].f140.m4a' -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].temp.mkv'
Deleting original file Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].f248.webm (pass -k to keep)
Deleting original file Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].f140.m4a (pass -k to keep)
WARNING: JSON subtitles cannot be embedded
[ModifyChapters] SponsorBlock information is unavailable
[debug] ffprobe command line: ffprobe -hide_banner -show_format -show_streams -print_format json 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv'
[SplitChapters] Splitting video by chapters; 19 chapters found
[SplitChapters] Chapter 001; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 001 Intro [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 0 -t 58.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 001 Intro [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 002; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 002 Round 1 [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 58.0 -t 14.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 002 Round 1 [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 003; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 003 Q1 - map vs forEach [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 72.0 -t 150.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 003 Q1 - map vs forEach [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 004; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 004 Q2 - null vs undefined [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 222.0 -t 135.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 004 Q2 - null vs undefined [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 005; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 005 Q3 - Event Deligation [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 357.0 -t 184.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 005 Q3 - Event Deligation [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 006; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 006 Q4 - Array.flat implementation [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 541.0 -t 334.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 006 Q4 - Array.flat implementation [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 007; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 007 Q5 - Project Showcase [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 875.0 -t 47.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 007 Q5 - Project Showcase [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 008; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 008 Round 2 [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 922.0 -t 3.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 008 Round 2 [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 009; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 009 Q1 - var vs let vs const [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 925.0 -t 168.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 009 Q1 - var vs let vs const [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 010; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 010 Q2 - setTimeout Based Output [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 1093.0 -t 226.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 010 Q2 - setTimeout Based Output [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 011; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 011 Q3 - call, bind and apply [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 1319.0 -t 173.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 011 Q3 - call, bind and apply [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 012; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 012 Q4 - Infinite Currying [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 1492.0 -t 180.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 012 Q4 - Infinite Currying [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 013; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 013 Q6 - Implement Promise.all() [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 1672.0 -t 273.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 013 Q6 - Implement Promise.all() [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 014; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 014 Round 3 [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 1945.0 -t 3.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 014 Round 3 [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 015; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 015 Q1 - React Lifecycle methods [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 1948.0 -t 462.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 015 Q1 - React Lifecycle methods [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 016; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 016 Q2 - Ways to center a div [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 2410.0 -t 172.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 016 Q2 - Ways to center a div [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 017; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 017 Q3 - CSS Box Model [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 2582.0 -t 82.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 017 Q3 - CSS Box Model [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 018; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 018 Q4 - Implement Debounce [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 2664.0 -t 249.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 018 Q4 - Implement Debounce [abbdJ4Yfm54].mkv'
[SplitChapters] Chapter 019; Destination: Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 019 Round 4 [abbdJ4Yfm54].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -ss 2913.0 -t 30.0 -i 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions [abbdJ4Yfm54].mkv' -map 0 -dn -ignore_unknown -c copy -movflags +faststart 'file:Frontend Interview Experience (Unacademy) - Javascript and React JS Interview Questions - 019 Round 4 [abbdJ4Yfm54].mkv'
```