# Encode video on mediasoup

**URL:** <https://mediasoup.discourse.group/t/encode-video-on-mediasoup/5018>\
**Category:** Integration\
**Created:** [March 6, 2023, 6:59am UTC](https://mediasoup.discourse.group/t/encode-video-on-mediasoup/5018 "2023-03-06T06:59:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bigcat](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@Bigcat](https://mediasoup.discourse.group/u/Bigcat)\
**Post date:** [March 6, 2023, 6:59am UTC](https://mediasoup.discourse.group/t/encode-video-on-mediasoup/5018/1 "2023-03-06T06:59:31Z")

</div>

Would it possible to broadcast mjpeg using plain transport to mediasoup server then encode the video on the server to VP8 to be consumed.

I tested ffmpeg broadcaster which works good, but the CPU usage is very high. So I am thinking if sending the raw stream to the server then encode to vp8 instead of using ffmpeg on the client side. Is this possible?

I would like to know if current implementation of mediasoup support such a thing?

Also could anyone please send me a link of a doc to read and try to figure it out.

Is this the right place for me?

> **[mediasoup :: API](https://mediasoup.org/documentation/v3/mediasoup/api/#PlainTransport)**
>
> Cutting Edge WebRTC Video Conferencing

Thanks

---

<div class="post-metadata">

**Author:** ![Bigcat](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@Bigcat](https://mediasoup.discourse.group/u/Bigcat)\
**Post date:** [March 10, 2023, 1:11am UTC](https://mediasoup.discourse.group/t/encode-video-on-mediasoup/5018/2 "2023-03-10T01:11:26Z")

</div>

@ibc I am afraid to tag you, but I gave up and hope you would provide some tips please.

---

<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:** [March 10, 2023, 6:52am UTC](https://mediasoup.discourse.group/t/encode-video-on-mediasoup/5018/3 "2023-03-10T06:52:08Z")

</div>

I don’t understand, why me?

---

<div class="post-metadata">

**Author:** ![Bigcat](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@Bigcat](https://mediasoup.discourse.group/u/Bigcat)\
**Post date:** [March 10, 2023, 4:22pm UTC](https://mediasoup.discourse.group/t/encode-video-on-mediasoup/5018/4 "2023-03-10T16:22:32Z")

</div>

@ibc because you are a leader of mediasoup.

---

<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:** [March 10, 2023, 4:29pm UTC](https://mediasoup.discourse.group/t/encode-video-on-mediasoup/5018/5 "2023-03-10T16:29:50Z")

</div>

It’s not just me and whether I’m author or not doesn’t mean that I must help everyone if he doesn’t get a solution from others.

Regarding your question: does the mediasoup docs say that it supports encoding of raw video packets?

---

<div class="post-metadata">

**Author:** ![Bigcat](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@Bigcat](https://mediasoup.discourse.group/u/Bigcat)\
**Post date:** [March 10, 2023, 5:28pm UTC](https://mediasoup.discourse.group/t/encode-video-on-mediasoup/5018/6 "2023-03-10T17:28:58Z")

</div>

@ibc I totally understand and respect your busy time. Nobody said it is a must and this is not my expectation. I personally do nit mind helping others and I hope I can get helped as well. However, I am also more than happy to pay for your time if you offer a consultation service. I have not seen anywhere in the docs supports encoding of raw video packets, however I am asking if this is something possible to look into or not. based on your questions, it does not sounds it is possible to do so.

---

<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:** [March 13, 2023, 4:42pm UTC](https://mediasoup.discourse.group/t/encode-video-on-mediasoup/5018/7 "2023-03-13T16:42:42Z")

</div>

There is a category for paid work:

> **[Job Opportunities 💰](https://mediasoup.discourse.group/c/job-opportunities/10)**
>
> Post into this category if you are looking for professional support about mediasoup or if you are looking for developers to work on your mediasoup based project.

---

<div class="post-metadata">

**Author:** ![Bigcat](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@Bigcat](https://mediasoup.discourse.group/u/Bigcat)\
**Post date:** [March 13, 2023, 5:59pm UTC](https://mediasoup.discourse.group/t/encode-video-on-mediasoup/5018/8 "2023-03-13T17:59:57Z")

</div>

Sure, this seems good option if I know mediasoup would be good my project. I am just trying to evaluate the options and see what works.

As I have not gotten much of help here. It seems this fourm mainly for professional services and I could have been getting wrong expectations.

Thanks for your help anyways.

---

<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:** [March 14, 2023, 10:06am UTC](https://mediasoup.discourse.group/t/encode-video-on-mediasoup/5018/9 "2023-03-14T10:06:33Z")

</div>

Your question is about sending raw video to mediasoup (so your ffmpeg client doesn’t use that much CPU) with the hope that mediasoup will do magic by encoding raw video without consuming CPU.

mediasoup proxies RTP. It’s not a encoder. You can send such a raw video frames to the server in which mediasoup runs but then you need some encoder in there that encodes it using some video codec and packetizes it into RTP packets. I assume this can be done with ffmpeg and gstreamer, but no idea. Anyway nobody does that so I suggest you rethink your solution.

---

<div class="post-metadata">

**Author:** ![Bigcat](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@Bigcat](https://mediasoup.discourse.group/u/Bigcat)\
**Post date:** [March 14, 2023, 9:20pm UTC](https://mediasoup.discourse.group/t/encode-video-on-mediasoup/5018/10 "2023-03-14T21:20:40Z")

</div>

@ibc Thank you for your insightful reply. I understand your point of the CPU usage and off course the compute power will be utilized regardless. The source of the video runs on low end machine where I cannot scale up. so I was thinking to balance the load. I do agree with you that I need to rethink about my options and how I can send encoded video from the source to be consume-ready by mediasoup! I am going to see if I can use GPU on the source.
