~codepaste
25 itemsDownload ./*

25 itemsDownload ./*

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


codepaste.kcXFLt
1 727•  7 years ago•  DownloadRawClose
7 years ago•  1 727

{}
<?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.info 2013 - 2024
twily at twily dot info



2 131 227 visits
... ^ v