Windows Localhost'ta Videoları Flv Ye Çevirmek ve Ekran Görüntüsü Almak - Google Fan Webmaster Forum
Google Fan Webmaster Forum  

Geri Dön   Google Fan Webmaster Forum > R10 Webmaster Kütüphanesi > R10 Bilgi Arşivi

R10 Bilgi Arşivi Önemli Bilgilerin ve Paylaşımın Yapıldığı arşivlik konular bölümü. Yaşadığınız sorunu sizden önce birileri mutlaka yaşamıştır.Lütfen ilk buraya göz atın

Cevapla
 
LinkBack Konu Seçenekleri
  #1 (permalink)  
Eski 05-04-2008, 09:48:20
SNaRe - ait Avatar
 
Ankara Şubesi
Nerden: Ankara
Yaş: 22
Mesajlar: 1.969
Thanks: 0
Thanked 0 Times in 0 Posts
iTrader Puanı: (27)
iTrader Feedback: (100%)
Rep puanı: 416
SNaRe isimli üyemiz bir mücevher!SNaRe isimli üyemiz bir mücevher!SNaRe isimli üyemiz bir mücevher!SNaRe isimli üyemiz bir mücevher!SNaRe isimli üyemiz bir mücevher!
Tanımlı Windows Localhost'ta Videoları Flv Ye Çevirmek ve Ekran Görüntüsü Almak

Uzun süre araştrıdım. Adam gibi bir kaynak bulamamıştım. Cevizde birisi anlatmış. Buldum denedim ve sorunsuz çalışıyor.
İlk başta aşağıdaki ffmpeg dosyasını indirip C: içine açın
RapidShare: 1-Click Webhosting
Ardından aşağıdaki scriptle dönüştürme işlemlerini, videodan görüntü alma işlemlerini yapabilirsiniz
PHP Kodu:
<?
//Configuration
define ('EZFFMPEG_BIN_PATH''C:\\bin\\ffmpeg.exe');//Chemin local vers ffmpeg
$src_filepath='C:\\1.avi'//Kaynak Dosya Yolu
$output_capture_filepath='C:\\1.jpg'//Oluşturulacak resim yolu
$output_filepath='C:\\1.flv'//Oluşturulacak video yolu
$seconds_position=30;  // Videonun kaçıncı saniyesinde alınacağı
$jpg_resolution="320x240"// Çözünürlüğü

