Convert video while uploading [closed]

2019-03-22 11:31发布

I want to convert a video (say from wmv format to flv) while a user uploads it. I can either convert a video or upload it individually, but how to do them at once?

Iam using ffmpeg for conversion, like:

ffmpeg -i WMV.wmv WMV.flv

But iam unsure about the steps to be followed to convert and upload a video. Do i need to use Ajax or something like that?

标签: php ffmpeg
1条回答
Explosion°爆炸
2楼-- · 2019-03-22 11:52

FFMPEG is a pretty powerful plugin

For PHP side execution example

<?php

     /*** convert video to flash ***/
     exec("ffmpeg -i video.wmv -ar 22050 -ab 32 -f flv -s 320x240 video.flv");

?>

The terms used

 -i Input file name
 -ar Audio sampling rate in Hz
 -ab Audio bit rate in kbit/s
 -f Output format
 -s Output dimension

To know the advanced uses of FFMPEG Check the link

FFmpeg Tricks You Should Know About

查看更多
登录 后发表回答