ubuntu 装配 ffmpeg php-ffmpeg
ubuntu 安装 ffmpeg php-ffmpeg
?? 最近在做一个视频网站安装本地环境费了不少时间。本地是ubuntu 9.10 而服务器是redhat as4 所以到时候本人会把服务器安装过程和大家分享出来。
本人环境如下
- php —- 5.210
- apache 2.2
- ubuntu 9.10
- ffmpeg 功能很强大包括视频抓图,视频信息,视频转换,在线视频录制,而且是免费的。所有一般的视频网站都会采用他。
- 本人首先是采用编译安装,但是一直都没有成功。编译过程中出现了很多问题。安装要使用ffmpeg往往需要编译很多包。感觉很麻烦。这些包又依赖于很多其他包。安装顺序也有要求。所以放弃了。
- 最终采用ubuntu 强大的 apt-get (使用dpkg进行安装) 进行安装(当然cenos,red hat这类使用rpm的系统都可以使用yum进行安装,具体的安装方法可以在本站进行查找).
- apt-get 安装步骤如下:
sudo apt-get update ##更新以下源
sudo apt-get install ffmpeg
sudo apt-get install php5-ffmpeg
sudo apt-get install mencoder
sudo apt-get install flvtool2 ##视频转换flv
sudo apt-get install lame ##音频
sudo apt0get install yasm - 编译安装ffmpeg 如下:
从 http://ffmpeg.mplayerhq.hu 下载
./configure –help ##查看有那些参数
./configure–prefix=/usr–enable-gpl–enable-shared–enable-libmp3lame–enable-libamr_nb–enable-libogg–enable-libvorbis–enable-libxvid–enable-liba52–enable-liba52bin–enable-pp–enable-libfaad–enable-libfaadbin–enable-libfaac–enable-pthreads–disable-ffserver–enable-x11grab
如果报错则安装该包,或者直接去掉该参数,只需要配置自己使用过程中需要使用到的就行了。
make & make install
其他的则一个一个的下载解压在编译就是了。
- 下面是php-ffmpeg 使用的api。功能是很少了。?
$movie = new ffmpeg_movie(String path_to_media, boolean persistent) Open a video or audio file and return it as an object.path_to_media - File path of video or audio file to open.persistent - Whether to open this media as a persistent resource. See the PHP documentation for more info about persistent resources$movie->getDuration() Return the duration of a movie or audio file in seconds.$movie->getFrameCount() Return the number of frames in a movie or audio file.$movie->getFrameRate() Return the frame rate of a movie in fps.$movie->getFilename() Return the path and name of the movie file or audio file.$movie->getComment() Return the comment field from the movie or audio file.$movie->getTitle() Return the title field from the movie or audio file.$movie->getAuthor() alias $movie->getArtist() Return the author field from the movie or the artist ID3 field from an mp3 file.$movie->getCopyright() Return the copyright field from the movie or audio file.$movie->getArtist() Return the artist ID3 field from an mp3 file.$movie->getGenre() Return the genre ID3 field from an mp3 file.$movie->getTrackNumber() Return the track ID3 field from an mp3 file.$movie->getYear() Return the year ID3 field from an mp3 file.$movie->getFrameHeight() Return the height of the movie in pixels.$movie->getFrameWidth() Return the width of the movie in pixels.$movie->getPixelFormat() Return the pixel format of the movie.$movie->getBitRate() Return the bit rate of the movie or audio file in bits per second.$movie->getVideoBitRate() Return the bit rate of the video in bits per second.NOTE: This only works for files with constant bit rate. $movie->getAudioBitRate() Return the audio bit rate of the media file in bits per second.$movie->getAudioSampleRate() Return the audio sample rate of the media file in bits per second.$movie->getFrameNumber() Return the current frame index.$movie->getVideoCodec() Return the name of the video codec used to encode this movie as a string.$movie->getAudioCodec() Return the name of the audio codec used to encode this movie as a string.$movie->getAudioChannels() Return the number of audio channels in this movie as an integer.$movie->hasAudio() Return boolean value indicating whether the movie has an audio stream.$movie->hasVideo() Return boolean value indicating whether the movie has a video stream.$movie->getFrame([Integer framenumber]) Returns a frame from the movie as an ffmpeg_frame object. Returns false if the frame was not found.framenumber - Frame from the movie to return. If no framenumber is specified, returns the next frame of the movie.$movie->getNextKeyFrame() Returns the next key frame from the movie as an ffmpeg_frame object. Returns false if the frame was not found.
로그인 후 복사 - 如果需要给视频抓图择需要使用shell脚本。也就是用到php当中的(system,exec,passthru)这类执行外部命令函数。
往往很多服务器都将种类函数视为危险函数屏蔽掉了。所以想做视频网站对服务器的配置要求比较高。
当然最好是自己的独立服务器。vps 也可以。随便你怎么整都可以。
?
测试用例:ffmpeg-execute.php
本文链接地址: ubuntu 安装 ffmpeg php-ffmpeg

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