function ezffmpeg_vdofile_infos$src_filepath )
{
         
$commandline EZFFMPEG_BIN_PATH." -i ".$src_filepath;
         
$exec_return          ezffmpeg_exec($commandline);
         
$exec_return_content  explode ("\n" $exec_return);
         
//Traitement du retour
         
if( $error_line_id ezffmpeg_array_search('error'$exec_return_content) )
         {
                  
//Erreur, retourne status = -1 et error_msg = message d'erreur
                 
$error_line trim($exec_return_content[$error_line_id]); 
                 
$return_array['status']         = -1;
                 
$return_array['error_msg'] = $error_line;
         }
         else
         {
                  
//OK, decode le resultat et renvoie status = 1 + datas
                 
$return_array['status']         = 1;
                 
//Decodage des infos duree / bitrate
                 
if($infos_line_id ezffmpeg_array_search('Duration:'$exec_return_content))
                 {
                        
$infos_line       trim($exec_return_content[$infos_line_id]);
                        
$infos_cleaning explode (': '$infos_line);
                         
//Duree                         
                         
$infos_datas         explode (','$infos_cleaning[1]);
                         
$return_array['vdo_duration_format']  = trim($infos_datas[0]);
                         
$return_array['vdo_duration_seconds'] = ezffmpeg_common_time_to_seconds($return_array['vdo_duration_format']);
                         
//Bitrate                         
                         
$return_array['vdo_bitrate']  = trim($infos_cleaning[3]);
                 }
                 
//Decodage des infos codec video
                 
if($infos_line_id ezffmpeg_array_search('Video:'$exec_return_content))
                 {
                        
$infos_line       trim($exec_return_content[$infos_line_id]);
                        
$infos_cleaning explode (': '$infos_line);
                         
$infos_datas         explode (','$infos_cleaning[2]);
                         
$return_array['vdo_format'] = trim($infos_datas[0]);
                         
$return_array['vdo_codec']  = trim($infos_datas[1]);
                         
$return_array['vdo_res']      = trim($infos_datas[2]);
                         
$return_array['vdo_fps']      = trim($infos_datas[3]);
                 }
                 
//Decodage des infos codec video
                 
if($infos_line_id ezffmpeg_array_search('Audio:'$exec_return_content))
                 {
                        
$infos_line       trim($exec_return_content[$infos_line_id]);
                        
$infos_cleaning explode (': '$infos_line);
                         
$infos_datas         explode (','$infos_cleaning[2]);
                         
$return_array['aud_codec']          = trim($infos_datas[0]);
                         
$return_array['aud_frequency']  = trim($infos_datas[1]);
                         
$return_array['aud_monostereo'] = trim($infos_datas[2]);
                         
$return_array['aud_bitrate']         = trim($infos_datas[3]);
                 }                 
         }
         return(
$return_array);
}
//Conversion d'une video (1 : OK, 2 : SANS LE SON, -1 : ERR)
function ezffmpeg_vdofile_convert ($src_filepath$output_filepath$vdo_format='flv'$vdo_resolution="320x240"$vdo_bitrate '512k'$vdo_framerate '25'$audio_bitrate='32'$audio_frequency='44100'  )
{
        
$commandline EZFFMPEG_BIN_PATH." -i ".$src_filepath." -f ".$vdo_format." -s ".$vdo_resolution." -pass 1 -ab ".$audio_bitrate." -aspect 4:3 -r ".$vdo_framerate." -ar ".$audio_frequency." -b ".$vdo_bitrate." ".$output_filepath;
      
$exec_return          ezffmpeg_exec($commandline);
        
$exec_return_content  explode ("\n" $exec_return);
        
//Si la conversion a echoue, methode alternative (sans le son)
    
if((!file_exists($output_filepath)) || (filesize($output_filepath) <= 0))
    {
                  
$commandline EZFFMPEG_BIN_PATH." -i ".$src_filepath." -f ".$vdo_format." -s ".$vdo_resolution." -b ".$vdo_bitrate." -aspect 4:3 -r ".$vdo_framerate." -an ".$output_filepath;
              
$exec_return          ezffmpeg_exec($commandline);
              
$exec_return_content  explode ("\n" $exec_return);
              
//Test reussite
          
if((!file_exists($output_filepath)) || (filesize($output_filepath) <= 0))
          {
                         return(
2);//Echec conversion normale, conversion sans le son (2)        
              
}
                    else
                    {
                         return(-
1);//Echec, pas de conversion
                    
}
        }    
        else
        {
                 return(
1);//Conversion normale, tout s'est bien passe (1)        
        
}
}
//Conversion d'une video vers de la 3G (1 : OK, 2 : SANS LE SON, -1 : ERR)
function ezffmpeg_vdofile_3g ($src_filepath$output_filepath )
{
        
$commandline EZFFMPEG_BIN_PATH." -i ".$src_filepath." -y -acodec amr_nb -s 176x144 -ar 8000 -b 80 -vcodec h263 -ac 1 ".$output_filepath;
      
$exec_return          ezffmpeg_exec($commandline);
        
$exec_return_content  explode ("\n" $exec_return);
        
//Si la conversion a echoue, methode alternative (sans le son)
    
if((!file_exists($output_filepath)) || (filesize($output_filepath) <= 0))
    {
                  
$commandline EZFFMPEG_BIN_PATH." -i ".$src_filepath." -an -s 176x144 -vcodec h263 -ac 1 ".$output_filepath;
              
$exec_return          ezffmpeg_exec($commandline);
            
$exec_return_content  explode ("\n" $exec_return);
              
//Test reussite
          
if((!file_exists($output_filepath)) || (filesize($output_filepath) <= 0))
          {
                         return(
2);//Echec conversion normale, conversion sans le son (2)        
              
}
                    else
                    {
                         return(-
1);//Echec, pas de conversion
                    
}
        }    
        else
        {
                 return(
1);//Conversion normale, tout s'est bien passe (1)        
        
}
}
//Creation d'une capture jpg d'une video
function ezffmpeg_vdofile_capture_jpg ($src_filepath$output_filepath$seconds_position$jpg_resolution="320x240" )
{
        
$commandline EZFFMPEG_BIN_PATH." -i ".$src_filepath." -y -f mjpeg -t 0.001 -s ".$jpg_resolution." -ss ".$seconds_position." ".$output_filepath;
      
$exec_return          ezffmpeg_exec($commandline);
        
$exec_return_content  explode ("\n" $exec_return);
    if((!
file_exists($output_filepath)) || (filesize($output_filepath) <= 0))
    {
                 return(
1);//Conversion OK (1)        
        
}
        else
        {
                 return(-
1);//Echec, pas de conversion
        
}
}
//Formatage d'une timestamp HH:MM:SS en secondes
function ezffmpeg_common_time_to_seconds($timestamp)
{
                  
$timestamp_datas explode (':'$timestamp);
                 
$nb_seconds            $timestamp_datas[2]; 
                 
$nb_minutes            $timestamp_datas[1]; 
                 
$nb_hours                $timestamp_datas[0]; 
                 
$return_val            = ($nb_hours*3600)+($nb_minutes*60)+$nb_seconds;
                 return(
$return_val);
}
//Execution propre de FFMpeg avec recuperation des datas
function ezffmpeg_exec ($commandline)
{
             
$read '';
      
$handle popen($commandline.' 2>&1''r');
      while(!
feof($handle))
            {
                
$read .= fread($handle2096);
            }
      
pclose($handle);
            return(
$read);
}
//Recherche data dans un array
function ezffmpeg_array_search($needle$array_lines)
{
    
$return_val false;
    
reset ($array_lines);
        foreach( 
$array_lines as $num_line => $line_content )
        {
            if( 
strpos($line_content$needle) !== false )
                {
                    return(
$num_line);
                }
        }
        return(
$return_val);
}
?>
Eğer bu scripti kullanmak istemezseniz
PHP Kodu:
system('C:\\bin\\ffmpeg.exe -i C:\\1.avi C:\\1.flv'); 
şeklinde ffmpeg i kullanabilirsiniz..
Yazıyı güzel gördüğüm için alıntı yaptım.

