![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
hi
Industry Role:
Join Date: Jun 2002
Posts: 16,731
|
anyone know their way around with ffmpeg?
I need a php file that automatically grabs a screen cap of the first second of a flv video, using ffmpeg. I want to be able to use it in LongTail Video's flash player.
Anyone know how to do this?
__________________
M3Server - NATS Hosting |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
hi
Industry Role:
Join Date: Jun 2002
Posts: 16,731
|
this bitch dropped fast
__________________
M3Server - NATS Hosting |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Too lazy to set a custom title
Join Date: Jul 2002
Posts: 40,377
|
that's because only 3.75% of GFY'ers know what you're talking about
__________________
I don't use ICQ anymore. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Aug 2002
Location: Orlando, Florida
Posts: 2,051
|
Maybe this php file will work for you:
http://sourceforge.net/project/showf...roup_id=122353 ffmpeg-php is an extension for PHP that adds an easy to use, object-oriented API for accessing and retrieving information from video and audio files. It has methods for returning frames from movie files as images that can be manipulated using PHP's image functions. This works well for automatically creating thumbnail images from movies. ffmpeg-php is also useful for reporting the duration and bitrate of audio files (mp3, wma...). ffmpeg-php can access many of the video formats supported by ffmpeg (mov, avi, mpg, wmv...) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Too lazy to set a custom title
Join Date: Dec 2004
Posts: 17,513
|
If you're using LongTail I will have to assume you took my advice
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
hi
Industry Role:
Join Date: Jun 2002
Posts: 16,731
|
Quote:
![]()
__________________
M3Server - NATS Hosting |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
So Fucking Banned
Industry Role:
Join Date: Nov 2008
Location: with your dream girl
Posts: 4,941
|
http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html
For extracting images from a video: ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg This will extract one video frame per second from the video and will output them in files named `foo-001.jpeg', `foo-002.jpeg', etc. Images will be rescaled to fit the new WxH values. If you want to extract just a limited number of frames, you can use the above command in combination with the -vframes or -t option, or in combination with -ss to start extracting from a certain point in time. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Mar 2009
Posts: 193
|
Google is your friend.
__________________
Adult Software Solutions (ICQ 559884738) PHP, MySQL, Flash, Actionscript, Java, Wowza, CMS, Tube, VOD, CRM, Dating, Social Networks, Paysites, TGPs, Directories and more. If you can think it I can build it. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Guest
Posts: n/a
|
Quote:
![]() ![]() ![]() |
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
<?php
echo exec("/usr/local/bin/ffmpeg -i /home/account/public_html/video/video.flv -an -ss 1 -t 00:00:01 -r 1 -y -s qcif -f mjpeg /home/account/public_html/snapshot/snapshot.jpg"); ?>
__________________
hatisblack at yahoo.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Too lazy to set a custom title
Industry Role:
Join Date: May 2003
Location: icq: 71462500 Skype: Jupzchris
Posts: 27,880
|
i thought this was about the mac program ffmpegX that i use to convert my avi's to mov for my apple tv ;x
__________________
[email protected] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
Quote:
<?php foreach (glob("*.flv") as $filename) { echo exec("/usr/local/bin/ffmpeg -i /home/account/public_html/video/$filename -an -ss 1 -t 00:00:01 -r 1 -y -s qcif -f mjpeg /home/account/public_html/snapshot/$filename.jpg"); } ?> drop the php file in the folder with the flv's p.s. change the paths to your paths of course
__________________
hatisblack at yahoo.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
ffmpegx includes ffmpeg so yes
__________________
hatisblack at yahoo.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
Quote:
Code:
<? $video = $_GET['f']; $movie = new ffmpeg_movie($video, false); $frames = $movie->getFrameCount(); $frame = $movie->getFrame(50); $im = $frame->toGDImage(); imagejpeg($im,"$video.jpg"); imagedestroy($im); header("Content-type:image/jpeg"); readfile("$video.jpg"); ?> Code:
so.addVariable("image", "imgflv.php?f=video.flv");
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
Quote:
plus you could do it easier via a shell script Code:
for i in *.flv; do ffmpeg -an -y -t 00:00:01 -i "$i" -f image2 "`echo $i |sed 's/.flv$/.jpg/'`" ;done
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Too lazy to set a custom title
Industry Role:
Join Date: May 2003
Location: icq: 71462500 Skype: Jupzchris
Posts: 27,880
|
this thread gave me a headache but i keep staring at fris' avatar
mmmmmmm
__________________
[email protected] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |
Guest
Posts: n/a
|
Quote:
![]() |
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
hi
Industry Role:
Join Date: Jun 2002
Posts: 16,731
|
Wow, thanks a lot guys! Didn't expect so much input.
I'll test it out asap and let you know if it worked and share the whole solution.
__________________
M3Server - NATS Hosting |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
hi
Industry Role:
Join Date: Jun 2002
Posts: 16,731
|
Ok sweet it works like a charm! Here's a recap of the whole situation & solution for those with the same problem:
Since LongTail's FLV player does not automaticallly create a preview on the actual video page I had two choices, either enable autoplay so no preview is required, or use a little ffmpeg php script to make a screen cap of the video. The second seemed like a better option to save a lot of bandwidth (it's still user friendly since he only has to click a big ass play button to start the video). I installed FFMPEG and FFMPEG-PHP (not sure if I needed both but whatever they're both on my server here now. Here are the tutorials for Linux: FFMPEG tutorial: http://www.mysql-apache-php.com/ffmpeg-install.htm FFMPEG-PHP tutorial: http://ffmpeg-php.sourceforge.net/ I made a PHP file (thanks Fris & Killswitch) called imgpreview.php and added this code to it. Code:
<? $movie = new ffmpeg_movie($_GET['f'], false); $frame = $movie->getFrame(50); $im = $frame->toGDImage(); header('Content-type:image/jpeg'); imagejpeg($im); imagedestroy($im); ?> Thanks again guys.
__________________
M3Server - NATS Hosting |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
scriptmaster
Industry Role:
Join Date: May 2006
Location: Serbia
Posts: 5,237
|
Anytime ;)
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 |
scriptmaster
Industry Role:
Join Date: May 2006
Location: Serbia
Posts: 5,237
|
LoL LoL
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 |
Confirmed User
Industry Role:
Join Date: Mar 2004
Location: Rock Hill, SC
Posts: 5,370
|
Code:
function grabScreen($clip, $thumb, $dimensions) { //$dimensions should be in WxH format //$thumb should contain the full path to the image you want created $screengrab = "/usr/local/bin/ffmpeg -y -i '{$clip}' -f mjpeg -ss 10 -vframes 1 -s {$dimensions} -an '{$thumb}'"; @system($screengrab); } |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 |
Too lazy to set a custom title
Industry Role:
Join Date: Dec 2004
Location: Happy in the dark.
Posts: 93,305
|
Smokey hitted it...
__________________
"Tjeezers.cam wishes you a nice day” |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
Quote:
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 | |
Guest
Posts: n/a
|
Quote:
Code:
<? $movie = new ffmpeg_movie($_GET['f'], false); $frame = $movie->getFrame(rand(1, getFrameCount()); $im = $frame->toGDImage(); header('Content-type:image/jpeg'); imagejpeg($im); imagedestroy($im); ?> ![]() |
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#27 |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
guess i misunderstood the question, sorry i attempted to help you. i'll just keep me trap shut next time
![]()
__________________
hatisblack at yahoo.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#28 | |
hi
Industry Role:
Join Date: Jun 2002
Posts: 16,731
|
Quote:
![]() Please don't, I love you too ![]()
__________________
M3Server - NATS Hosting |
|
![]() |
![]() ![]() ![]() ![]() ![]() |