Coder Social home page Coder Social logo

solderzzc / hlsconvertor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from swarmnyc/hlsconvertor

0.0 1.0 0.0 780 KB

A Kurento Convertor plugin to transcode WebRTC stream to HLS(TS) stream

CMake 14.83% Makefile 0.68% C 8.38% C++ 45.25% JavaScript 30.86%

hlsconvertor's Introduction

***********************************************
* Install Vagrant and load Ubuntu virutal OS
***********************************************
See:
https://www.vagrantup.com/downloads.html
https://atlas.hashicorp.com/ubuntu/boxes/trusty64

# virtual port to Ubuntu, using virtual box.
vagrant init ubuntu/trusty64; vagrant up --provider virtualbox
# make sure the virtual machine's memory is above 1GB
# make sure the virtual machine using bridge mode by commenting out the line in ~/Vagrantfile:
#   config.vm.network "public_network"
vagrant ssh

# Install kurento-media-server on the Ubuntu virtual OS: (user:vagrant paw:vagrant)
echo "deb http://ubuntu.kurento.org trusty-dev kms6" | sudo tee /etc/apt/sources.list.d/kurento-dev.list
wget -O - http://ubuntu.kurento.org/kurento.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install kurento-media-server-6.0

sudo service kurento-media-server-6.0 start



**********************************
* building kurento media server
**********************************
See: https://www.kurento.org/docs/6.0.0/mastering/develop_kurento_modules.html
On Ubuntu virtual box:
sudo apt-get update
sudo apt-get install git
git config --global user.name "rentao"
git config --global user.email "[email protected]"

sudo apt-get install kurento-media-server-6.0-dev
kurento-module-scaffold.sh HLSConvertor ./HLSConvertor/


cd HLSConvertor/h-l-s-convertor/src
cmake ..
make

cmake .. -DGENERATE_JS_CLIENT_PROJECT=TRUE
(to generate the js code used by npm[node.js])

vi /etc/default/kurento-media-server-6.0
  (Add below 2 lines)
  export KURENTO_MODULES_PATH=/home/vagrant/swarmnyc/HLSConvertor/h-l-s-convertor/src/src
  export GST_PLUGIN_PATH=/home/vagrant/swarmnyc/HLSConvertor/h-l-s-convertor/src/src
sudo service kurento-media-server-6.0 restart



*****************************************
* test kurento media server by node.js
*****************************************
Download the tutorial project of kurento from:
  https://github.com/Kurento/kurento-tutorial-node

Suppose we are using the kurento-hello-world to test:
cd kurento-tutorial-node/kurento-hello-world/
cd node_modules/kurento-client/
vi lib/index.js
  (Add one line)
  register('kurento-module-hlsconvertor')
# copy the generated js code to current project.
cp -r /home/vagrant/swarmnyc/HLSConvertor/h-l-s-convertor/src/js/ ./node-modules/kurento-module-hlsconvertor/
vi package.json
  (Add one line in the "dependencies" block)
  "kurento-module-hlsconvertor": "0.0.1-dev",
# run the backend server.
cd ../..
vi server.js
  (Change the line, the actual ip address of the running kurento media server)
        ws_uri: 'ws://192.168.17.197:8888/kurento'

  (Add below code where webRtcEndpoint is created)
                pipeline.create('HLSConvertor', function(error, hlsconvertor) {
                    console.log("-------------------------creating HLSConvertor-------------------------\n"+webRtcEndpoint);
                    webRtcEndpoint.connect(hlsconvertor);
                    console.log("-------------------------creating HLSConvertor finished!-------------------------");
                });
node server.js



******************************************
* Install nvm and nodejs if necessary
******************************************
Install nvm to upgrade nodejs from: https://github.com/creationix/nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.26.1/install.sh | bash
. ~/.nvm/nvm.sh
nvm install 0.12.7

hlsconvertor's People

Contributors

touren avatar

Watchers

James Cloos 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.