久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何為 CentOS 6.5 版服務(wù)器設(shè)置 ffmpeg

How to setup ffmpeg for CentOS release 6.5 server(如何為 CentOS 6.5 版服務(wù)器設(shè)置 ffmpeg)
本文介紹了如何為 CentOS 6.5 版服務(wù)器設(shè)置 ffmpeg的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我需要從視頻創(chuàng)建屏幕截圖,

I need to create a screen shot from video,

我已關(guān)注 本教程在window 8,php 5.3

I have followed this tutorial to do the intial setup in window 8, php 5.3

1) 我從這里下載了 ffmpeg -[http://ffmpeg.zeranoe.com/builds/ ] 適用于 64 位操作系統(tǒng).

1) I downloaded the ffmpeg from here -[ http://ffmpeg.zeranoe.com/builds/ ] for 64 bit operating system.

2) 我關(guān)注了 https://www.youtube.com/watch?v=gU49GiWGGAI ,視頻并成功完成所有配置,phpinfo() 顯示 ffmpeg 已安裝.

2) I followed the https://www.youtube.com/watch?v=gU49GiWGGAI , video and did all configuration successfully and phpinfo() shows that ffmpeg has been installed.

3) 然后我嘗試了 this 以了解它是否有效,

3) Then I tried this to find out whether it is working or not,

成功了

4) 接下來我按照這個(gè)視頻教程這里 并成功創(chuàng)建了縮略圖.

4) Next I followed this video tutorial here and thumbnails were created successfully.

下面是我的代碼

/**
 * FFMPEG-PHP Test Script
 *
 * Special thanks to http://www.sajithmr.me/ffmpeg-sample-code for this code example!
 * See the tutorial at http://myownhomeserver.com on how to install ffmpeg-php.
 */
error_reporting(1);
error_reporting(E_ALL ^ E_NOTICE);
// Check if the ffmpeg-php extension is loaded first
extension_loaded('ffmpeg') or die('Error in loading ffmpeg');

// Determine the full path for our video
$vid = realpath('./videos/myvideo.mp4');
$videosize = filesize($vid);
$remoteVideo = 'http://video-js.zencoder.com/oceans-clip.mp4';

//ffmpeg

$ffmpeg = dirname(__FILE__) . "\ffmpeg\bin\ffmpeg";
$imageFile = "1.png";
$image2 = "2.png";
$size = "120x90";
$getfromsecond = 7;
$cmd = "$ffmpeg -i $vid -an -ss $getfromsecond -s $size $imageFile";
$cmd2 = "$ffmpeg -i $remoteVideo -an -ss $getfromsecond -s $size $image2";
if(!shell_exec($cmd)){
    echo "Thumbnail created";
}else{
    echo "Error Creating thumbnail";
}

if(!shell_exec($cmd2)){
    echo "Thumbnail for remote url was created";
}else{
    echo "Error Creating thumbnail for remote url ";
}

<小時(shí)>

  OUTPUT
    Thumbnail created
    Thumbnail for remote url was created

現(xiàn)在上面的代碼在我的本地窗口機(jī)器中按預(yù)期工作,我需要在我的服務(wù)器環(huán)境(Linux 服務(wù)器)中使用 php 5.5 執(zhí)行此操作.如何在 CentOS 6.5 版服務(wù)器中使用 php 5.5 配置 ffmpeg.

Now above code works as expected in my local, in window machine , I need to do it in my server environment(Linux server) with php 5.5. How do I do the configuration for ffmpeg in CentOS release 6.5 server with php 5.5.

我已按照本教程將其安裝在服務(wù)器中

I have followed this tutorial to install it in server

1.http://supportlobby.com/blog/ffmpeg-installation-on-centos-6-5/

2.http://tecadmin.net/install-ffmpeg-on-linux/

控制臺(tái)輸出

