最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時間:2014年02月13日 09:08:28   作者:  
這篇文章主要介紹了codeigniter上傳視頻并使用ffmpeg轉(zhuǎn)成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');
}

相關文章

最新評論

佛教| 石屏县| 门头沟区| 砚山县| 左云县| 商水县| 城口县| 酒泉市| 阿荣旗| 马公市| 隆尧县| 海伦市| 前郭尔| 定兴县| 克什克腾旗| 麻城市| 慈利县| 德州市| 乡宁县| 阿拉善盟| 肇州县| 泗阳县| 本溪市| 吴忠市| 马龙县| 南漳县| 嘉兴市| 邮箱| 昌都县| 海阳市| 昌图县| 夹江县| 平湖市| 江津市| 胶州市| 青神县| 搜索| 临朐县| 香格里拉县| 日土县| 阿拉善盟|