Coder Social home page Coder Social logo

rtwatch's Introduction

Watch videos with friends using WebRTC, let your backend do the pausing and seeking.

Pion webrtc Slack Widget
Go Report Card License: MIT


Using Pion WebRTC and GStreamer you can now watch videos in real-time with your friends. Watch your favorite movie perfectly synchronized with multiple viewers. If someone pauses it pauses for everyone, and no one can and no one fast forward only their video.

rtwatch is different then any other solution because all state is stored on the backend. Only the current audio/video frame is being sent to the viewers, there is no way they can download/cache the videos either for future usage.

Instructions

Install GStreamer

Debian/Ubuntu

sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly

Windows MinGW64/MSYS2

pacman -S mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-libav mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gst-plugins-bad mingw-w64-x86_64-gst-plugins-ugly

Error Handling

pkg-config --cflags -- gstreamer-1.0 gstreamer-app-1.0 pkg-config: exec: "pkg-config": executable file not found in %PATH%

After gstreamer installation,SET the PATH variable to C:/{path to gstreamer}/bin

Sorry, unimplemented: 64 bit mode not compiled in

RUN $ g++ -v

CHECK Target- x86_64-w64-mingw32(Required).

if not Download using this

macOS

brew install gst-plugins-good pkg-config gst-plugins-bad gst-plugins-ugly
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"

Download rtwatch

go get github.com/pion/rtwatch

Play your video

rtwatch -container-path=/home/sean/video.mp4
> Video file '/home/sean/video.mp4' is now available on ':8080', have fun!

Watch your video with friends!

Open http://localhost:8080 and hit play. Open it in multiple tabs so you can see how it syncs between multiple viewers.

You also have the option to Seek/Play/Pause! Press those buttons and watch the video state change for every viewer at the same time.

rtwatch's People

Contributors

gedw99 avatar hugoarregui avatar renovate-bot avatar renovate[bot] avatar sean-der avatar vashish1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rtwatch's Issues

Problem with playing video / websocket connection

I tried rtwatch locally with my notebook (port 8080, no tls) and it fails with the following error during ws connection is pending.

Request URL: ws://192.168.178.26:8080/ws
Request Method: GET
Status Code: 101 Switching Protocols

Server: Manjaro Linux
Client: Win10, Chrome

Issue in playing video

I've set up the project for dev purposes on my local machine.

image
I see only the loader and not the video stream.
Command: go run main.go -container-path=/home/rtwatch/video4.mp4

Commandline output:
Video file '/home/rtwatch/video4.mp4' is now available on ':8080', have fun!

I get 101 Switching Protocols for the WebSocket connection status code and the state is Pending.

Machine details: Ubuntu 18.04
Browser: Chrome

Am I missing anything in the setup?

Build docker images

Hi,

I tried to build a docker image / dockerfile. Build and start works fine.

FROM    golang:alpine

RUN     apk --update --no-cache add \
        gst-plugins-base-dev \
        gstreamer-dev \
        build-base \
        git

#RUN    go get github.com/pion/rtwatch

WORKDIR /rtwatch

ARG     REPO=https://github.com/pion/rtwatch.git
ARG     BRANCH=master

RUN     echo -e "GIT Repo: $REPO\nGIT Branch: $BRANCH"

RUN     git clone https://github.com/pion/rtwatch.git --progress --verbose --branch $BRANCH /rtwatch

RUN     sed -i 's#ws://#wss://#g' main.go

RUN     go install


FROM    alpine:latest

RUN     apk --update --no-cache add \
        gst-plugins-good \ 
        gst-plugins-ugly \
        gst-plugins-bad \
        gstreamer 

COPY    --from=0 /go/bin/rtwatch /usr/local/bin/rtwatch

ENTRYpoint      [ "/usr/local/bin/rtwatch" ]
CMD             [ "-container-path", "/data/video.mp4" ]
  • Video file need to be mapped as volume.
  • For tests ws:// was replaced by wss://

how to support uvc?

i have a usb camera which could be supprted by uvc driver very well
and for mplayer i could use mplayer tv:// to got the video streaming

but
rtwatch -container-path=tv:// failed

Talk to each other during watch the same video from file

Hi,
because of the corona pandemic we use jitsi to keep in touch with our soccer kids, but we would like to share and discuss some videos. With jitsi video sharing doesn't work well, so maybe rtwatch could helpt to stream a synchronized video?

