Bobloblaw9714601912
Bobloblaw9714601912

Reputation: 35

Force libvlc/libvlcsharp to transcode video for chromecast?

I am currently using libvlcsharp and trying to use the ability to stream to chromecast. It works in "most" cases, specifically the ones where it sends the video over and the chromecast already supports the video format (e.g. AVI). If I do something newer like x265, I get a black screen because chromecast doesn't support that format.

In the VLC Android app, is smart enough to tell you that it's going to transcode the video because it detected it in a format that the chromecast doesn't support (It's a dialog that pops up that says that the battery may be affected because it transcodes it). In libvlcsharp, I want to always transcode. Is there a way of doing this from the libvlcsharp API or something I can pass to libvlc?

Upvotes: 1

Views: 883

Answers (1)

mfkl
mfkl

Reputation: 2184

See options in https://code.videolan.org/videolan/vlc-android/-/blob/master/application/resources/src/main/java/org/videolan/resources/VLCOptions.kt#L222

if (hasRenderer) {
            media.addOption(":sout-chromecast-audio-passthrough=" + prefs.getBoolean("casting_passthrough", true))
            media.addOption(":sout-chromecast-conversion-quality=" + prefs.getString("casting_quality", "2")!!)
        }

This should probably be added by default in libvlcsharp. Feel free to contribute a PR.

Upvotes: 1

Related Questions