Index: trunk/extensions/MetavidWiki/maintenance/ogg_thumb_insert.php |
— | — | @@ -19,24 +19,28 @@ |
20 | 20 | require_once('maintenance_util.inc.php'); |
21 | 21 | |
22 | 22 | if (count($args) == 0 || isset ($options['help'])) { |
23 | | - print<<<EOT |
| 23 | + print' |
24 | 24 | USAGE |
| 25 | + php ogg_thumb_insert.php stream_name filename interval duration |
25 | 26 | |
26 | | - php ogg_thumb_insert.php stream_id filename interval duration |
27 | | - |
28 | 27 | EXAMPLE |
29 | | - ogg_thumb_insert.php 17 /var/www/localhost/htdocs/media/stream.ogg 20 |
| 28 | + ogg_thumb_insert.php stream_name /var/www/localhost/htdocs/media/stream.ogg 20 |
30 | 29 | |
31 | 30 | Notes: |
32 | 31 | if possible you want to use the source footage rather than the ogg to generate the thumbnails (ie the mpeg2 or dv) |
33 | | -EOT; |
34 | | - exit (); |
| 32 | + |
| 33 | +'; |
| 34 | +exit(); |
35 | 35 | } |
36 | | -$streamid=$args[0]; |
| 36 | +$stream_name=$args[0]; |
37 | 37 | $filename=$args[1]; |
38 | 38 | $interval=$args[2]; |
39 | 39 | $duration=$args[3]; |
40 | | -$filedir='../stream_images/'.substr($stream_id, -1).'/'.$streamid; |
| 40 | + |
| 41 | +$MV_Stream = MV_Stream::newStreamByName($stream_name); |
| 42 | +$stream_id =$MV_Stream->getStreamId(); |
| 43 | + |
| 44 | +$filedir='../stream_images/'.substr($stream_id, -1).'/'.$stream_id; |
41 | 45 | $dbw =$dbr = wfGetDB(DB_MASTER); |
42 | 46 | for($i=0;$i<$duration;$i+=$interval){ |
43 | 47 | $dbw->query("INSERT INTO `mv_stream_images` (`stream_id`, `time`) VALUES ($stream_id, $i)"); |