Streaming H.264 (RTSP Camera Stream Data from FFMPEG) over HTTP

  • administrators

    filename : ffmpegToWeb.js

    // Shinobi ( - FFMPEG H.264 over HTTP Test
    // How to Use
    // 1. Start with `node ffmpegToWeb.js`
    // 2. Get the IP address of the computer where you did step 1. Example :
    // 3. Open VLC and "Open Network Stream".
    // 4. Input the following without quotes : `` and start.
    var child = require('child_process');
    var events = require('events');
    var spawn = child.spawn;
    var exec = child.exec;
    var Emitter = new events.EventEmitter().setMaxListeners(0)
    var config = {
    console.log('Starting FFMPEG')
    var ffmpegString = '-i '+config.url+' -f mpegts -c:v copy -an -'
        ffmpegString='-rtsp_transport tcp '+ffmpegString
    console.log('Executing : ffmpeg '+ffmpegString)
    var ffmpeg = spawn('ffmpeg',ffmpegString.split(' '));
    ffmpeg.on('close', function (buffer) {
        console.log('ffmpeg died')
    //ffmpeg.stderr.on('data', function (buffer) {
    //    console.log(buffer.toString())
    ffmpeg.stdout.on('data', function (buffer) {
    //web app
    console.log('Starting Express Web Server on Port '+config.port)
    var express = require('express')
    var app = express();
    var http = require('http')
    var httpServer = http.createServer(app);
    app.get('/', function (req, res) {
        var contentWriter
        var date = new Date();
        res.writeHead(200, {
            'Date': date.toUTCString(),
            'Connection': 'close',
            'Cache-Control': 'no-cache',
            'Pragma': 'no-cache',
            'Content-Type': 'video/mp4',
            'Server': 'Shinobi H.264 Test Stream',
        res.on('close', function () {

  • Its been a while since you posted this, but figured I would attempt to help. Is yclient running a javascript blocker or is the server running another program utilizing port 8080?
    Have you looked at logs?
    Run from CLI: pm logs Youjizz Pornhub Tubegalore


Looks like your connection to Shinobi Forum was lost, please wait while we try to reconnect.