日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php 视频上传 FFMpeg 视频格式转码

發布時間:2024/3/24 php 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php 视频上传 FFMpeg 视频格式转码 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

?

啥也不說先上源碼,安裝不會的可以看我的另一篇文章或者查看專欄https://blog.csdn.net/qq_29099209/article/details/79720723

<?phpnamespace App\Http\Controllers;use FFMpeg\Format\Video\X264; use FFMpeg\Format\Video\WMV; use FFMpeg\Format\Video\WebM; use FFMpeg\FFMpeg;class Home extends Controller {//public function upload(){$ffmpeg = FFMpeg::create(array('ffmpeg.binaries' => 'D:\phpStudy\php\php-7.0.12-nts\ffmpeg\bin\ffmpeg.exe','ffprobe.binaries' => 'D:\phpStudy\php\php-7.0.12-nts\ffmpeg\bin\ffprobe.exe','timeout' => 0,'ffmpeg.threads' => 12));$video = $ffmpeg->open('source/movie.MP4');$video->save(new X264(), 'export-x264.mp4')->save(new WMV(), 'export-wmv.wmv')->save(new WebM(), 'export-webm.webm');return true;} }

進行視頻操作的時候遇到了如下兩個錯誤,查了N多也沒找到

ProcessBuilder class is deprecated since Symfony 3.4 and will be removed in.......... Type error: Return value of Symfony\Component\Filesystem\Filesystem::toIterable() must be an instance of Symfony\Component\Filesystem\iterable, array returned

最后看了看源碼后,查了查 iterable

草發現PHP版本要大于7.1才行,以前我一直用的7.0

修改了版本之后,再次進行格式轉換發現OK啦

不過視頻大一點就轉換的比較慢

總結

以上是生活随笔為你收集整理的php 视频上传 FFMpeg 视频格式转码的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。