vishen / go-chromecast

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

Start time of live streams #189

Open xroberx opened 6 months ago

xroberx commented 6 months ago

Hi and thank you for your great app, I love it!

I just noticed that a start time of 0 does not always correspond to the currently playing (live) stream...

For example, if you load the stream on "https://rtvelivestream.akamaized.net/rtvesec/la2/la2_main_dvr_720.m3u8", which is from a well-known Spanish TV channel, you will get the following ouput from "go-chromecast --first watch":

CHROMECAST BROADCAST MESSAGE: type=MEDIA_STATUS proto=CASTV2_1_0 (namespace=urn:x-cast:com.google.cast.media) aa406abc-327a-4bb8-b5f2-78fff981e9a3 -> * | {"type":"MEDIA_STATUS","status":[{"mediaSessionId":1,"playbackRate":1,"playerState":"PLAYING","currentTime":2.100366,"supportedMediaCommands":274447,"volume":{"level":1,"muted":false},"activeTrackIds":[],"currentItemId":1,"repeatMode":"REPEAT_OFF","liveSeekableRange":{"start":0,"end":7185,"isLiveDone":false}}],"requestId":0}

As you can see, the "liveSeekableRange" goes from 0 to 7185, which is about 7185/60/60 = 2 hours of video (that is, you can watch up to 2 hours in the past). So, if you load the video through "go-chromecast load", you will see the stream from 2 hours ago, not the currently playing stream. However, if I play the stream with mpv or ffplay, or if I transcode the video before sending it to the chromecast, or if I pass the option "--start-time -1" to the load command, the played stream corresponds to the live stream because it starts with a currentTime of ~7185 instead of 0. What do you think about this?

Best regards, Robert.

nudgegoonies commented 4 months ago

Maybe this is related to the german Television ARD: https://mcdn.daserste.de/daserste/de/master.m3u8 When i simply do a go-chromecast load i don't get the current livestream but also something one or two hours ago.