Bunlarda yaptığım bazı örnekler
Ekran görüntüsü almak

PHP Kodu:
system('C:\\bin\\ffmpeg.exe -i C:\\xampp\\htdocs\\flv\\h\\xx.wmv -s 320*240 -vframes 1 -f mjpeg C:\\xampp\\htdocs\\flv\\h\\x.jpg'); 
wmv yi flv ye çevirmek

PHP Kodu:
system('C:\\bin\\ffmpeg.exe -i C:\\xampp\\htdocs\\flv\\h\\xx.wmv C:\\xampp\\htdocs\\flv\\h\\1.flv'); 
__________________
Zamanında Zamanın Kıymetini Bilseydik..Şu Zamanda Zamanın Kölesi Olmazdık.

Konu SNaRe tarafından (05-04-2008 Saat 10:35:19 ) de değiştirilmiştir..
Alıntı ile Cevapla
Cevapla


Konuyu Toplam 1 üye okuyor. (0 Kayıtlı üye ve 1 Misafir)
 
Konu Seçenekleri

Yetkileriniz
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-KodlarıKapalı
Trackbacks are Açık
Pingbacks are Açık
Refbacks are Açık

Okuduğunuz Konuya Benzer Konular
Konu Konuyu Açan Forum Cevaplar Son Mesaj
Pırıl pırıl Windows XP püf noktaları VistaXp işletim Sistemleri 0 12-11-2007 13:28:25
en çok aranan video türleri SABQCES Silver Webmaster paylaşım 20 05-09-2007 22:31:15
Windows Vista Uyumlu Bilgisayar Nasıl Olmalı? Benim bilgisayarımda çalışır mı? mehmetali Windows Vista 8 03-06-2007 18:25:24
Windows Vista Ayrıntı inceleme mehmetali Windows Vista 5 31-05-2007 00:36:28

Bütün Zaman Ayarları WEZ +3 olarak düzenlenmiştir. Şu Anki Saat: 21:38:50 .


 
Telif Hakları vBulletin v3.7.2 © 2000-2008, ve Jelsoft Enterprises Ltd.'e Aittir.
Hosted by Radore Hosting

“İnsanların en hayırlısı, insanlara faydalı olandır”. H.Ş

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198