~codepaste
22 itemsDownload ./*


..
$.new.$
.AewnSE
.AswwGt
.EgDdGG
.GvWBvn
.HazjyQ
.MoeBwF
.OyUmVX
.SlBcrh
.VrFMQF
.aLmRfH
.bddjpX
.dApIeD
.fglWWW
.jnOsVi
.kcXFLt
.lkqoxo
.nRPJWO
.pGCvTq
.puKBTb
.tcIUFk
.yuxVby


codepaste.kcXFLt
7 months agoDownloadRawClose


<?php

    // Usage:
    // Start steam, open script/page standalone on server.
    // $ cvlc v4l2:///dev/video1 :v4l2-standard= :v4l2-width=640 :v4l2-height=480 :input-slave=alsa://hw:0,0 :live-caching=300 :sout="#transcode{vcodec=VP80,acodec=vorb,vb=600,fps=20,channels=1,ab=64,sampelrate=44100,scale=1}:http{dst=:8080/stream.webm}"

    function flush_buffers(){
        ob_end_flush();
        ob_flush();
        flush();
        ob_start();
    }
     
    $stream="http://my.livestream.url:8080/stream.webm";
    $file="./stream.webm";

    $stream_headers=@get_headers($stream);
    if (!$stream_headers || $stream_headers[0]=='HTTP/1.1 404 Not Found') {
        exit(1);
    } else {
        $fh=fopen($file,'w');
        $sh=fopen($stream,'r');

        echo "Capturing Stream to File...";

        while(!feof($sh)) {
            $data=fread($sh,1024 * 5);

            ftruncate($fh,0);
            rewind($fh);
            fwrite($fh,$data);

            flush_buffers();
        }

        fclose($sh);
        fclose($fh);
    }

    echo "Stream ended.";
 
    exit(0);

?>

Top
twily at openmailbox dot org
©twily.info 2013 - 2017



744 081 visits
... ^ v