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

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

主站蜘蛛池模板: 杭锦后旗| 鲁山县| 漳平市| 武汉市| 锦屏县| 游戏| 临沭县| 烟台市| 佳木斯市| 开化县| 平阳县| 定边县| 宁陵县| 福贡县| 望城县| 上思县| 门源| 梨树县| 德格县| 乌鲁木齐县| 临湘市| 会昌县| 桓台县| 沁阳市| 聂荣县| 江津市| 兴山县| 西乌珠穆沁旗| 会东县| 孟州市| 荃湾区| 申扎县| 大余县| 巩留县| 大关县| 高淳县| 于都县| 玉山县| 叶城县| 青河县| 峨眉山市|