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

Can we tweak hardware/software decoding in Exoplayer? #3039

Closed
malleshamdasari opened this issue Jul 9, 2017 · 8 comments
Closed

Can we tweak hardware/software decoding in Exoplayer? #3039

malleshamdasari opened this issue Jul 9, 2017 · 8 comments
Labels

Comments

@malleshamdasari
Copy link

I have searched a lot on hardware acceleration of video decoding in Exoplayer but I couldn't find any information. I have looked at Mediacodec folder of explayer code to tweak but couldn't get success. Is exoplayer using hardware decoders? If so, how can I tweak?

@andrewlewis
Copy link
Collaborator

Android provides a list of codecs in priority order, and ExoPlayer picks the first usable decoder that supports playback of input media format. This is generally a hardware accelerated decoder if the device has one for the format. Please read MediaCodecUtil for details of how this works.

Generally it's best to leave codec selection up to ExoPlayer. However, if you need to change the behavior you can implement a custom MediaCodecSelector. For example, you could put in logic that picks only decoders with names starting "OMX.google.", which should be software decoders. Different devices have different decoders so the logic would need to be robust to this. We also provide the vp9 extension, which provides a separate non-MediaCodec based renderer that wraps libvpx for VP9 decoding in software.

@brandoncodes
Copy link

brandoncodes commented Jul 13, 2017

Hey I'm not sure if this will help you. From what I understand with Exoplayer it will attempt to choose the best codec for you, it checks to see what hardware acceleration is available on the device. You'll see this in the debug logs; it'll tell you what is unsupported, and then in a video/audio debug listener you can see which codec was chosen.

As a side note, if you need software decoders you can use:

DefaultRenderersFactory rf = new DefaultRenderersFactory(this.getApplicationContext(), null, DefaultRenderersFactory.EXTENSION_RENDERER_MODE_ON); player = ExoPlayerFactory.newSimpleInstance( rf, new DefaultTrackSelector(), new DefaultLoadControl() );

If you want to prefer the use of software decoders (i.e. ffmpeg for audio) just set the EXTENSION_RENDERER_MODE_ON to EXTENSION_RENDERER_MODE_PREFER

@malleshamdasari
Copy link
Author

Hi brandon, Thank you very much for the response. This is exactly what I was looking for. I will try with EXTENSION_RENDERER_MODE_PREFER. Thanks

@ojw28 ojw28 closed this as completed Jul 31, 2017
@willcun
Copy link

willcun commented Nov 9, 2017

Hello,

Please excuse me if this is the correct place to ask this question. However, I'm new to Exoplayer and I'm trying to get it to work with IIS Smooth Streaming. I have a live stream setup that plays well in IE with Silverlight but it doesn't play on Android with Exoplayer. The Expressions Encoder is using IIS Smooth Streaming with VC-1 for Video and WMA Professional for Audio.

When I point Exoplayer to the IIS Smooth Stream the seek bar shows the amount of time in the stream and at the top it has a button for Audio and a button for Text but no sound or video shows.

Can someone assist me in letting me know what I'm doing wrong? The Smooth Streaming demos that come with Exoplayer work however my live stream doesn't.

@ojw28
Copy link
Contributor

ojw28 commented Nov 9, 2017

Android doesn't support VC-1 or WMA at the decoder level. You really need to be using something a bit more standard (e.g. H.264 and AAC) if you want to target multiple platforms. I don't even think Microsoft's own new browser (Edge) supports Silverlight, by the way. See here.

@willcun
Copy link

willcun commented Nov 9, 2017

ojw28 thank you for the quick response!!!

Ok so going encoder to IIS publishing point doesn't work with the vc-1 codec. Gotcha... Is it possible to use HLS from IIS with the vc-1 codec?

@ojw28
Copy link
Contributor

ojw28 commented Nov 9, 2017

Android does not support VC-1. The HLS specification doesn't even accommodate VC-1, as far as I'm aware.

@willcun
Copy link

willcun commented Nov 9, 2017

Ok... Thanks!! I guess I can stop beating my head against the wall. LOL

@google google locked and limited conversation to collaborators Nov 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants