通过php在服务器端将图像转换为视频 [英] convert image to video on server-side by php

查看:286
本文介绍了通过php在服务器端将图像转换为视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的访客将图片上传到服务器。我的网站为这些上载给出了一个连贯的名称(例如0001.jpg,0002.jpg,0003.jpg ...)。我想做的是,应用户的要求,我想在其上制作电影(最好不要制作动画)服务器端并将该视频发送给客户端。我该怎么做?

My visitors upload pictures to server. My website gives a sequencial name for these uploads (e.g. 0001.jpg, 0002.jpg, 0003.jpg...) What I want to do is, on request from user, I want to create a movie (preferably not flash) on server-side and send this video to client. How can I do this?

推荐答案

您必须使用 ffmpeg 用于在服务器端创建视频。这是一个非常灵活且功能强大的工具,可用于处理视频,音频和图像。

You have to use ffmpeg for creatiion video on serverside. It is very flexible and really powerful tool for working with video, audio and images.

例如,将图像image1.jpg,image2.jpg等转换为视频使用此命令

for example, to convert images image1.jpg, image2.jpg,.. into video use this command

ffmpeg -f image2 -i image%d.jpg video.mpg

要从php执行此命令,请使用执行系统函数。

To execute this command from php use exec or system function.

PS。还有其他命令行实用程序可用于根据图像 ogg-slideshow dvd-slideshow 。如果要添加一些
预定义的过渡效果或标题,它们非常方便。

PS. There are other command line utilites can be used to create video from images ogg-slideshow and dvd-slideshow. They very convenient if you want to add some predefined transition effects or titles.

这篇关于通过php在服务器端将图像转换为视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