I haven't understand the GStreamer part of installation.

As streaming source I could use a windows or linux laptop or a (small) linux vm. Video also could be streamed by a public url temporarily. Sohow to use rtwatch to share our video files (mp4, mov)?

And during watch shared video it would be great to talk to each other. Is there a way to combine rtwatch with a audio call (webrtc based?).

Regards

Go get fails with EOF

I run
go get -v github.com/pion/rtwatch
it prints
go get: module github.com/pion/rtwatch: Get "https://proxy.golang.org/github.com/pion/rtwatch/@v/list": EOF

It was working lately

Go build branch renovate/github.com-pion-webrtc-v3-3.x fails

Because of problem #38 I tried to build branch renovate/github.com-pion-webrtc-v3-3.x, but still fails:

go: downloading github.com/gorilla/websocket v1.4.2
go: downloading github.com/pion/webrtc/v3 v3.0.16
go: downloading github.com/pion/datachannel v1.4.21
go: downloading github.com/pion/dtls/v2 v2.0.8
go: downloading github.com/pion/ice/v2 v2.0.16
go: downloading github.com/pion/interceptor v0.0.11
go: downloading github.com/pion/logging v0.2.2
go: downloading github.com/pion/randutil v0.1.0
go: downloading github.com/pion/rtcp v1.2.6
go: downloading github.com/pion/rtp v1.6.2
go: downloading github.com/pion/sctp v1.7.11
go: downloading github.com/pion/sdp/v3 v3.0.4
go: downloading github.com/pion/srtp/v2 v2.0.2
go: downloading github.com/pion/transport v0.12.3
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/pion/udp v0.1.0
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading github.com/pion/mdns v0.0.5
go: downloading github.com/pion/stun v0.3.5
go: downloading github.com/pion/turn/v2 v2.0.5
/go/pkg/mod/github.com/pion/ice/[email protected]/mdns.go:6:2: missing go.sum entry for module providing package github.com/google/uuid (imported by github.com/pion/ice/v2); to add:
        go get github.com/pion/ice/[email protected]
/go/pkg/mod/github.com/pion/dtls/[email protected]/pkg/protocol/extension/server_name.go:6:2: missing go.sum entry for module providing package golang.org/x/crypto/cryptobyte (imported by github.com/pion/dtls/v2/pkg/protocol/extension); to add:
        go get github.com/pion/dtls/v2/pkg/protocol/[email protected]
/go/pkg/mod/github.com/pion/dtls/[email protected]/pkg/crypto/elliptic/elliptic.go:9:2: missing go.sum entry for module providing package golang.org/x/crypto/curve25519 (imported by github.com/pion/dtls/v2/pkg/crypto/elliptic); to add:
        go get github.com/pion/dtls/v2/pkg/crypto/[email protected]
/go/pkg/mod/github.com/pion/[email protected]/conn.go:12:2: missing go.sum entry for module providing package golang.org/x/net/dns/dnsmessage (imported by github.com/pion/mdns); to add:
        go get github.com/pion/[email protected]
/go/pkg/mod/github.com/pion/[email protected]/conn.go:13:2: missing go.sum entry for module providing package golang.org/x/net/ipv4 (imported by github.com/pion/ice/v2); to add:
        go get github.com/pion/ice/[email protected]
/go/pkg/mod/github.com/pion/ice/[email protected]/agent.go:18:2: missing go.sum entry for module providing package golang.org/x/net/proxy (imported by github.com/pion/webrtc/v3); to add:
        go get github.com/pion/webrtc/[email protected]

Video is laggy even few or without framesDropped

Hi,

I observed the video (1080P) is very laggy, however from webrtc-internals, there is not framesDropped.
Is there any restrictions related to the video or what could be the cause. Please advise, thank you.

MAC: "Your GStreamer installation is missing a plug-in."

brew install gst-plugins-good pkg-config

export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
go run main.go -container-path=/Users/apple/workspace/go/src/github.com/winwisely99/plugins/video/WebRTC/watch/video.mp4
go: finding github.com/pion/rtwatch latest
Video file '/Users/apple/workspace/go/src/github.com/winwisely99/plugins/video/WebRTC/watch/video.mp4' is now available on ':8080', have fun!
GStreamer Error: Your GStreamer installation is missing a plug-in.
exit status 1
make: *** [go-run] Error 1

main.go is the same as this repo

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.