Hi all,
I want to merge video chunks into one video file. I have used 'cat' command for joining chunks file , but while play it will play only first chunk file.
code for joining file is using 'cat command as follows :
exec("cat tmpvideo/. >> tmpvideo/". $tmpname);
And using file function is :
if ($handle = opendir('/home/ftpusers/zoopy/zoopy-stage/public/tmpvideo')) {
while (false !== ($file = readdir($handle))) {
echo $file."\n";
$fh=fopen("/home/ftpusers/zoopy/zoopy-stage/public/tmpvideo/".$file,"r");
$content=fread($fh, filesize("/home/ftpusers/zoopy/zoopy-stage/public/tmpvideo/".$file));
fclose ($fh);
$fh1=fopen("tmpvideo/".$tmpname,"a+") or die("unable to create file");
fwrite($fh1,$content);
fclose($fh1);
}
closedir($handle);
}
Using this code it join the file , but while run it gives error of corrupt file.
Plz help me to join chunks file of video into one file.