Ffmpeg inaccurate cutting with ts and m3u8 files despite resamping audio filter

后端 未结 1 1192
盖世英雄少女心
盖世英雄少女心 2021-01-27 20:27

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

相关标签:
1条回答
  • 2021-01-27 21:09

    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.

    0 讨论(0)
提交回复
热议问题