comparison mencoder.c @ 7370:8e07aeda7344

count dropped frames in -v mode, patch by Andriy N. Gritsenko <andrej@lucky.net>
author arpi
date Tue, 10 Sep 2002 23:19:20 +0000
parents 7ec253a97341
children e5e2243a3adb
comparison
equal deleted inserted replaced
7369:b34b005ab4f8 7370:8e07aeda7344
315 uint32_t videorate=0; 315 uint32_t videorate=0;
316 uint32_t audiosamples=1; 316 uint32_t audiosamples=1;
317 uint32_t videosamples=1; 317 uint32_t videosamples=1;
318 uint32_t skippedframes=0; 318 uint32_t skippedframes=0;
319 uint32_t duplicatedframes=0; 319 uint32_t duplicatedframes=0;
320 uint32_t badframes=0;
320 321
321 aviwrite_stream_t* mux_a=NULL; 322 aviwrite_stream_t* mux_a=NULL;
322 aviwrite_stream_t* mux_v=NULL; 323 aviwrite_stream_t* mux_v=NULL;
323 off_t muxer_f_size=0; 324 off_t muxer_f_size=0;
324 325
1037 if(skip_flag<=0) aviwrite_write_chunk(muxer,mux_v,muxer_f,sizeof(int),0x10); 1038 if(skip_flag<=0) aviwrite_write_chunk(muxer,mux_v,muxer_f,sizeof(int),0x10);
1038 break; 1039 break;
1039 default: 1040 default:
1040 // decode_video will callback down to ve_*.c encoders, through the video filters 1041 // decode_video will callback down to ve_*.c encoders, through the video filters
1041 blit_frame=decode_video(sh_video,start,in_size,(skip_flag>0)?1:0); 1042 blit_frame=decode_video(sh_video,start,in_size,(skip_flag>0)?1:0);
1042 if(!blit_frame && skip_flag<=0){ 1043 if(!blit_frame){
1044 badframes++;
1045 if(skip_flag<=0){
1043 // unwanted skipping of a frame, what to do? 1046 // unwanted skipping of a frame, what to do?
1044 if(skip_limit==0){ 1047 if(skip_limit==0){
1045 // skipping not allowed -> write empty frame: 1048 // skipping not allowed -> write empty frame:
1046 aviwrite_write_chunk(muxer,mux_v,muxer_f,0,0); 1049 aviwrite_write_chunk(muxer,mux_v,muxer_f,0,0);
1047 } else { 1050 } else {
1048 // skipping allowed -> skip it and distriubute timer error: 1051 // skipping allowed -> skip it and distriubute timer error:
1049 v_timer_corr-=(float)mux_v->h.dwScale/mux_v->h.dwRate; 1052 v_timer_corr-=(float)mux_v->h.dwScale/mux_v->h.dwRate;
1050 } 1053 }
1054 }
1051 } 1055 }
1052 } 1056 }
1053 1057
1054 videosamples++; 1058 videosamples++;
1055 videorate+=(GetTimerMS() - ptimer_start); 1059 videorate+=(GetTimerMS() - ptimer_start);
1132 (int)demuxer->movi_start, 1136 (int)demuxer->movi_start,
1133 (int)demuxer->filepos, 1137 (int)demuxer->filepos,
1134 (int)demuxer->movi_end); 1138 (int)demuxer->movi_end);
1135 #else 1139 #else
1136 if(verbose) { 1140 if(verbose) {
1137 mp_msg(MSGT_AVSYNC,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %3dfps Trem:%4dmin %3dmb A-V:%5.3f [%d:%d] A/Vms %d/%d D/S %d/%d \r", 1141 mp_msg(MSGT_AVSYNC,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %3dfps Trem:%4dmin %3dmb A-V:%5.3f [%d:%d] A/Vms %d/%d D/B/S %d/%d/%d \r",
1138 mux_v->timer, decoded_frameno, (int)(p*100), 1142 mux_v->timer, decoded_frameno, (int)(p*100),
1139 (t>1) ? (int)(decoded_frameno/t+0.5) : 0, 1143 (t>1) ? (int)(decoded_frameno/t+0.5) : 0,
1140 (p>0.001) ? (int)((t/p-t)/60) : 0, 1144 (p>0.001) ? (int)((t/p-t)/60) : 0,
1141 (p>0.001) ? (int)(ftello(muxer_f)/p/1024/1024) : 0, 1145 (p>0.001) ? (int)(ftello(muxer_f)/p/1024/1024) : 0,
1142 v_pts_corr, 1146 v_pts_corr,
1143 (mux_v->timer>1) ? (int)(mux_v->size/mux_v->timer/125) : 0, 1147 (mux_v->timer>1) ? (int)(mux_v->size/mux_v->timer/125) : 0,
1144 (mux_a && mux_a->timer>1) ? (int)(mux_a->size/mux_a->timer/125) : 0, 1148 (mux_a && mux_a->timer>1) ? (int)(mux_a->size/mux_a->timer/125) : 0,
1145 audiorate/audiosamples, videorate/videosamples, 1149 audiorate/audiosamples, videorate/videosamples,
1146 duplicatedframes, skippedframes 1150 duplicatedframes, badframes, skippedframes
1147 ); 1151 );
1148 } else 1152 } else
1149 mp_msg(MSGT_AVSYNC,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %3dfps Trem:%4dmin %3dmb A-V:%5.3f [%d:%d]\r", 1153 mp_msg(MSGT_AVSYNC,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %3dfps Trem:%4dmin %3dmb A-V:%5.3f [%d:%d]\r",
1150 mux_v->timer, decoded_frameno, (int)(p*100), 1154 mux_v->timer, decoded_frameno, (int)(p*100),
1151 (t>1) ? (int)(decoded_frameno/t+0.5) : 0, 1155 (t>1) ? (int)(decoded_frameno/t+0.5) : 0,