您好,我必須在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