Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:video:archiving_mini_dv [2011/02/02 21:23] billhdocs:video:archiving_mini_dv [2011/02/02 21:35] (current) billh
Line 3: Line 3:
  
   - rip footage to [[#iMovie]]   - rip footage to [[#iMovie]]
-  - re-encode .dv files with [[#MPEG Streamclip]] or [[#ffmpeg]] +  - re-encode .dv files with [[#MPEG Streamclip]] 
 +  - [[#rename files]] according to my archive scheme 
 +  - I then use MediaTomb to automatically read certain directories and make these videos available for my PS3 to stream
  
 ===== iMovie ===== ===== iMovie =====
Line 38: Line 40:
     - click Make MP4     - click Make MP4
  
-===== ffmpeg ===== +====== rename files ====== 
-FIXME+All of my dv tapes are numbered, such as 001, 013, 021, etc...  I put the encoded files into a folder of the same name.  I then wrote a php script that would take the iMovie named files such as Clip 01.dv (which after encoding is probably Clip 01.mp4), and name them as 001_01.mp4. 
 + 
 +**rename_home_movies.php** 
 +<code php> 
 +<?php 
 + 
 +/* usage: php rename_home_movies.php <dirname> 
 + * 
 + * all files in <dirname> will be renamed if they begin with "Clip " to  
 + * "dirname_" + file suffix 
 + */ 
 + 
 +if( !isset($argc) || $argc < 2 ) 
 + exit(basename(__FILE__) . " <dir>\n"); 
 + 
 +if( !is_dir($argv[1]) || !is_readable($argv[1]) ) 
 + exit("$argv[1] is not a readable directory\n"); 
 + 
 +$dirpath = $argv[1]; 
 + 
 +chdir($dirpath); 
 +$dh = opendir($dirpath); 
 +$dirname = str_replace(realpath("../") . "/", "", realpath(".")); 
 + 
 +$noFilesRenamed = true; 
 + 
 +while( $file = readdir($dh) ){ 
 + if( preg_match("/^Clip (.*)$/", $file, $matches) == 0 ) 
 + continue; 
 + 
 + $newName = "{$dirname}_{$matches[1]}"; 
 + 
 + $result = rename($file, $newName); 
 + // $result = true; // use this line to test 
 + 
 + if( !$result ){ 
 + echo "FAILED to rename $file\n"; 
 + }else{ 
 + echo "renamed $file to $newName\n"; 
 + $noFilesRenamed = false; 
 +
 + 
 +
 + 
 +closedir($dh); 
 + 
 +if( $noFilesRenamed ) 
 + echo "no files were found to rename\n"; 
 + 
 +</code> 
 + 
 +===== See Also ===== 
 +  * [[ffmpeg]] 
 +  * [[Quicktime]] 
  • docs/video/archiving_mini_dv.1296707029.txt.gz
  • Last modified: 2011/02/02 21:23
  • by billh