[root@BRANDWEB01D ~]# ffmpeg -version
ffmpeg version 2.2.1
built on Apr 13 2014 13:00:18 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --enable-runtime-cpudetect --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-pthreads --enable-x11grab --enable-vdpau --disable-avisynth --enable-frei0r --enable-libopencv --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --disable-stripping
libavutil      52. 66.100 / 52. 66.100
libavcodec     55. 52.102 / 55. 52.102
libavformat    55. 33.100 / 55. 33.100
libavdevice    55. 10.100 / 55. 10.100
libavfilter     4.  2.100 /  4.  2.100
libswscale      2.  5.102 /  2.  5.102
libswresample   0. 18.100 /  0. 18.100
libpostproc    52.  3.100 / 52.  3.100
[root@BRANDWEB01D ~]# which ffmpeg
/usr/bin/ffmpeg
[root@BRANDWEB01D ~]# ffmpeg -formats
ffmpeg version 2.2.1 Copyright (coffee) 2000-2014 the FFmpeg developers
  built on Apr 13 2014 13:00:18 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --enable-runtime-cpudetect --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-pthreads --enable-x11grab --enable-vdpau --disable-avisynth --enable-frei0r --enable-libopencv --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --disable-stripping
  libavutil      52. 66.100 / 52. 66.100
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 33.100 / 55. 33.100
  libavdevice    55. 10.100 / 55. 10.100
  libavfilter     4.  2.100 /  4.  2.100
  libswscale      2.  5.102 /  2.  5.102
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
File formats:
 D. = Demuxing supported
 .E = Muxing supported

但是在服務(wù)器中,當(dāng)我打開我的 php 文件時(shí)出現(xiàn)此錯(cuò)誤 Error in loading ffmpeg

我還檢查了 phpinfo(),它顯示 ffmpeg 安裝在我的本地但沒有安裝在服務(wù)器中.

But in server when I open my php file I am getting this error Error in loading ffmpeg

Also I have checked phpinfo(), It shows ffmpeg installed in my local but not in server.

我還需要做什么才能在 Cent Os 6.5 php 5.5 中配置 ffmpeg.

What else I need to do to configure ffmpeg in Cent Os 6.5 php 5.5.

推薦答案

我找不到你的安裝步驟或命令,需要用ffmpeg-php配置,

I could not find your installation steps or commands, You need to configure with ffmpeg-php,

#  git clone https://github.com/tony2001/ffmpeg-php.git
#  cd ffmpeg-php
#  make clean
#  phpize 
#  ./configure 
#  make
#  make install

# vim /usr/lib/php.ini 
[ffmpeg]
extension=ffmpeg.so

# pkill -9 httpd
#  /etc/init.d/httpd start

# php -i|grep ffmpeg

ffmpeg
ffmpeg-php version => 0.7.0

這篇關(guān)于如何為 CentOS 6.5 版服務(wù)器設(shè)置 ffmpeg的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Action View Helper in Zend - Work around?(Zend 中的動(dòng)作視圖助手 - 解決方法?)
Is this a good way to match URI to class/method in PHP for MVC(這是將 URI 與 PHP 中用于 MVC 的類/方法匹配的好方法嗎)
Where do I save partial (views) in Zend Framework, to be accessible for all Views in my App?(我在哪里保存 Zend Framework 中的部分(視圖),以便我的應(yīng)用程序中的所有視圖都可以訪問?) - IT屋-程序員軟件開發(fā)技術(shù)
Having a single entry point to a website. Bad? Good? Non-issue?(有一個(gè)網(wǎng)站的單一入口點(diǎn).壞的?好的?沒問題?)
Is MVC + Service Layer common in zend or PHP?(MVC + 服務(wù)層在 Zend 或 PHP 中常見嗎?)
Hello World example in MVC approach to PHP(PHP MVC 方法中的 Hello World 示例)
主站蜘蛛池模板: 日韩成人免费视频 | 国产精品永久久久久久久www | 亚洲精品乱码久久久久久9色 | 亚洲成av| 亚洲国产精品久久 | 亚洲精品福利在线 | 国产精品精品3d动漫 | 91精品国产乱码久久久久久 | 国产精品中文字幕在线播放 | 视频三区 | 日韩欧美亚洲 | 欧美日韩一区精品 | 伊人国产精品 | 在线不卡视频 | 日韩在线播放视频 | 免费观看www7722午夜电影 | 国产精品毛片av | 欧美综合一区二区 | 欧美视频一区二区三区 | 午夜a级理论片915影院 | 一级二级三级黄色 | 精品综合视频 | 成人在线视频免费观看 | 国产天天操 | 91成人在线视频 | 人人人干 | 日本视频一区二区 | 又黄又爽的网站 | 麻豆精品一区二区三区在线观看 | 91久久久www播放日本观看 | 国产免费福利小视频 | 97伊人| 欧美一区二区三区四区五区无卡码 | 91欧美| 999精品在线| 久久久久久久国产 | 国产精品一区二区免费 | 国产日韩一区二区三区 | 亚洲网站在线观看 | 最近中文字幕第一页 | 亚洲欧美在线视频 |