You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
988 B
35 lines
988 B
<?php
|
|
function output_dummy( $DST ){
|
|
$FD = fopen( $DST, "r" );
|
|
if( $FD ){
|
|
header( 'Content-Type: video/mp4;' );
|
|
while(!feof( $FD ) ){
|
|
echo fread( $FD, 2048 );
|
|
};
|
|
fclose( $FD );
|
|
};
|
|
};
|
|
if( isset( $_POST['FLOC'] ) ){
|
|
//'/lib/controller/' = 16 chars
|
|
$SRC = substr( $_POST['FLOC'], 16 );
|
|
$FPS = intval( $_POST['FFPS'] );
|
|
|
|
|
|
if( file_exists( $SRC ) ){
|
|
$DST = '../tmp/' . md5_file( $SRC ) . '.mp4';
|
|
//echo $SRC . "->" . $DST . "\n\n"; exit();
|
|
$COM = "ffmpeg -hide_banner -loglevel error -y -r {$FPS} -i {$SRC} -pix_fmt yuvj420p -b:v 4000k -c:v libx264 {$DST} 2>&1";
|
|
$JUJA = `$COM`;
|
|
if( file_exists( $DST ) ){
|
|
output_dummy( $DST );
|
|
unlink( $DST );
|
|
} else output_dummy( '../../style/assets/nosignal.mp4' );
|
|
} else output_dummy( '../../style/assets/nosignal.mp4' );
|
|
} else output_dummy( '../../style/assets/nosignal.mp4' );
|
|
|
|
//-crf 20 -r 9 -b:v 3500 -filter:v "setpts=2.0 * PTS" ^M
|
|
|
|
|
|
|
|
|
|
?>
|