色尼玛亚洲综合影院,亚洲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示例,轉載需保留來源!

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

主站蜘蛛池模板: 南康市| 论坛| 广水市| 涟源市| 玛沁县| 安义县| 朝阳区| 嘉峪关市| 襄樊市| 阿克苏市| 上犹县| 永定县| 和政县| 疏勒县| 安龙县| 颍上县| 甘洛县| 偃师市| 明水县| 涿州市| 东海县| 邓州市| 昌江| 齐河县| 诸城市| 竹北市| 尚义县| 阿瓦提县| 莲花县| 宝应县| 临武县| 神农架林区| 景德镇市| 文山县| 子洲县| 宁陵县| 富裕县| 蕉岭县| 双江| 太和县| 龙州县|