# Switching producer codecs

**URL:** <https://mediasoup.discourse.group/t/switching-producer-codecs/3345>\
**Category:** mediasoup libraries\
**Created:** [September 22, 2021, 4:39pm UTC](https://mediasoup.discourse.group/t/switching-producer-codecs/3345 "2021-09-22T16:39:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![skavish](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/skavish/32/1018_2.png) [@skavish](https://mediasoup.discourse.group/u/skavish)\
**Post date:** [September 22, 2021, 4:39pm UTC](https://mediasoup.discourse.group/t/switching-producer-codecs/3345/1 "2021-09-22T16:39:01Z")

</div>

hey guys,

I really like vp9 for screen sharing over vp8/h264, but unfortunately it works only in chrome.  
So I was thinking I can use vp9 while I have only chrome peers, but when non-chrome peer joins the party I would just switch to vp8.

The question is what would be the best way to do it in mediasoup?  
Creating new set of producers/consumers and then closing old ones? Or may be it is possible to “replace” one codec to another in existing producer?

Thanks!

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [September 22, 2021, 4:58pm UTC](https://mediasoup.discourse.group/t/switching-producer-codecs/3345/2 "2021-09-22T16:58:35Z")

</div>

> [@skavish](#):
>
> Creating new set of producers/consumers and then closing old ones?

Yes, there is no other way of doing that. This is not a mediasoup limitation but a WebRTC limitation (and in general a any-RTC limitation).

---

<div class="post-metadata">

**Author:** ![skavish](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/skavish/32/1018_2.png) [@skavish](https://mediasoup.discourse.group/u/skavish)\
**Post date:** [September 22, 2021, 5:26pm UTC](https://mediasoup.discourse.group/t/switching-producer-codecs/3345/3 "2021-09-22T17:26:47Z")

</div>

got it, thanks!
