tvkitchen / appliances

A one stop shop for official TV Kitchen Appliances
GNU Lesser General Public License v3.0
3 stars 0 forks source link

Ingesting m3u8s #148

Open slifty opened 2 years ago

slifty commented 2 years ago

Task

Description

There are some internet-based TV stations that broadcast using an m3u8 url. We should be able to ingest that type of resource.

m3u8s aren't streams themselves, but rather are an index pointing to media resources. It's not clear yet if this should be part of an existing receiver or become a new receiver.

slifty commented 2 years ago

My first goal is to see if I can use ffmpeg to convert an m3u8 into an mpegts stream that has captions embedded. This would be the best option, though in theory we could have a receiver that generates a caption stream AND a video stream all in one... But that would be a lot more effort if ffmpeg's solved the problem!

Some resources I've found in my search:

slifty commented 2 years ago

I'm worried I'm just missing something, but it does seem like ffmpeg might not have the ability to mux together / recombine an HLS (e.g. m3u8) without dropping the captions. I've asked a Stack Overflow question about it in case the community knows a way.

I did learn there is an experimental mode which will, in theory, allow ffmpeg to recognize vtt subtitles in HLS, but this setting must do something else I don't fully understand, since when -strict experimental is set nothing is written. There's just no stream data at all. That said, "handle subtitles" seems to be listed in code as a TODO

I'll spend another 30 minutes trying to figure out why that is, but it's possible that I'll need to create a vtt to text appliance.

I'd likely want to just update the HTTPtoVideo appliance to support m3u8 urls (and emit VTT atoms) but it's also possible we would want m3u8 to be written as a completely separate appliance.