Split HLS TS segment at specific timestamp I am currently using ffmpeg to segment/transcode a longer transport stream into HLS with 10s segments. Now I want to grab the second segment from the following section:

#EXTINF:10.041667,
bbb_fhd_50s_000.ts
#EXTINF:10.041667,
bbb_fhd_50s_001.ts
#EXTINF:9.666667,
bbb_fhd_50s_002.ts


and split that into two chunks at 3s, result would look like:

#EXTINF:10.041667,
bbb_fhd_50s_000.ts
#EXTINF:3.008000,
bbb_fhd_50s_001_cut1.ts
#EXTINF:7.104000,
bbb_fhd_50s_001_cut2.ts
#EXTINF:9.666667,
bbb_fhd_50s_002.ts


Now, I got this to work using the following commands:

ffmpeg -i bbb_fhd_50s_001.ts -ss 00:00:00.0 -c copy -t 00:00:03.0 bbb_fhd_50s_001_cut1.ts
ffmpeg -i bbb_fhd_50s_001.ts -ss 00:00:03.0 -c copy bbb_fhd_50s_001_cut2.ts
ffprobe -v error -show_entries format=duration   -of default=noprint_wrappers=1:nokey=1 -sexagesimal bbb_fhd_50s_001_cut1.ts
ffprobe -v error -show_entries format=duration   -of default=noprint_wrappers=1:nokey=1 -sexagesimal bbb_fhd_50s_001_cut2.ts 


Now when playing back the new m3u8 the transition between bbb_fhd_50s_000.ts and bbb_fhd_50s_001_cut1.ts works smoothly, but the transition back to the next uncut segment does not (from bbb_fhd_50s_001_cut2.ts to bbb_fhd_50s_002.ts). The video hangs for a couple of seconds after bbb_fhd_50s_001_cut2.ts has finished after which it continues. If I run the following sequence it works fine as well:

#EXTINF:10.041667,
bbb_fhd_50s_000.ts
#EXTINF:9.666667,
bbb_fhd_50s_002.ts


Anyone got any idea what goes wrong at the ending of bbb_fhd_50s_001_cut2.ts, and how to cut it correctly?
Try inserting EXT-X-DISCONTINUITY between those splitted ts