Archive for the ‘Mistika’ Category

Mistika .rnd lookup

Thursday, August 5th, 2010

I just found a way to look up the .rnd file for a selected clip in the timeline. The script will copy the stack for a file to your Mistika clipboard. Download link below the video.

Download rnd_Lookup_100805

This script depends on the EMP package. Get the latest release from here. Put this script in the Tools folder to have it accessible from the EMP launcher.

linkSearch.py – New EMP script

Sunday, June 13th, 2010

This script lets you search for links pointing to a specific location. It will search EXT_MEDIA, your audio dir and your movies dir. By default, it searches in all projects, but you can also choose to search current project only.

My initial purpose for this was to check if any projects depended on a folder I was cleaning up.

Download linkSearch_100613

This script depends on the EMP package. Get the latest release from here.

EMP traceLinks patch

Sunday, June 6th, 2010

Todays patch fixes some bugs when handling stills and movie clips with traceLinks.py. This also required a few extra lines in the mistika.py module, so you’ll have to update that as well.

Just extract the archive to your emp directory and overwrite the existing files.

Download patch 100606

EMP release 0.2

Tuesday, May 18th, 2010

As some of you may now, I’ve written quite a few scripts over the last couple of years for making my life with Mistika easier. The tools range from Final Cut to Mistika xml conform, media files consolidating and an audio normalize calculator, to afterscripts for making various compressed movie formats easily. I recently began the process of cleaning those up a putting them into a single package – EMP, or Effcient Mistika Project.

Version 0.2 is now ready, and all you have to do is extract the emp_0-2.tgz to a permanent location and run empSetup.py in the Tools directory. You may have to do that from a terminal (but only as your Mistika user), and as always with these kind of things, I advice you to backup your MISTIKA-ENV folder first. Some scripts have destination variables that needs to be set (see below), and some settings can be set in ~/.emp/emp.py

An EMP-button will be created in your App-panel (or Extras in 5.0) and all afterscripts will be listed in the render panel.

Download EMP 0.2

Here comes a short description of the various files included:

Afterscripts

emp_Move.py

Move’s the rendered MOVIE file to a location specified in the outDir variable

emp_MPEG1_underscanned.py

Makes a 640×360 MPEG1 file using the whole image frame.
Use separate audio when rendering.
Set the outDir variable to specify output directory

emp_QT-MPEG4.py

Makes a quicktime MPEG4 in the current resolution.
Use separate audio when rendering.
Set the outDir variable to specify output directory

emp_QT-MPEG4_640x360.py

Makes a 640×360 QT MPEG4 file.
Use separate audio when rendering.
Set the outDir variable to specify output directory

emp_iPhone.py

Makes a iPhone compatible video file.
Use separate audio when rendering.
Set the outDir variable to specify output directory

Tools

convertForMistika.py

Converts audio or video input and converts it to a Mistika-friendly format.
This can also be used as a droplet. Put a shortcut on your desktop, and you’ll be able to drag media files directly onto it to convert.

empSetup.py

This sets up all files and settings for the emp install

jsClean.py

This will check all .js files for the project against .env files in the projects DATA folder (subfolders are not checked) and move every file not in use to a trash folder. The default path is a folder called trash in your JS folder, but this can be changed in ~/.emp/emp.py

traceLinks.py

Will trace the links for a selected clip in a Mistika timeline step by step. Just test it. Nothing scary about this one.

inOtherProjects.py

Well look for references to this project in all other projects, so you can know if it’s safe to delete this project without screwing up another one.

normalize.py

Will report the peak audio level of a selected clip.

xmlconf.py

This is a very basic Final Cut .xml -> Mistika .env utility. Nowhere near stable, but definitely a time saver.
Just select an xml file and then a source folder. You can add a media source folder each time you click OK, and when all are added, click Cancel to start the actual conform.

Read groups in a Mistika timeline with PHP

Thursday, April 1st, 2010

Here’s some code to read top-level groups from a Mistika timeline (.env-file). If all films are stored in separate groups with names, this snippet will list all films and their length (in both 25 and 24 frames TC).

Will produce something like this:

  • Test.env
    • Film one 00:00:20:0025 00:00:20:2024
    • Film two 00:00:20:0025 00:00:20:2024
function framesToTC($frames, $framerate) {
	
	
	$hours = floor( $frames / ( $framerate * 60 * 60 ) );
	$framesleft = $frames - ($hours * $framerate * 60 * 60);
	
	$minutes = floor( $framesleft / ( $framerate * 60 ) );
	$framesleft -= ( $minutes * $framerate * 60 );
	
	$seconds = floor( $framesleft / ( $framerate ) );
	$framesleft -= ( $seconds * $framerate );
	
	$tc = sprintf("%02d:%02d:%02d:%02d", $hours, $minutes, $seconds, $framesleft );
	
	return $tc;
}

function groupsInEnv( $envAbsPath ) {
	$groups = array();
	$balance = 0;
	$envH = fopen($envAbsPath, 'r');
	while (!feof($envH)) {
		$line = fgets($envH);
		if ( strpos($line, "Group(") === 0 && $balance === 1 ) {
			$waitForName = 1;
		}
		elseif ( strpos(ltrim($line), "n(") === 0 && $waitForName == 1 ) {
			$groupName = substr(trim($line), 2, -1);
			$waitForName = 0;
			$waitForLength = 1;
		}
		elseif ( $waitForLength == 1 ) {
//                                $groups[$groupName] = substr(trim($line), strpos($line, "W("), strpos($line, ")", strpos($line, "W(")) - 1);
			$expLine = explode(" ", $line);
			$groups[$groupName] = substr($expLine[2], 2, -1);
			$waitForLength = 0;
		}
		$balance += substr_count($line, "(");
		$balance -= substr_count($line, ")");
	}
	fclose($envH);
	if ( count($groups) === 0 ) {
		$groups["Timeline has no groups"] = "N/A";
	}
	return $groups;
}
$project = $_GET['mistika'];
$dataDir = "/PROJECTS/$project/DATA";
$timelines = scandir( $dataDir );
$out = "<ul>";
foreach( $timelines as $timeline){
	if ( substr($timeline, -4) == ".env" ) {
		$out .= "<li>$timeline<ul>\n";
		$films = groupsInEnv("$dataDir/$timeline");
		foreach( $films as $film => $filmFrames ) {
				$out .= "<li><b>$film</b>     ".framesToTC($filmFrames, 25).'<sup>25</sup>     '.framesToTC($filmFrames, 24).'<sup>24</sup></li>';
		}
		$out .= '</ul></li>'."\n";
	}
}