I need to accurately seek and cut a video. Some online sources say put -ss in front or after the source. The result is the same for me. In the examples below, the start time is
With HLS as input, use
ffmpeg -y -ss 00:00:13 -copyts -start_at_zero -i input.m3u8 -af aresample=async=1 -ss 15 -to 20 -map 0:a ts-cut-m3u8.wav
Seek a bit earlier than the actual inpoint since TS segments have no global index and hence demuxer seek will start from the next keyframe. Since timestamps are being copied, use output ss/to to set range. aresample will plug timestamp gaps if any. For this input, in the 15 to 20 range there aren't any. There's one earlier at around the 5s mark.