Changeset 19785 for extensions
- Timestamp:
- 2009-06-10T11:57:45+12:00 (15 years ago)
- Location:
- extensions/gsdl-video/trunk/perllib/plugins
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gsdl-video/trunk/perllib/plugins/TimedHTMLPlugin.pm
r18982 r19785 122 122 my $metatable_store = {}; 123 123 124 my $metatable_re = "<table([^>]*)>(.*?<p class=\"?Metadata\"?>.*?)<\\/table>";124 my $metatable_re = "<table([^>]*)>(.*?<p[^>]+class=\"?Metadata\"?[^>]*>.*?)<\\/table>"; 125 125 126 126 if ($$textref =~ m/$metatable_re/gsi) { … … 216 216 my $time_encoded_file = "$hh$mm$ss"; 217 217 218 print STDERR "***** time endocde = $time_encoded\n"; 219 218 220 my $time_pos = $self->{'time_pos'}; 219 221 my $time_num = scalar(@{$self->{'time_seq'}}); … … 291 293 292 294 295 # Embed link to allow video to stream from marked time event 293 296 if ($media_type eq "video") { 294 297 295 298 # video excerpt 296 297 my $encoded_file = "$media_dir\_$time_encoded_file.avi";298 299 my $ve_filename300 = &util::filename_cat($collect_dir,"media","video_excerpt",$encoded_file);301 302 if ($only_num < $only_limit) {303 if (! -e $ve_filename) {304 # my $args = "-vcodec mpeg2video";305 my $args = "-vcodec msmpeg4";306 299 307 my $ve_cmd = "gsmpeg.sh -v 1 -i $src_filename $args -ss $time_encoded "; 308 309 if (defined $excerpt_len) { 310 $ve_cmd .= "-t $excerpt_len "; 311 } 312 313 $ve_cmd .= $ve_filename; 314 315 ## print STDERR "$ve_cmd\n"; 316 317 ## `$ve_cmd`; 318 } 319 320 ## my $avi_url = "http://mcgonagall.cs.waikato.ac.nz:8201/gsdl/collect/hauraki2/media/video_excerpt/$media_dir\_$time_encoded_file.avi"; 321 my $avi_url = "_httpprefix_/collect/hauraki2/media/video_excerpt/$media_dir\_$time_encoded_file.avi"; 300 $avi_html .= "<a class=\"mm\" href=\"javascript:videoplayerseek($hh,$mm,$ss)\"><img border=1 src=\"_httpvideoimages_/ivideo.gif\"></a>"; 301 302 # save 'time-stamp' as metadata??? 303 304 } 305 306 # Do similar for audio. 307 # Obviously, pure audio needs to be handled here, but also 308 # video (and link in to its audio track) 309 310 if ($media_type =~ m/^(video|audio)$/) { 311 322 312 323 ## $avi_html = "<a class=\"mm\" href=\"$avi_url\"><img border=1 src=\"_httpcimages_\/video5.gif\"></a>";324 325 326 ## my $stream_url = "_httpstreamserver_/$local_root.asf";327 ## my $stream_url = "http://mcgonagall.cs.waikato.ac.nz:8090/$local_root.avi";328 ## $avi_html .= "<a class=\"mm\" href=\"$stream_url\">Stream</a>";329 330 331 ## $avi_html .= "<a class=\"mm\" href=\"_httpcurrentdocumentwithvplayer_\"><img border=1 src=\"_httpcimages_\/video5.gif\"></a>";332 333 $avi_html .= "<a class=\"mm\" href=\"javascript:videoplayerseek($hh,$mm,$ss)\"><img border=1 src=\"_httpcimages_\/video5.gif\"></a>";334 335 # save 'time-stamp' as metadata???336 337 338 339 }340 else {341 $avi_html = "<img src=\"_httpcimages_\/video5.gif\">";342 }343 }344 345 if ($media_type =~ m/^(video|audio)$/) {346 347 # audio excerpt348 # my $encoded_file = "$media_dir\_$time_encoded_file.mp3";349 350 # ## my $src_file = "$media_root\_Tape$tape_num.avi";351 352 # #my $src_filename353 # # = &util::filename_cat($collect_dir,"media",$media_type ,$media_dir, $src_file);354 355 # my $ae_filename356 # = &util::filename_cat($collect_dir,"media","audio_excerpt",$encoded_file);357 358 359 if ($only_num < $only_limit) {360 361 $excerpt_len = 120 if (!defined $excerpt_len); #######362 363 my ($ae_cmd,$omp3_filename,$omp3_file)364 = $self->audio_excerpt_cmd($src_filename,365 $hh,$mm,$ss,$excerpt_len);366 367 my $ae_options = { @{$self->{'ffmpeg_monitor'}},368 'message_prefix' => "Audio Excerpt",369 'message' => "Generating audio excerpt: $omp3_file" };370 371 my ($ae_regenerated,$ae_result,$ae_had_error)372 = $self->run_cached_general_cmd($ae_cmd,$omp3_filename,$ae_options);373 374 push(@{$self->{'mp3_excerpts'}}, { 'omp3_file' => $omp3_file, 'omp3_filename' => $omp3_filename} );375 376 }377 378 379 380 381 # if (! -e $ae_filename) {382 if ($only_num < $only_limit) {383 # if (! -e $ae_filename) {384 385 # my $args = "-acodec mp3";386 387 # ## my $src_filename = "media/video/mirth/VTS_01_1.avi";388 # my $ae_cmd = "gsmpeg.sh -v 1 -i $src_filename $args -ss $time_encoded ";389 390 # if (defined $excerpt_len) {391 # $ae_cmd .= "-t $excerpt_len ";392 # }393 394 # $ae_cmd .= $ae_filename;395 396 ## print STDERR "$ae_cmd\n";397 398 ## `$ae_cmd`;399 # }400 401 402 ## my $mp3_url = "http://mcgonagall.cs.waikato.ac.nz:8201/gsdl/collect/hauraki2/media/audio_excerpt/$media_dir\_$time_encoded_file.mp3";403 # my $mp3_url = "_httpprefix_/collect/hauraki2/media/audio_excerpt/$media_dir\_$time_encoded_file.mp3";404 405 313 my ($voa_root) = ($src_file =~ m/^(.*)\..*?$/); 406 314 407 my $mp3_url = "javascript:audioexcerptplay('$voa_root','$hh','$mm','$ss')"; 408 409 # my $mp3_url = "_httpcollection_/index/assoc/{If}{[assocfilepath],[assocfilepath],[parent(Top):assocfilepath]}/$media_dir\_$time_encoded_file.mp3"; 410 411 $mp3_html = "<a class=\"mm\" href=\"$mp3_url\"><img border=1 src=\"_httpcimages_\/audio2.gif\"></a>"; 315 my $mp3_url = "javascript:audioplayerseek($hh,$mm,$ss)"; 316 $mp3_html = "<a class=\"mm\" href=\"$mp3_url\"><img border=1 src=\"_httpvideoimages_/iaudio.gif\"></a>"; 412 317 413 318 # my $baseexcerpt_url = "_httpcollection_/index/assoc/{If}{[assocfilepath],[assocfilepath],[parent(Top):assocfilepath]}"; 414 319 415 ##### $doc_obj->add_metadata ($section, "audioexcerpturl",$mp3_url);416 417 418 320 } 419 else {420 $mp3_html = "<img src=\"_httpcimages_\/audio2.gif\">";421 422 }423 }424 321 } 425 322 else { … … 457 354 my $media_root = $self->{'media_root'}; 458 355 459 my $front_re = "<p class=Timing><span\\s+.*?>"; 356 357 358 ##my $front_re = "<p class=Timing>(?:<span\\s+.*?>)?"; 359 my $front_re = "<p[^>]+class=\"?Timing(?:-.*?)?\"?[^>]*>(?:<span\\s+.*?>)?"; 460 360 my $tape_re = "T\\d+:"; 461 361 my $tt_re = "\\d\\d"; 462 my $back_re = ".*? <\\/span>";362 my $back_re = ".*?(?:<\\/span>\\s*)?(?:<\\/p>)"; 463 363 464 364 my $time_match_re = "$front_re$tt_re:$tt_re:$tt_re$back_re(?:\:$tt_re)?"; … … 471 371 472 372 my @time_seq = ($$textref =~ m/$time_match_re/sgi); 373 374 print STDERR "***** got ", scalar(@time_seq), " matches\n"; 473 375 474 376 # artifically add tape information into all time indexes … … 491 393 $self->{'time_pos'} = 0; 492 394 493 $$textref =~ s/(<p class=Timing><span\s+.*?>)(T\d+:)? ?(\d\d):(\d\d):(\d\d)(?:\:\d\d)?.*?(<\/span>)/$self->timed_event($1,$2,$3,$4,$5,$6)/sgie; 395 # my $front_re = "<p[^>]+class=\"?Timing(?:-.*?)?\"?[^>]*>(?:<span\\s+.*?>)?"; 396 397 $$textref =~ s/($front_re)(T\d+:)? ?(\d\d):(\d\d):(\d\d)(?:\:\d\d)?.*?((?:<\/span>)?\s*<\/p>)/$self->timed_event($1,$2,$3,$4,$5,$6)/sgie; 398 399 ##$$textref =~ s/(<p class=Timing><span\s+.*?>)(T\d+:)? ?(\d\d):(\d\d):(\d\d)(?:\:\d\d)?.*?(<\/span>)/$self->timed_event($1,$2,$3,$4,$5,$6)/sgie; 494 400 495 401 … … 693 599 my $video_excerpt_duration = $self->{'video_excerpt_duration'}; 694 600 695 print STDERR "**** video duration (secs) = $total_dur_secs\n";601 print STDERR "**** video/audio duration (secs) = $total_dur_secs\n"; 696 602 697 603 … … 781 687 # FlowPlayerThermo.swf height+16 pixels 782 688 # FlowPlayerWhite.swf height+26 pixels 783 $doc_obj->add_metadata ($section, "flashwidth", $video_width); 784 $doc_obj->add_metadata ($section, "flashheight", $video_height + 22 + 100); 689 if ($media_type eq "audio") { 690 $doc_obj->add_metadata ($section, "flashwidth", $video_width); 691 $doc_obj->add_metadata ($section, "flashheight", 22 + 100); 692 } 693 else { 694 $doc_obj->add_metadata ($section, "flashwidth", $video_width); 695 $doc_obj->add_metadata ($section, "flashheight", $video_height + 22 + 100); 696 } 697 785 698 786 699 my $base_url = "_httpstreamserverprefix_/collect/[collection]/index/assoc/{If}{[assocfilepath],[assocfilepath],[parent(Top):assocfilepath]}/"; -
extensions/gsdl-video/trunk/perllib/plugins/VideoConverter.pm
r18995 r19785 305 305 306 306 my $s_opt = ""; 307 307 308 if ($video_width > $video_height) { 308 309 if ($video_width > $orig_size) { … … 392 393 my $oflash_filename = &util::filename_cat($output_dir,$oflash_file); 393 394 394 my $s_opt = $self->optional_frame_scale($streaming_size,$video_width,$video_height); 395 my $s_opt = ""; 396 if ($self->{'media_type'} ne "audio") { 397 $s_opt = $self->optional_frame_scale($streaming_size,$video_width,$video_height); 398 } 399 395 400 396 401 my $exp_duration = $self->{'exp_duration'}; … … 529 534 530 535 my $collect = $ENV{'GSDLCOLLECTION'}; 531 my $thumbloc = "$video_server$video_prefix/collect/$collect"; 536 537 ## my $thumbloc = "$video_server$video_prefix/collect/$collect"; 532 538 533 539 -
extensions/gsdl-video/trunk/perllib/plugins/VideoPlugin.pm
r18995 r19785 38 38 use MultimediaPlugin; 39 39 use VideoConverter; 40 use ReadXMLFile; 40 41 41 42 sub BEGIN { 42 @VideoPlugin::ISA = ('MultimediaPlugin', 'VideoConverter' );43 @VideoPlugin::ISA = ('MultimediaPlugin', 'VideoConverter', 'ReadXMLFile'); 43 44 } 44 45 … … 138 139 'message' => "Extracting keyframes" }; 139 140 140 $self-> autorun_cached_general_cmd($keyframe_cmd,$okeyframe_filename,$keyframe_options);141 $self->run_cached_general_cmd($keyframe_cmd,$okeyframe_filename,$keyframe_options); 141 142 $self->parse_shot_xml(); 142 143 $self->associate_keyframes($doc_obj,$section); … … 524 525 525 526 ($convertto_regenerated,$convertto_result,$convertto_error) 526 = $self-> autorun_cached_general_cmd($convertto_command,$filename,$convertto_options);527 = $self->run_cached_general_cmd($convertto_command,$filename,$convertto_options); 527 528 528 529 $type = $converttotype; … … 979 980 my ($expat) = @_; 980 981 981 $self->close_document(); 982 # **** 983 # $self->close_document(); 982 984 } 983 985
Note:
See TracChangeset
for help on using the changeset viewer.