正在显示
1 个修改的文件
包含
13 行增加
和
5 行删除
| @@ -102,21 +102,21 @@ void get_video_first_frame_jpeg(fileinfo video, char * destfile) | @@ -102,21 +102,21 @@ void get_video_first_frame_jpeg(fileinfo video, char * destfile) | ||
| 102 | run_shell_cmd(buf); | 102 | run_shell_cmd(buf); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | -void merge_audio_pic(fileinfo audio, int nf, fileinfo video, char * destfile) | 105 | +void merge_audio_pic(fileinfo audio, int nf, fileinfo video, const char * destfile) |
| 106 | { | 106 | { |
| 107 | char buf[2048]; | 107 | char buf[2048]; |
| 108 | sprintf(buf, "ffmpeg -y -loop 1 -i %s.jpg -i %d_%s -loop 0 -shortest %s %s %s", video.name.c_str(), nf, audio.name.c_str(),acodec_param, vcodec_param, destfile); | 108 | sprintf(buf, "ffmpeg -y -loop 1 -i %s.jpg -i %d_%s -loop 0 -shortest %s %s %s", video.name.c_str(), nf, audio.name.c_str(),acodec_param, vcodec_param, destfile); |
| 109 | run_shell_cmd(buf); | 109 | run_shell_cmd(buf); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | -void megre_audio_video(fileinfo audio, int nf, fileinfo video, char * destfile) | 112 | +void megre_audio_video(fileinfo audio, int nf, fileinfo video, const char * destfile) |
| 113 | { | 113 | { |
| 114 | char buf[2048]; | 114 | char buf[2048]; |
| 115 | sprintf(buf, "ffmpeg -y -i %d_%s -i %s %s %s %s", nf, audio.name.c_str(), video.name.c_str(), acodec_param, vcodec_param, destfile); | 115 | sprintf(buf, "ffmpeg -y -i %d_%s -i %s %s %s %s", nf, audio.name.c_str(), video.name.c_str(), acodec_param, vcodec_param, destfile); |
| 116 | run_shell_cmd(buf); | 116 | run_shell_cmd(buf); |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | -void concate_files(vector<string > merged_files, char * destfile) | 119 | +void concate_files(vector<string > merged_files, const char * destfile) |
| 120 | { | 120 | { |
| 121 | char buf[2048]; | 121 | char buf[2048]; |
| 122 | #ifdef WIN32 | 122 | #ifdef WIN32 |
| @@ -140,21 +140,29 @@ void concate_files(vector<string > merged_files, char * destfile) | @@ -140,21 +140,29 @@ void concate_files(vector<string > merged_files, char * destfile) | ||
| 140 | run_shell_cmd(buf); | 140 | run_shell_cmd(buf); |
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | -void adjust_dest_timecode(char * src , char * dest) | 143 | +void adjust_dest_timecode(const char * src , const char * dest) |
| 144 | { | 144 | { |
| 145 | char buf[2048]; | 145 | char buf[2048]; |
| 146 | sprintf(buf, "ffmpeg -y -i %s -acodec copy -vcodec copy %s", src, dest); | 146 | sprintf(buf, "ffmpeg -y -i %s -acodec copy -vcodec copy %s", src, dest); |
| 147 | run_shell_cmd(buf); | 147 | run_shell_cmd(buf); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | +#ifndef WIN32 | ||
| 151 | +#include <unistd.h> | ||
| 152 | +#endif | ||
| 153 | + | ||
| 150 | void removefiles(vector<string> files) | 154 | void removefiles(vector<string> files) |
| 151 | { | 155 | { |
| 152 | for (int i = 0; i < files.size(); i++) { | 156 | for (int i = 0; i < files.size(); i++) { |
| 157 | +#ifdef WIN32 | ||
| 153 | _unlink(files[i].c_str()); | 158 | _unlink(files[i].c_str()); |
| 159 | +#else | ||
| 160 | + unlink(files[i].c_str()); | ||
| 161 | +#endif | ||
| 154 | } | 162 | } |
| 155 | } | 163 | } |
| 156 | 164 | ||
| 157 | -int process_files(char * output_dest_file) | 165 | +int process_files(const char * output_dest_file) |
| 158 | { | 166 | { |
| 159 | vector<fileinfo> & filesaudio = media_files[type_audio]; | 167 | vector<fileinfo> & filesaudio = media_files[type_audio]; |
| 160 | vector<fileinfo> & filesvideo = media_files[type_video]; | 168 | vector<fileinfo> & filesvideo = media_files[type_video]; |
-
请 注册 或 登录 后发表评论