nschlia / ffmpegfs

FUSE-based transcoding filesystem with video support from many formats to FLAC, MP4, TS, WebM, OGG, MP3, HLS, and others.
https://nschlia.github.io/ffmpegfs/
GNU General Public License v3.0
198 stars 14 forks source link

HLS playback fails after 10-40 seconds on some files #64

Closed nschlia closed 3 years ago

nschlia commented 3 years ago

Some files consistently play 10 to 40 seconds only. Playback would not stop always a the same point, but it does stop somewhere.

The problem is caused by the playtime, there is a limit of 200,000 µs that a HLS segment must at least be long (a value I arbitrarily chose and that is enforced in uint32_t VIRTUALFILE::get_segment_count() const). The limit could be changed, but then other files would fail. This is necessary because browser hiccup on segments which are shorter than these 0.2 seconds.

What happens is e.g. for Overture from Tommy by The Who which is 00:05:20.08 long, creating 32 segments, each 10 seconds long. The last 8,000 ns would create a 33rd segment of just 0.08 seconds.

The internal logic tries to create a 33rd segment which is rejected and reported as error to the caller.

No good, should simply be ignored. I'll create a fix.