Video from array of images ffmpeg windows php - php

I have an array of images src.
$src = array("folder1/imagejsbs124.jpg","folder2/image45125hsja.jpg", ");
I want to convert those images into a video.mp4 creating a animated slideshow.
I searched stackoverflow but it didn't work for me. Therefore I asked this personally and hope someone will find an answer.

Try out as given here Create a video slideshow from images.
Simple example to generate a video from some images using ffmpeg can be
ffmpeg -f image2 -i image%d.jpg video.mpg
This will bascically use all images from the current directory (named image1.jpg, image2.jpg .... imagen.jpg) to generate a video named video.mpg.
Using php you can also checkout for FFmpeg-php which i basically a php extension for ffmpeg.
if files are in different directory then use Concatenate:
Create a file concat.txt and then use it as input
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'
ffmpeg -f concat -i concat.txt video.mpg

Related

Converting MP3 to Video with Single/Multiple images as video with PHPVideoToolkit

Just started using PHPVideoToolkit and I'm looking to take an MP3 and convert it to a video. I want to have a single image as the video with the audio playing.
On the Google Code page https://code.google.com/p/phpvideotoolkit/ it says it can assemble a video stream from a set of separate video images so I know it's possible but I cannot figure out how from the GitHub documentation.
The documentation found in the documentation directory of the repository appear to be empty.
Help is much appreciated
You can use ffmpeg
Turning Images into Video
ffmpeg -f image2 -i image%d.jpg video.mpg
This command will transform all the images from the current directory (named image1.jpg, image2.jpg) to a video file named video.mpg.
Playing music in the video
ffmpeg -i song.wav -i video.avi video_finale.mpg
This command will add a song.wav in video.avi and give a final video_final.mpg

Generate image from a swf file issue

I am trying to generate first frame of a swf as a thumbnail image so the user can see it before they open the swf file.
1.Using FFMpeg
ffmpeg -i movie.swf -f image2 -vcodec png movie%d.png
using command line with ffmpeg to generate images. the above command will
give me errors saying
[swf # 0x17937a0] Compressed SWF format not supported
2.Using swftools
Their website provide a tar file to download however, I only have the command line access in the server so I won't be able to install the tools.
I need to use server side technology because I have hundreds of swf files.
p7zip e movie.swf
ffmpeg -i movie~.swf movie.png
Most SWF files are compressed to save space, similar to a .tar.gz or .zip. So before you can use it with FFmpeg, you need to extract or decompress the file.
p7zip is a
command line program
that can extract SWF.

Converting video to .mp4 format after upload from local system does not show the video only hear sound

I am using fileuploader.js to upload a video file. Now i want to convert the video format to .mp4. I have used ffmpeg and php to convert the video to .mp4 after upload. The sample segment i used is
$converted = "uploads/".$uniqid.".mp4"; //$uniqid is the id for the video after upload
$cmd = "$ffmpeg -i $sourceUrl -f mp4 $converted"; //$sourceUrl is the path of the video
I have tried to convert .flv video file to .mp4 format and it does but the problem is i cannot see the video only hear the sound after converting. Is the conversion line used in $cmd incorrect. Please help.
Just ffmpeg -i source.flv output.mp4 should be enough, it will use default codecs for mp4. Can you paste the ffmpeg response to the above command?

First Capturing thumbnail from a Video using php?

I have an upload functionality on my site. And i want the php script to take out a random frame from the uploaded video, and save it as an image. Is that possible?please guide me how can i get first capture image in video upload in php
Thanks for Advance.
You need ffmpeg installed on your server.
With that, use the exec() function:
exec('ffmpeg -i /path/to/your/video.avi -f image2 -vframes 1 /path/to/thumbnail.jpg');
Take a look at the Flowplayer Tutorial or the ffmpeg documentation for more options

creating thumbnail image through ffmpeg.exe

I am creating thumbnail image(small size) from a big image. for same images it unable to create the thumbnail. if i move the image from one place to another it works.
case:
if image x is created in year 2000 and i tried to extract thumbnail from that and let i failed. then i moved the same image to another place and again try to extracted the thumbanil and it successfully extracted the thumbnail. even if i am again transforming the same image to the same place it is working.
Edit: The command is:
C:/xampp/htdocs/jcert6/seyretfiles/tools/converter/ffmpeg.exe
-i "\\myip\knowledge base\videos\user_62\RHSSNet_Image_Library\images\Touchport_II\CD302_14_TPII_17in_PPR_Scanner.jpg"
-y -f mjpeg -s 72x92 -vframes 1
-an c:/xampp/htdocs/jcert6/seyretfiles/uploads/thumbnails/user_62/user_62_tz2jliomkfunsrhd1291976903_0.jpg –
While debugging, I found that if any images do not have created date is not processed by the ffmpeg and generate error image codec parameter.
is it possible to process images without having a create date in ffmpeg???
Check your folder permissions and/or the path to the original file and the thumbnail. If it work by changing the location, this is the problem. Just guessing though cause do not have enough info.

Categories