ExoPlayer MKV File To GoogleCast

Created on 6 Jan 2020  路  8Comments  路  Source: google/ExoPlayer

The video plays well but it stops every 2 - 5 seconds (stuttering) and then it plays again , i have the file hosted on my localhost server (192.168.1.2/video/test.mkv)

This only happens on chromecast , on the phone i can watch the video without stop / stuttering.

question

Most helpful comment

Marc is correct. Chromecast doesn't support the mkv container format officially.

Do you know which generation Chromecast you have? 27 Mbps is up there, even for a Chromecast Ultra. Even for 4k streams I dont think Youtube/Netflix/etc go that high.

I think your best bet would be to transcode the file to a lower bitrate using something like ffmpeg (and switch to a supported container format in the process).

All 8 comments

This seems to be a problem on the Chromecast device rather than a problem with ExoPlayer.

I haven't found matroska as a supported container format on the "Supported Media for Google Cast" page. The behaviour you are observing suggests that the device can extract and play though.

I think it depends on the sample format which are packaged into the mkv container.
Maybe @mjmancuso can give us a short comment about MKV support on cast devices?

In any case. If you want us to look into this some more we'd need to have a link to the media file for testing.

I know that the mkv format is not supported by googlecast, but I managed to make it work with the exoplayer extension for cast, and it works very well, but the video is very often buffered every 5 seconds, it's not smooth

BDRemux 1080p
Video:MPEG-4 AVC, 1920x1080, 27.6 Mbit / s, 23.976 fps

Those are the statistics of the video, it is 1080p, it is not even 4k, on YouTube if I try to cast a video in 4k, it plays well without interuptions.

With VLC Player i can send it to chromecast and it works without buffering.

@marcbaechinger
Is it possible to put a maximum bitrate with DefaultBandwidthMeter? But will that also work by sending it to chromecast?

The cast extension of ExoPlayer only sends the uri to the cast device. Then the cast device does download, extract and play the file without further interaction with the Android app.

So I don't think that tweaking the maximum bitrate on ExoPlayer side has any effect.

If you want us to look into this some more we'd need to have a uri to the media file for testing.

I have the video in localhost so it is impossible to give you the url, I already contacted googlecast support and they said that the video has too much bitrate thats why it buffers a lot, I want to know a way to modify the bitrate when I send the video to googlecast.

ExoPlayer's cast extension just passes the uri to the cast device. ExoPlayer and the cast extension can not help you modifying the remote file which the cast device should play.

Marc is correct. Chromecast doesn't support the mkv container format officially.

Do you know which generation Chromecast you have? 27 Mbps is up there, even for a Chromecast Ultra. Even for 4k streams I dont think Youtube/Netflix/etc go that high.

I think your best bet would be to transcode the file to a lower bitrate using something like ffmpeg (and switch to a supported container format in the process).

Marc is correct. Chromecast doesn't support the mkv container format officially.

Do you know which generation Chromecast you have? 27 Mbps is up there, even for a Chromecast Ultra. Even for 4k streams I dont think Youtube/Netflix/etc go that high.

I think your best bet would be to transcode the file to a lower bitrate using something like ffmpeg (and switch to a supported container format in the process).

You are right, my internet is not so powerful to support 27 Mbps, I just lowered the bitrate to 24mbps and it worked fine.

Was this page helpful?
0 / 5 - 0 ratings