Code Monkey home page Code Monkey logo

webrtc-capture-proof-of-concept's Introduction

WebRTC Capture Proof of Concept

This is a simple proof of concept of how a H264 stream can be captured by webrtc-rs and converted into a bitmap if the first packet contains a h264 frame (or something like that).

It does not work reliably because sometimes the first packet does not always contain the information needed but it should be enough to get started on a working solution.

The docs bellow are copy and pasted from the webrtc-rs example this is based on:

save-to-disk-h264

save-to-disk-h264 is a simple application that shows how to record your webcam/microphone using WebRTC.rs and save H264 and Opus to disk.

Instructions

Build save-to-disk-h264

cargo build --example save-to-disk-h264

Open save-to-disk example page

jsfiddle.net you should see your Webcam, two text-areas and a 'Start Session' button

Run save-to-disk-h264, with your browsers SessionDescription as stdin

In the jsfiddle the top textarea is your browser, copy that and:

Linux/macOS

Run echo $BROWSER_SDP | ./target/debug/examples/save-to-disk-h264

Windows

  1. Paste the SessionDescription into a file.
  2. Run ./target/debug/examples/save-to-disk-h264 < my_file

Input save-to-disk-h264's SessionDescription into your browser

Copy the text that save-to-disk-h264 just emitted and copy into second text area

Hit 'Start Session' in jsfiddle, wait, close jsfiddle, enjoy your video!

In the folder you ran save-to-disk-h264 you should now have a file output.h264 play with your video player of choice!

Congrats, you have used WebRTC.rs!

webrtc-capture-proof-of-concept's People

Contributors

d1plo1d 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.