如何通过mplayer或者ffmpeg将视频拍照转为php?
如何通过mplayer或者ffmpeg将视频拍照转为php?
How to take pictures of the video through mplayer or ffmpeg to php?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何通过mplayer或者ffmpeg将视频拍照转为php?
How to take pictures of the video through mplayer or ffmpeg to php?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
尝试,
try,
假设您的服务器上安装了 ffmpeg,您可以使用以下代码将正好 2 分钟的帧输出到 JPEG 文件:
在此函数中, $video_filename 参数是不言自明的。 $dimensions 参数接受以下格式的输出图像的宽度和高度:WIDTHxHEIGHT。例如:320x480 将是可接受的参数。
Assuming ffmpeg is installed on your server, you can use the following code to output the frame at exactly 2 minutes to a JPEG file:
In this function, the $video_filename parameter is self-explanatory. The $dimensions parameter accepts width and height of the outputted images in this format: WIDTHxHEIGHT. For example: 320x480 would be an acceptable parameter.
将视频转换为帧并根据时间获取所需的帧会有所帮助。试试这个: ffmpeg -i video.flv -r 25 -vcodec png -pix_fmt rgb32 %d.png
您可以操纵格式和比特率(-r)以正确的格式获取所需的帧。
Converting the video to frames and getting the required frames based on timings can help. Try this :
ffmpeg -i video.flv -r 25 -vcodec png -pix_fmt rgb32 %d.png
You can manipulate the formats and bitrate(-r) for getting the required frame in proper format.