色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

codeigniter教程之上傳視頻并使用ffmpeg轉flv示例

復制代碼 代碼如下:
$file = 'video_file';
$config['upload_path'] = './video_folder/';
$config['allowed_types'] = 'mov|mpeg|mp3|avi';
$config['max_size'] = '50000';
$config['max_width']   = '';
$config['max_height']   = '';

$this->upload->initialize($config);
$this->load->library('upload', $config);

if(!$this->upload->do_upload($file))
{
// If there is any error
$err_msgs .= 'Error in Uploading video '.$this->upload->display_errors().'<br />';
}
else
{
$data=array('upload_data' => $this->upload->data());
$video_path = $data['upload_data']['file_name'];
  $directory_path = $data['upload_data']['file_path'];
$directory_path_full      = $data['upload_data']['full_path'];
$file_name = $data['upload_data']['raw_name'];

// ffmpeg command to convert video

exec("ffmpeg -i ".$directory_path_full." ".$directory_path.$file_name.".flv");

// $file_name is same file name that is being uploaded but you can give your custom video name after converting So use something like myfile.flv.

/// In the end update video name in DB
$array = array(
'video' => $file_name.'.'.'flv',
);
$this->db->set($array);
$this->db->where('id',$id); // Table where you put video name
$query = $this->db->update('user_videos');
}

php技術codeigniter教程之上傳視頻并使用ffmpeg轉flv示例,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 农安县| 玉屏| 郸城县| 墨竹工卡县| 新昌县| 仪征市| 许昌市| 彭泽县| 徐州市| 黎城县| 河东区| 营山县| 增城市| 博爱县| 成安县| 北川| 宜昌市| 馆陶县| 永康市| 会东县| 元江| 社旗县| 古丈县| 海原县| 丰镇市| 射洪县| 射阳县| 昌图县| 漯河市| 兴城市| 白水县| 内丘县| 遵义县| 确山县| 故城县| 澄迈县| 渑池县| 保山市| 临江市| 卢氏县| 桃园市|