resolume deck file description
Posted: Tue Sep 23, 2008 17:24
				
				i'm thinking about writing a little tool to export my resolume decks as directory structures with video files. is there any info on the .dck file format?
			Code: Select all
php resolume_deck_backup.php whatever.dck /path/to/target/dirCode: Select all
/path/tp/target/dir/whateverCode: Select all
<?php
	$deck= $_SERVER["argv"][1];
	$output_dir= $_SERVER["argv"][2];
	
	$pathinfo= pathinfo($deck);
	$output_dir= realpath($output_dir)."/".$pathinfo["filename"];
	echo "\n\nreading deck file: ".$deck;
	echo "\ncopy clips to: ".$output_dir;
	
	if(is_file($deck)){
		$content= file_get_contents($deck);
		
		$pattern= "/FileName..(.+)\x05/";
		$matches= array();
		preg_match_all($pattern, $content, $matches);
		
		$clips= $matches[1];
		echo "\nclips found: ".count($clips);
		
		if(count($clips>0)){
			if(!is_dir($output_dir)){
				echo "\ncreating dir: ".$output_dir;
				mkdir($output_dir);	
			}
			foreach($clips as $clip){
				if(is_file($clip)){
					$target_clip= $output_dir."/".basename($clip);
					echo "\ncopying: ".$clip." -> ".$target_clip." ...";
					copy($clip, $target_clip);
				} else {
					echo "\nerror: clip not found ".$clip;
				}
			}
			
		}
	} else {
		echo "\n\nerror: deck file not found";
	}
	
	echo "\n\n";
?>