Jump to content
php.lv forumi

ffmpeg scripta problema


EN`

Recommended Posts

$name=$_POST['name'];

$desc=nl2br($_POST['description']);

$file=$_FILES['file'];

$path="./movies/";

 

$numbers = time() + "_" + rand(1000,9999);

$saveflvpath = "./movies/";

$converted = "./movies/converted/".$numbers.".flv";

$ffmpeg = "C:/xampp/htdocs/ffmpeg/ffmpeg";

$command = $ffmpeg." -v 0 -y -i $saveflvpath$file -s 580x382 -f flv -r 30 -ar 44100 $converted";

$output= exec($command." 2>&1");

print "$output";

 

 

Izmet aaraa: Usually that means that input file is truncated and/or corrupted.

Nevaru iisti atrast probleemu. Iespeejams pie vainas ir, ka experementeeju uz windows'a.

Meybe kaads ir ar kko taadu saskaaries, un vareetu pateikt kur mekleejams risinaajums.

Link to comment
Share on other sites

pamegini konverted uz ogg formatu

Link to comment
Share on other sites

sataisi echo $command peece taas

parveido no

$command = $ffmpeg." -v 0 -y -i $saveflvpath$file -s 580x382 -f flv -r 30 -ar 44100 $converted";

uz

$command = $ffmpeg." -v 0 -y -i ".$saveflvpath.$file." -s 580x382 -f flv -r 30 -ar 44100 ".$converted;

Edited by p4F
Link to comment
Share on other sites

Itkaa saanaaca. Pats biju mazliet kljudijies. Tagad man izskataas taa:

 

$name=$_POST['name'];

$desc=nl2br($_POST['description']);

$file=$_FILES['file'];

$path="./movies/";

$upload=move_uploaded_file($file['tmp_name'], $path.$file['name']);

chmod($path.$file['name'], 0755);

$numbers = time() + "_" + rand(1000,9999);

$saveflvpath = "C:/xampp/htdocs/movies/";

$converted = "C:/xampp/htdocs/movies/converted/".$numbers.".flv";

$ffmpeg = "C:/xampp/htdocs/ffmpeg/ffmpeg";

//$command = $ffmpeg." -i $saveflvpath$file -f ogg -acodec mp3 -ab 256k -ac 1 -b 5000 -r 30 -s 580x382 -ar 44100 $converted";

//$command = $ffmpeg." -i $upload -f ogg -acodec mp3 -ab 256k -ac 1 -b 5000 -r 30 -s 580x382 -ar 44100 $converted";

$command = $ffmpeg." -v 0 -y -i ".$path.$file['name']." -s 580x382 -f flv -r 30 -ar 44100 ".$converted;

$output= exec($command." 2>&1");

print "$output";

Link to comment
Share on other sites

×
×
  • Create New...