Chromecast Issues
# stream
l
@Mickie Betz A new problem has emerged with Stream. If we launch our custom Chromecast application first and then select the video workout from our app (or website), the casting fails and an error appears. However, if we start the video first and then initiate the cast, it works as intended. This suggests that there may be an issue at the beginning of the encoding. We have encountered this problem in both our Android and iOS apps, as well as our web app. Re-encoding the video using MUX resolves the issue. At this point, our priority is to ensure proper playback on all modern devices, and we are considering reverting to MUX to achieve this. MUX is an HLS-only service. We also bypassed the MPEG-Dash stream by only loading the HLS manifest. Our developers are attempting to troubleshoot the issue but have not yet identified a specific cause. The same source file, when encoded with MUX, functions correctly in all situations. I have used MediaStreamValidator in the terminal and found Must-Fix errors, although this tool is known to be strict. Any assistance would be greatly appreciated, as we would prefer not to switch back to MUX, given that it operates with a commit (which is the main reason we transitioned to Cloudflare).
To further clarify, it's not happening with all videos, but re-encoding via Cloudflare doesn't seem to help.
m
Thanks for raising- I'm interested in the fact that it's not happening with all videos, would you mind providing the video IDs for some that it happens with and maybe some that it doesn't? That would help us investigate what's going on. Also, if you could detail the error you see when you cast first
l
We've discovered the following. With MUX we don't have errors, with CF Stream we get the following error: "Neither ID3 nor ADTS header was found at 0". This has partly been solved by using:
Copy code
const context = cast.framework.CastReceiverContext.getInstance();
const playerManager = context.getPlayerManager();
// intercept the LOAD request
playerManager.setMessageInterceptor(cast.framework.messages.MessageType.LOAD, loadRequestData => {
            loadRequestData.media.hlsSegmentFormat = cast.framework.messages.HlsSegmentFormat.TS;
            return loadRequestData;
});
context.start();
But even with this in place we receive error 102: error: cast.player.api.ErrorCode.PLAYBACK/102 If we load the video in the Player first, and then start the cast, it works correctly. Our devs suspect there is an issue with the encoded audio. VideoID: 7c19ecfc73a67e82855bf296149ca6c9
Errors:

https://cdn.discordapp.com/attachments/1105457575538983022/1105846519661334599/Schermafbeelding_2023-05-10_om_14.19.10.png

Error

https://cdn.discordapp.com/attachments/1105457575538983022/1105847112668807168/schermafbeelding_2023-05-10_om_10.45.18.png

Hi @Mickie Betz Any update on this?
Also, a frustrating thing (testing wise), is that it doesn't happen always. So it's very difficult to troubleshoot for us. So we can receive the 102 error 5 times in a row, and then having it work a couple of times.
m
Hi there, I'm also struggling to reproduce, but I'm actively working on it. We're talking your feedback (and desire to stay with Cloudflare) seriously.
I think there's a clue here that it doesn't always happen, and wonder if there's something around the loading state? Appreciate you sharing any and all details that could help isolate what's going on
But if we start the stream first in the BitMovin Player, and then initiate the cast from there, we’re not facing issues and it works. So the only thing different then is the first part in the encoding I guess. I did try to troubleshoot and analyse with FFprobe and received an error about Audio DTS timing being invalid (can’t remember the exact message) And that was in the beginning of the file. So I am guessing we’ve solved 1/2 of the puzzle and starting Chromecast after loading the video first skips that erroneous part.
m
Ah, we think we understand what's going on. The Stream PM, Zaid, is going to email you with next steps