Giter VIP home page Giter VIP logo

olympic-stream's Introduction

Streaming the 2021 Olympics ๐Ÿฅ‡

Background

Discalimer: This is a weekend project that I don't plan on maintaining but thought it could interesting to share. If you'd like to know more on how the code works, hit me up!

The 2021 Olympics was comping up and i was super excited. I love watching the olympics. my cables provider said they will be broadcasting all the event so I figured they have to have a streaming solution. It's 2021, who watches TV anymore? But, as I soon found out, they don't! I'm only able to see it on TV.

A challenge you say?

The Plan

I have an old laptop running mint, sitting next to my cable box doing nothing so this was the perfect opportunity. The original plan was:

  1. Hook up the cables box to the laptop with a capture card.
  2. Have a server running on the laptop that will be used to connect to my Youtube account and stopping/starting the stream.
  3. Stream my tv on a private stream on youtube.
  4. A chatbot will listen to commands through the chat.

Prerequisites

Before starting i knew some things had to be done beforehand.

  • I bought a cheap capture card which connected my cables box to my laptop.
  • I even bought an HDMI splitter incase HDCP was gonna be a problem but ended up not using it.
  • I installed OBS on the laptop and configured a basic 720p scene.
  • I installed OBS websocket extension and configured the username and password.

Chain of events

I set an Express server and used the OAuth API to connect to my google account on my server. Every server restart it checks whether the tokens are valid and resets them if not.

Next up I used the Youtube V3 API to do all things youtube like creating a new broadcast, reading comments, closing the livestream, etc.

Everything looked great. All I had to do is connect to OBS and we have live POC. Chat functions is the only thing missing. Before I move on, I need to test the stream itself.

But wait, a twist!

What can I say? I did'nt expect them to check copyrights on a private stream. This is a major setback because the Olympics were ongoing and I'm missing major events. It was time for a

Plan B

I thought about using another streaming service. I'll integrate with it's API and just do the same thing. But with that I was risking the same outcome. Then I realized, I could be the streaming server. So that's what I did.

  1. Configured Nginx on my laptop.
  2. Added the rtmp module to Nginx.
  3. Used Peer5' recommended configuration on streaming HLS stream but I changed some settings.
  4. Changed OBS settings to stream to the Nginx server.
  5. Added VideoJs to index.html.

Outcome

At the end of the day, it works. I can watch my cables on my phone but is it stable enough? i don't think so. ๐Ÿ˜”

The stream itself was high quality but very laggy. checking the network traffic shows it's about 60mb for 30 seconds. This could be highly improved but I'm new to Nginx and this is just a fun weekend project.

Thank you for sticking all the to end. If you have any ideas to what could be my next project let me know

olympic-stream's People

Contributors

maormagori avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.