Search code examples
video-streaminguploading

Service for uploading video and sharing between users


So here's the scenario: a user is chatting with another user in our app's messaging service and wants to send them a video inside the chat, currently they cannot do this and are abandoning our app. We want add a video upload feature inside the chat directly (in which there is or more users.) where a user can take a video with their phone and send it to the second user via our messenger. The second user will then see the message as a link or thumbnail on which they can click and stream the video.

I am looking for a service to handle the uploading/video streaming.

There should also be security around streaming the video, aka a user should not be able to stream a video unless the video has been sent to them via chat (even if they somehow manage to obtain the url.)

This is essentially a clone of what Facebook does when you send a video in Facebook messenger.

One solution I explored involved using S3 and url signing for video uploading, and Cloud Front and url signing for video streaming, but this solution involves a bunch of backed work and data model changes. Ideally the service would live outside of our backend.

I've also looked at services like Brightcove, but they do not offer this type of solution out of box (aka custom solution for looooooads of money that we don't have)

In a nut shell im looking for a pre-baked service which offer following:

  • Allow thousands of users to upload videos
  • Allow thousands of users to stream videos uploaded by other users with some security around who can stream the video.

Does anyone have experience with this issue or know of any services which can offer solutions?


Solution

  • There are a number of ways to go for what you are looking for, depending on the required engineering needed.

    Microsoft Azure Media Services has quite a bit more of already created video infrastructure compared to AWS. Using that, it shouldn't require many resources to build what you are aiming for. You will likely not need much more than what Brightcove would require.

    Mux has a new and extremely simple API and straight forward business model for what you are aiming for. It might be a fairly good fit, considering they do a lot to hide complexity and make it simple to work with.

    I haven't tried it myself, but Cloudflare Stream looks like it might be an interesting product for your case as well.

    In general, services where you are transcoding the video before viewing it, will give a noticeable delay from sending to being able to view on the other end. If you want to avoid that, you might record MP4 snippets, and simply use them, as they would be playable on most handsets. Using S3 as a backend for that, or whatever storage engine you have, shouldn't be complex, and i doubt you will find a much simpler service than S3 for that.