- 论坛徽章:
- 0
|
- void start_record_video(void)
- {
- time_t t;
- struct tm t_utc;
- int k;
- char outfile_name[CHANNEL_COUNT][150];
- char outfile_name_len[CHANNEL_COUNT][150];
- char tmp[10];
- char tmp2[10];
-
- time(&t);
- localtime_r(&t, &t_utc);
- memset(rec_file_name, 0, 56);
- sprintf(rec_file_name, "%d-%d-%d_%d-%d-%d_",t_utc.tm_year+1900,
- t_utc.tm_mon +1, t_utc.tm_mday,t_utc.tm_hour, t_utc.tm_min, t_utc.tm_sec);
- printf("rec_file_name====%s\n", rec_file_name);
- printf("strlen rec_file_name=%d\n",strlen(rec_file_name));
-
- for(k=0; k<4; k++)
- {
- strcpy(outfile_name[k], spath);
- strcpy(outfile_name_len[k], spath);
-
- strcat(outfile_name[k], rec_file_name);
- strcat(outfile_name_len[k], rec_file_name);
- }
- for(k=0;k<CHANNEL_COUNT;k++)
- {
- if(g_rec_enable_channel[k] == 1)
- {
- memset(tmp, 0, 10);
- memset(tmp2, 0, 10);
-
- sprintf(tmp, "%d.264", k+1);
- sprintf(tmp2, "%d.bin", k+1);
- strcat(outfile_name[k], tmp);
- strcat(outfile_name_len[k], tmp2);
-
- printf("%s\n", outfile_name[k]);
- printf("%s\n", outfile_name_len[k]);
-
-
- g_dout[k] = fopen(outfile_name[k],"wb");
-
- //perror("fopen1\n");
-
- g_dout_len[k] = fopen(outfile_name_len[k],"wb");
- //perror("fopen2\n");
- printf("after fopen\n");
- }
- }
- g_localstream_enable= 1;
- package_time_counts= 0;
- }
复制代码
[ 本帖最后由 marco_hxj 于 2009-8-17 10:05 编辑 ] |
|