Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] thumbnail filmu
bastek8989
post 17.12.2006, 13:32:15
Post #1





Grupa: Zarejestrowani
Postów: 205
Pomógł: 1
Dołączył: 11.09.2006

Ostrzeżenie: (0%)
-----


Witam

Oosiadam taki skrypt

  1. <?php
  2. /*
  3.  * This test script is not part of the automatic regression tests. It serves
  4.  * as a simple manual test script and an example of the syntax for calling
  5.  * the ffmpeg-php functions
  6.  * 
  7.  * To run it from the command line type 'php -q ffmpeg_test.php 'or from a 
  8.  * browser * copy this file into your web root and point your browser at it.
  9.  */
  10.  
  11. $extension = "ffmpeg";
  12. $extension_soname = $extension . "." . PHP_SHLIB_SUFFIX;
  13. $extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname;
  14.  
  15. // load extension
  16. if (!extension_loaded($extension)) {
  17. dl($extension_soname) or die("Can't load extension $extension_fullnamen");
  18. }
  19.  
  20. if (php_sapi_name() != 'cgi') {
  21. echo '<pre>';
  22. }
  23.  
  24. printf("ffmpeg-php version string: %sn", FFMPEG_PHP_VERSION_STRING);
  25. printf("libavcodec build number: %dn", LIBAVCODEC_BUILD_NUMBER);
  26. printf("libavcodec version number: %dn", LIBAVCODEC_VERSION_NUMBER);
  27. printf("libavcodec build number: %dn", LIBAVCODEC_BUILD_NUMBER);
  28.  
  29.  
  30. $name = 'test';
  31. $fpatch = '/home/bastek/public_html/test_media/test.avi';
  32. $movie = '/home/bastek/public_html/test_media/test.avi';
  33. $mov = new ffmpeg_movie($movie);
  34.  
  35. function video_to_frame($fpath,$name,$mov,$chnl)
  36. {
  37. $frcount=$mov->getFrameCount()-1;
  38. $try = 1;
  39. $fc = 1;
  40.  
  41. while(1)
  42. {
  43. $p = rand(1,$frcount);
  44. $ff_frame= $mov->getFrame($p);
  45. if($ff_frame==true)
  46. {
  47. $gd_image = $ff_frame->toGDImage();
  48. $ff='thumbs'."/".$name.".jpg";
  49. imagejpeg($gd_image, $ff);
  50. $fd='thumbs'."/".$fc."_".$name.".jpg";
  51. createThumb($ff,$fd,'55','55');
  52. $fc++;
  53. }
  54. $try++;
  55. if($try>10 || $fc==4)
  56. break;
  57. }
  58. }
  59. video_to_frame($fpath,$name,$mov,$chnl);
  60. ?>


Wszystko dziala ajnie tylke ze gdy wstawie link odnoszacy sie do pliku z zew serwera (google, youtube) to skrypcik odmawia polsuszenstwa piszec ze niemoze otworzyc pliku..

I tu pytanie: czy da sie przerobic ten sktypt tak by robil thumby filmow flash z serwisow typu google?


--------------------
Web-Anatomy.com - tworzenie serwisów internetowych oraz stron www z okolic Bielska-Białej. Zapraszam.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 09:57