Jump to content

Need help with php code


goheadtry

Recommended Posts

$output is the variable I just need to know what to do with this.

I need the $output to be a numbered jpeg such as 0000001.jpg 0000002.jpg

and a numbered flv 0000001.flv 0000002.flv

so I just need the numbering part

how do I make it do this so that it is automaticly done lets say 0000001.jpg 0000002.jpg so the next one made will be 0000003.jpg and so on and so forth

and the next flv

made will be 0000003.flv and so on and so forth it does not need the extension I just need to make sure it does the sequence correctly so I don't get over written files etc.

By the way the command runs ffmpeg

<?php
$input = $_GET['input'];
$output = ?
exec 'ffmpeg -i /home/forbushj/public_html/uploadvidd/'.$input.' -ar 22050 -ab 32 -f flv -s 320x240 /home/forbushj/public_html/2vidd/'.$output.'.flv';
exec 'ffmpeg -i /home/forbushj/public_html/2vidd/'.$input.' -an -ss 00:00:45 -an -r 1 -vframes 1 -y -s 150x100 /home/forbushj/public_html/2vidd/'.$output.'.jpg';
?>

Link to comment
Share on other sites

i am currently funneling through the usage of ffmpeg myself.

i have found that it is only possible to create GIF images using ffmpeg.

to create JPEG images, you have to use ffmpeg-php (which took me like 40 hours to install), and here is the code i use:

 

$frame = 1;
$gd = new ffmpeg_movie("/path/to/file.avi");
$framegd = $gd->getFrame($frame);
$im = $framegd->toGDImage();
imagejpeg($im,"filename.jpg");

 

i have also found that you cannot get screenshots of a flv, only the source avi/mpeg...etc

 

your welcome  ;)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.