dilum Posted September 28, 2007 Share Posted September 28, 2007 Hi, anyone can give code for encode the video .wave to .fla using ffmpeg in PHP. thanks for any help. Quote Link to comment https://forums.phpfreaks.com/topic/70999-video-encoding/ Share on other sites More sharing options...
trq Posted September 28, 2007 Share Posted September 28, 2007 Just use exec() to execute whatever ffmpeg options you need. Quote Link to comment https://forums.phpfreaks.com/topic/70999-video-encoding/#findComment-356980 Share on other sites More sharing options...
dilum Posted September 28, 2007 Author Share Posted September 28, 2007 thanks guy, i know exec() function, but i want what is the parameters have to pass! Quote Link to comment https://forums.phpfreaks.com/topic/70999-video-encoding/#findComment-356983 Share on other sites More sharing options...
trq Posted September 28, 2007 Share Posted September 28, 2007 i know exec() function, but i want what is the parameters have to pass! Then you might want to find an ffmpeg board. Its got nothing at all to do with php. Quote Link to comment https://forums.phpfreaks.com/topic/70999-video-encoding/#findComment-356984 Share on other sites More sharing options...
dilum Posted September 28, 2007 Author Share Posted September 28, 2007 This is the code for encoding .avi to .flv, exec(ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320x240 video.flv); i want same code for encode videos. (ex. .wave to .flv , .mp3 to .flv like this) Quote Link to comment https://forums.phpfreaks.com/topic/70999-video-encoding/#findComment-356985 Share on other sites More sharing options...
trq Posted September 28, 2007 Share Posted September 28, 2007 Firsty, exec expects a string so the code would be... <?php exec('ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320x240 video.flv'); ?> Secondly, wav and mp3 are not video formats. Lastly, and I say it again. Your question has nothing to do with php. Your in the wrong place. Quote Link to comment https://forums.phpfreaks.com/topic/70999-video-encoding/#findComment-356990 Share on other sites More sharing options...
zq29 Posted September 28, 2007 Share Posted September 28, 2007 ~$ man ffmpeg Quote Link to comment https://forums.phpfreaks.com/topic/70999-video-encoding/#findComment-357015 Share on other sites More sharing options...
dilum Posted September 28, 2007 Author Share Posted September 28, 2007 I'm sorry guys, I want code for .wmv to .fla Quote Link to comment https://forums.phpfreaks.com/topic/70999-video-encoding/#findComment-357022 Share on other sites More sharing options...
neylitalo Posted September 28, 2007 Share Posted September 28, 2007 You know, it's not like these guys have a personal collection of commands that they can just look through to find the one you need. They had to look through man pages, read `ffmpeg --help`, and whatever else they could find. You can do it too. It never hurt to do a little searching yourself. Quote Link to comment https://forums.phpfreaks.com/topic/70999-video-encoding/#findComment-357407 Share on other sites More sharing options...
tomfmason Posted September 28, 2007 Share Posted September 28, 2007 it is as simple as $input = 'InputFile.wmv'; $output ='OutputFile.fla'; exec("ffmpeg -i $input $output", $response); echo $response; Quote Link to comment https://forums.phpfreaks.com/topic/70999-video-encoding/#findComment-357451 Share on other sites More sharing options...
dilum Posted September 29, 2007 Author Share Posted September 29, 2007 Thanks all guys, i found the code, <?php exec("ffmpeg -i ".$VIDEO_PATH.$video." -acodec mp3 -ar 22050 -ab 32 -f flv ".$VIDEO_PATH.$filename.".flv"); ?> $VIDEO_PATH - directory name initial file included $video - video file name(initial v filename) $filename - new file name (eg. fun) using this we can convert any video file to .flv file. Quote Link to comment https://forums.phpfreaks.com/topic/70999-video-encoding/#findComment-357740 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.