티스토리 뷰


서버에 업로드 되는 동영상을 구분 또는 영상의 내용을 확인하기 위하여,
영상의 스틸 이미지 저장이 필요하게 되었음.

조건
- OS : Linux
- Language : PHP
- 동영상 코덱 : AVI / MPG

검색해 보니, ffmpeg 라는 동영상 변환 Open-Source 가 있었음.

FFMPEG - http://ffmpeg-php.sourceforge.net

Features
•Simple object oriented interface.
Ability to grab frames from movie files and return them as images that can be manipulated using PHP's built-in image functions. This is great for automatically creating thumbnails for movie files.  ← 필요한 기능
•Can create animated GIFs from a series of movie frames or GD images.
•Has the ability to use ffmpeg's excellent re-sampling and cropping features on returned frames.
•Provides access to data from mp3 files such as duration, bit rate and track meta information. 

Here's a list of some of my favorite sites using ffmpeg-php.
•Opusphp.com - Opus php CMS is a great alternative to hastily designed CMS/Social Networking software on the market today, and another great example of how you can use ffmpeg/ffmpeg-php!

•Vimeo.com - Vimeo.com is a super cool site for organizing and sharing video clips. Think del.icio.us meets Flickr for video! ffmpeg-php is used for automatic thumbnailing of movies uploaded to the site. Thanks to Vimeo's creator, Jakob Lodwick for the link and encouragement!

•Trainorders.com - Trainorders is a popular rail enthusiast website with some unique features. My favorite is the new motion activated camera systems that automatically record passing trains at various popular rail junctions. Once recording is complete, the movies are uploaded to the Trainorders.com website where they are thumbnailed using ffmpeg-php and presented to subscribers. A big thanks to Todd Clark, the webmaster of Trainorders.com, for the opportunity to help develop this.

•patricksaviation.com - This is my son's favorite site on the internet. It's a video sharing website for aviation enthusiasts. Fun! If there's a better use for the internet, I haven't found it.

•half-lime.com - An excellent video sharing website with a great interface. Thanks to Aleksander Kuprikov for the link.

•filelabs.net - A free file storage service.

•www.mobiletoones.com - Rock your mobile phone!

•SIG: Image Gallery - A web-based image gallery written in PHP.

•Maktoob.com - the largest Arabic language web portal in the world uses ffmpeg extensively. Thanks to Jalal Araidah for the link.

HD 동영상 공유 싸이트로 근래 들어 널리 알려지는 Vimeo.com 에서도 스틸컷 이미지 만드는데 사용하고 있다니...
아직 적용해 보지는 안았지만 잘 작동할 것으로 예측 합니다.

사용예:
$preview = '이미지 저장 경로';
$movie = new ffmpeg_movie(동영상 PATH & Filename);
$frame = $movie->getFrame(특정 프레임 지정);
$gd_image = $frame->toGDImage();
@imagejpeg($image, $preview, 80);

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크