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

codeigniter教程之上傳視頻并使用ffmpeg轉(zhuǎn)flv示例

復(fù)制代碼 代碼如下:
$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技術(shù)codeigniter教程之上傳視頻并使用ffmpeg轉(zhuǎn)flv示例,轉(zhuǎn)載需保留來(lái)源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 宁河县| 英德市| 平阳县| 扶沟县| 开江县| 武汉市| 理塘县| 洛宁县| 石柱| 那曲县| 饶河县| 宜兰市| 翁牛特旗| 万山特区| 云梦县| 关岭| 奎屯市| 泰安市| 江孜县| 福贡县| 延安市| 茌平县| 石门县| 会理县| 庆云县| 房山区| 三台县| 启东市| 麦盖提县| 恩平市| 昌江| 金坛市| 旌德县| 榕江县| 育儿| 黄浦区| 洛阳市| 鹿邑县| 赫章县| 清新县| 清流县|