예제 #1
0
파일: tests.php 프로젝트: rchicoria/epp-drs
        function testFFMpeg() 
        {
			$VideoUtil = new VideoUtil();
			$load = $VideoUtil->LoadFile(dirname(__FILE__)."/testvideo/2.mpeg");
	
			$this->assertTrue($load, "Movie file loaded");
			
			$length = $VideoUtil->GetLength();
			
			$this->assertTrue($length > 0, "Length detected");
			
			$VideoUtil->SetDimensions(100, 120);
			
			$path = ini_get("session.save_path") ? ini_get("session.save_path") : "/tmp";
			
			$path .="/video_thumbs";
			
			$VideoUtil->SetOutputPath($path);
			
			$VideoUtil->Cut(3);
			
			$check = file_exists("{$path}/0.jpg");
			$check &= file_exists("{$path}/1.jpg");
			$check &= file_exists("{$path}/2.jpg");
			
			$this->assertTrue($check, "Thumbnails created");
			
			@unlink("{$path}/0.jpg");
			@unlink("{$path}/1.jpg");
			@unlink("{$path}/2.jpg");
        }