您好,我必须在php中将视频文件转换为.flv格式。任何机构都有任何简单的脚本请给我。我们如何将视频文件转换为.flv格式在php
-1
A
回答
6
3
检查了这一点..这个代码应工作
<?php
class media_handler
{
function convert_media($filename, $rootpath, $inputpath, $outputpath, $width, $height, $bitrate, $samplingrate)
{
$outfile = "";
// root directory path, where FFMPEG folder exist in your application.
$rPath = $rootpath."\ffmpeg";
// which shows FFMPEG folder exist on the root.
// Set Media Size that is width and hieght
$size = $width."x".$height;
// remove origination extension from file adn add .flv extension, becuase we must give output file name to ffmpeg command.
$outfile =$filename;
$out=explode(".",$outfile);
// Media Size
//$size = Width & "x" & Height;
// remove origination extenstion from file and add .flv extension , becuase we must give output filename to ffmpeg command.
$outfile = $out[0].".flv";
// Use exec command to access command prompt to execute the following FFMPEG Command and convert video to flv format.
$ffmpegcmd1 = "/usr/local/bin/ffmpeg -i ".$inputpath."/".$filename. " -ar " .$samplingrate." -ab ".$bitrate." -f flv -s ".$size." ".$outputpath."/".$outfile;
//$ffmpegcmd1 = "/usr/local/bin/ffmpeg -i ".$inputpath."/".$filename. " -b 500 -r 25 -s 320×240 -hq -deinterlace -ab 56 -ar 22050 -ac 1 ".$outputpath."/".$outfile." 2>&1";
$ret = shell_exec($ffmpegcmd1);
// return output file name for other operations
return $ffmpegcmd1;
}
}
?>
-1
include_once( “media_handler.php”);
$ _objMda = new mandler(); // $ _ objMda as new mandler();
$ rootpath =“”; $ nputpath = $ rootpath。“/ Default”; $ outputpath = $ rootpath。 “/ FLV”; $ ThumbPath = $ rootpath。 “/大拇指”;
if($ _POST){//将原始视频保存在默认文件夹中。
$ source = $ _FILES ['file1'] ['tmp_name']; $ name = $ _FILES ['file1'] ['name']; $ fileSize = $ _FILES ['file1'] ['size']; $ filetype = $ _FILES ['file1'] ['type']; $ dest ='';
copy($ source,$ inputpath。$ name);
//转换成FLV格式
$ OUTFILE = $ _objMda-> convert_media($名称,$ ROOTPATH,$ inputpath,$ outputpath,320,240,32,22050);
我用过乌尔班,但没有结果先生。我可以在我的phpini上设置任何事情吗?
相关问题
- 1. 在c#中将视频文件转换为flv格式#
- 2. 将视频转换为.flv?
- 3. 如何使用PHP将AVI文件转换为FLV格式?
- 4. 如何将各种视频文件格式转换为FLV(用于FlowPlayer)?
- 5. 如何使用FFMPEG将MP4视频文件转换为FLV格式
- 6. 如何使用FFMPEG将视频转换为flv并将其转换为flv?
- 7. 在用于视频文件转换成FLV格式
- 8. 视频转换为flv
- 9. 使用FFMPEG将视频转换为FLV
- 10. 为什么将视频文件转换为FLV非常复杂?
- 11. 如何将上传的视频文件编码为.flv格式的PHP
- 12. 将.exe格式的Adobe Flash Player视频文件转换为Windows视频格式
- 13. 在asp.net中将任何视频转换为.flv格式,信任级别低
- 14. 如何使用php将flv文件转换为mp3文件?
- 15. 如何将.wmf格式的视频文件转换为.mp4或avi。格式?
- 16. 使用PHP将视频转换为flv或swf?
- 17. 使用PHP将视频文件转换为mp4,flv,webgl,webm,ogv等
- 18. 通过PHP将视频转换成任何格式为mp4?
- 19. 如何将Bystream视频转换为java中的文件视频
- 20. 如何将所有视频格式的文件转换为Android中所有音频格式的文件
- 21. 将文本转换为视频(mp4或mov或flv)
- 22. 将我的avi文件转换为flv格式的最佳方式是什么?
- 23. 如何在PHP中将所有音频格式转换为mp3?
- 24. 如何使用ffmpeg以编程方式将flv视频转换为mp3?
- 25. 将格式为.dwz的视频转换为其他格式
- 26. 将纯音频flv转换为aac:ffmpeg
- 27. 将vob文件转换为swf和flv
- 28. 如何将jpeg图像序列转换为视频格式?
- 29. 将wav音频文件转换为DSS音频格式
- 30. 将所有视频格式转换为3gp和mpeg4视频格式?
您好我创造这样的,但它不工作 的ffmpeg -i/SHO B的测试video.MPG -ar 22050-AB 32 -f -s FLV 320×240/FLV/SHO B的测试video.flv – 2010-05-27 06:18:47
我在Windows开发平台工作如果出现任何问题,请填写表格 – 2010-05-27 06:20:52
将您尝试过的任何内容添加到最初的问题中:完整的命令和出错的输出部分。 – zerkms 2010-05-27 07:07:22