Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow loading .vtt from remote urls #253

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

glensc
Copy link

@glensc glensc commented Mar 30, 2020

This bypasses the need for a local server and the need to keep castnow command running.


This post here serves as a small blog post on how to play content on Chromecast with subtitles, without having need to keep castnow running. I used to re-encode media to .mp4 and burn subtitles into a video stream. this is not necessary.

I managed to get castnow to make Chromecast serve all content from remote servers:

  1. a .mkv container with h264 video, Vorbis audio
  2. .vtt subtitles on a remote server

Chromecast (ultra) plays fine .mkv container, just google chrome doesn't play it, so it's common to understand Chromecast can't support .mkv:

and the official docs don't mention Matroska (yet?):

for audio, it's important it to be "channels: 2" aka, stereo, Chromecast won't play "5.1" audio. sometimes I've seen it not even opening media. sometimes it just plays video only.

for FFmpeg convert from 5.1, the extra options also include pan filter, otherwise, it would sound too loud or too low: -ac 2 -af "pan=stereo|FL=FC+0.30*FL+0.30*BL|FR=FC+0.30*FR+0.30*BR":

as for .vtt serving, it's important:

  1. have proper content-type: text/vtt; charset=utf-8
  2. must-have Access-Control-Allow-Origin: * (or similar) header

for Lighttpd, this can be done with:

mimetype.assign += (
       ".vtt"         => "text/vtt; charset=utf-8",
)

# https://redmine.lighttpd.net/projects/1/wiki/Docs_ModSetEnv
server.modules += (
    "mod_setenv",
)
setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )

This bypasses need for local server and need to keep command running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant