vishen / go-chromecast

cli for Google Chromecast, Home devices and Cast Groups
Apache License 2.0
853 stars 84 forks source link

Native subtitles #22

Open DDoubleU opened 5 years ago

DDoubleU commented 5 years ago

Is there any update about subtitle support? I've read that WebVTT and TTML formats are natively supported (unlike SRT and ASS). Does this mean they can be "pushed" towards the chromecast without any further processing? Is it possible for go-chromecast to check the directory of the file indicated by the "load"-parameter for such subtitle files and add them to the stream?

Thanks in advance!

vishen commented 5 years ago

Hello! I believe this should be possible, however, I haven't ever tried to use subtitles when loading any media with the chromecast. Let me play around with it and see how it works.

w8mr commented 4 years ago

Hi Jonathan, have you looked into this? I would like to take a look into this, it might help if you have already got some information on this.

vishen commented 4 years ago

Hello! Oh awesome! I think I started to look into this but didn't get very far, sorry. I don't have any information that is useful on this unfortunately.

w8mr commented 4 years ago

Ok, I will start from scratch then.

w8mr commented 4 years ago

I've got a Proof of concept working. Still need to:

Mojken commented 3 years ago

Any update on this? I want to use this for anime, and I can't find anything at all that can handle both .mkv files and subtitles. This handles .mkv well, but I really need subtitles working for my intentions.

vishen commented 3 years ago

It looks like @w8mr made some initial progress with https://github.com/w8mr/go-chromecast/commit/1f13ee7facea4c359f404e99e254d4e7d631add5, but unsure if it is complete. Happy to accept a PR if someone knows how to do this?

LeonB commented 3 years ago

Subtitle support would be nice! @w8mr is there any work needed on your branch to be ready for a pull request?

Disonantemus commented 1 year ago
Disonantemus commented 1 year ago

I've got a Proof of concept working. Still need to:

* remove hardcoded url

* discovery of subtitles

* parameter for subtitle

* auto convert from other formats (with ffmpeg)

* extract (and convert) embedded subtitles into separate vtt file

If go-chromecast has an external subtitle switch (maybe --subtitle file.vtt) that allows WebVTT, that don't need to be hardcoded, all the extra steps can be done in shell script with ffmpeg. I have a small shell script that did a while a go for Castnow, that it's not pretty (I'm no programmer), but works.

vishen commented 1 year ago

I don't have ant time to work on this, but I am happy to accept a PR for this feature. I think it would be a useful feature and don't see any reason we couldn't support this if castnow and catt can do it.

vishen commented 1 year ago

Here is the PR that added the initial support for subtitles: https://github.com/skorokithakis/catt/pull/207/files and that eventually uses https://github.com/home-assistant-libs/pychromecast/blob/db4100a1fa9be22be6683c80abfe7ff3a55b31c8/pychromecast/controllers/media.py#L478-L495. It looks like you can serve the subtitles over HTTP and then tell the Chromecast to fetch the subtitles from there.

Jiyuu commented 1 year ago

https://github.com/vishen/go-chromecast/pull/165 not sure if i'll ever polish this myself, so linking it here so others might either use it (it is functioning as far as i can tell for mkv with included subtitles) it has unrelated changes enabling cuda encoding/decoding to accelerate them so you'll have to revert https://github.com/vishen/go-chromecast/pull/165/files#diff-e1208656496d86949b6894b55983f87d25360bc08bc50b138df07965a33b4c29L1131-L1134 if you try to use it but dont have cuda...

anacrolix commented 7 months ago

It should be possible to convert to WebVTT and provide subtitles as external files. This is how I did it with https://github.com/anacrolix/castlink.

Just checking in on this project to see what alternatives exist, since that's a 9 year old Elm app now. I don't see any support for external subtitles is that correct?

vishen commented 7 months ago

That is correct. There is some initial progress here https://github.com/w8mr/go-chromecast/commit/1f13ee7facea4c359f404e99e254d4e7d631add5 but I don't think it was event completed.