오픈 소스에 대해 자세히 알아보려면 다음을 방문하세요. 51CTO Hongmeng 개발자 커뮤니티 https://ost.51cto.com 실행 환경 DAYU200:4.0.10.16SDK: 4.0.10.15IDE: 4.0.600 1. 애플리케이션을 생성하려면 파일을 클릭합니다. >새파일->CreateProgect. 템플릿 선택: [OpenHarmony]EmptyAbility: 프로젝트 이름 shici, 애플리케이션 패키지 이름 com.nut.shici 및 애플리케이션 저장 위치 XXX(한자, 특수 문자, 공백 없음)를 입력합니다. CompileSDK10, 모델: 스테이지. 장치

C 언어에서 return의 사용법은 다음과 같습니다. 1. 반환 값 유형이 void인 함수의 경우 return 문을 사용하여 함수 실행을 조기에 종료할 수 있습니다. 2. 반환 값 유형이 void가 아닌 함수의 경우 return 문은 함수 실행을 종료하는 것입니다. 결과는 호출자에게 반환됩니다. 3. 함수 실행을 조기에 종료합니다. 함수 내부에서는 return 문을 사용하여 함수 실행을 조기에 종료할 수 있습니다. 함수가 값을 반환하지 않는 경우.

파일 크기를 얻으려면 Java의 File.length() 함수를 사용하십시오. 파일 크기는 파일 작업을 처리할 때 매우 일반적인 요구 사항입니다. Java는 파일 크기를 얻는 매우 편리한 방법, 즉 길이( ) File 클래스의 메서드입니다. 이 기사에서는 이 방법을 사용하여 파일 크기를 가져오는 방법을 소개하고 해당 코드 예제를 제공합니다. 먼저, 크기를 구하려는 파일을 나타내는 File 객체를 만들어야 합니다. File 객체를 생성하는 방법은 다음과 같습니다: Filef

PHP Blob을 파일로 변환하는 방법: 1. PHP 샘플 파일을 생성합니다. 2. "function blobToFile(blob) {return new File([blob], 'screenshot.png', { type: 'image/jpeg' })를 통해 } ” 메소드를 사용하여 Blob을 파일로 변환할 수 있습니다.

컴퓨터에서 활성화는 특정 기능이나 옵션을 활성화하거나 활성화하는 것을 의미합니다. 컴퓨터 분야에서 활성화는 일반적으로 소프트웨어나 하드웨어에서 특정 기능이나 옵션을 활성화하는 프로세스를 설명하는 데 사용됩니다. 자세한 소개: 1. 소프트웨어 측면에서 활성화는 일반적으로 응용 프로그램이나 운영 체제에서 특정 기능을 활성화하는 것을 의미합니다. 2. 하드웨어 측면에서 활성화는 일반적으로 컴퓨터 시스템의 특정 장치 또는 인터페이스를 활성화하는 것을 의미합니다.

Java의 File.renameTo() 함수를 사용하여 파일 이름을 바꿉니다. Java 프로그래밍에서는 파일 이름을 바꿔야 하는 경우가 많습니다. Java는 파일 작업을 처리하기 위해 File 클래스를 제공하며 renameTo() 함수는 파일 이름을 쉽게 바꿀 수 있습니다. 이 기사에서는 Java의 File.renameTo() 함수를 사용하여 파일 이름을 바꾸는 방법을 소개하고 해당 코드 예제를 제공합니다. File.renameTo() 함수는 File 클래스의 메서드입니다.

기계력 보고서 편집자: 우신(Wu Xin) 국내판 휴머노이드 로봇+대형 모델팀이 옷 접기 등 복잡하고 유연한 재료의 작업 작업을 처음으로 완료했습니다. OpenAI 멀티모달 대형 모델을 접목한 Figure01이 공개되면서 국내 동종업체들의 관련 진전이 주목받고 있다. 바로 어제, 중국의 "1위 휴머노이드 로봇 주식"인 UBTECH는 Baidu Wenxin의 대형 모델과 긴밀하게 통합되어 몇 가지 흥미로운 새로운 기능을 보여주는 휴머노이드 로봇 WalkerS의 첫 번째 데모를 출시했습니다. 이제 Baidu Wenxin의 대형 모델 역량을 활용한 WalkerS의 모습은 이렇습니다. Figure01과 마찬가지로 WalkerS는 움직이지 않고 책상 뒤에 서서 일련의 작업을 완료합니다. 인간의 명령을 따르고 옷을 접을 수 있습니다.

소스 코드: publicclassReturnFinallyDemo{publicstaticvoidmain(String[]args){System.out.println(case1());}publicstaticintcase1(){intx;try{x=1;returnx;}finally{x=3;}}}# 출력 위 코드의 출력은 간단히 결론을 내릴 수 있습니다. return은 finally 전에 실행됩니다. 바이트코드 수준에서 무슨 일이 일어나는지 살펴보겠습니다. 다음은 case1 메소드의 바이트코드 일부를 가로채서 소스 코드를 비교하여 각 명령어의 의미를 주석으로 표시합니다.
