comparison mencoder.c @ 4387:df705351885a

ETA/Esize/fps and some more... - new statusline
author arpi
date Sun, 27 Jan 2002 18:29:33 +0000
parents 9cf9516e74cb
children b6b429d10296
comparison
equal deleted inserted replaced
4386:09f77684a676 4387:df705351885a
341 char* filename=NULL; 341 char* filename=NULL;
342 char* frameno_filename="frameno.avi"; 342 char* frameno_filename="frameno.avi";
343 343
344 int decoded_frameno=0; 344 int decoded_frameno=0;
345 int next_frameno=-1; 345 int next_frameno=-1;
346
347 unsigned int timer_start;
346 348
347 //int out_buffer_size=0x200000; 349 //int out_buffer_size=0x200000;
348 //unsigned char* out_buffer=malloc(out_buffer_size); 350 //unsigned char* out_buffer=malloc(out_buffer_size);
349 351
350 mp_msg_init(MSGL_STATUS); 352 mp_msg_init(MSGL_STATUS);
1102 } 1104 }
1103 1105
1104 signal(SIGINT,exit_sighandler); // Interrupt from keyboard 1106 signal(SIGINT,exit_sighandler); // Interrupt from keyboard
1105 signal(SIGQUIT,exit_sighandler); // Quit from keyboard 1107 signal(SIGQUIT,exit_sighandler); // Quit from keyboard
1106 signal(SIGTERM,exit_sighandler); // kill 1108 signal(SIGTERM,exit_sighandler); // kill
1109
1110 timer_start=GetTimerMS();
1107 1111
1108 while(!eof){ 1112 while(!eof){
1109 1113
1110 float frame_time=0; 1114 float frame_time=0;
1111 int blit_frame=0; 1115 int blit_frame=0;
1386 else 1390 else
1387 max_pts_correction=sh_video->frametime*0.10; // +-10% of time 1391 max_pts_correction=sh_video->frametime*0.10; // +-10% of time
1388 // sh_video->timer-=x; 1392 // sh_video->timer-=x;
1389 c_total+=x; 1393 c_total+=x;
1390 v_pts_corr+=x; 1394 v_pts_corr+=x;
1391 1395 }
1392 printf("A:%6.1f V:%6.1f A-V:%7.3f oAV:%7.3f diff:%7.3f ct:%7.3f vpc:%7.3f \r", 1396
1393 a_pts,v_pts,a_pts-v_pts, 1397 // printf("A:%6.1f V:%6.1f A-V:%7.3f oAV:%7.3f diff:%7.3f ct:%7.3f vpc:%7.3f \r",
1394 (float)(mux_a->timer-mux_v->timer), 1398 // a_pts,v_pts,a_pts-v_pts,
1395 AV_delay, c_total, v_pts_corr ); 1399 // (float)(mux_a->timer-mux_v->timer),
1396 1400 // AV_delay, c_total, v_pts_corr );
1397 } 1401 // printf("V:%6.1f \r", d_video->pts );
1398 else
1399 printf("V:%6.1f \r", d_video->pts );
1400 1402
1401 #if 0 1403 #if 0
1402 mp_msg(MSGT_AVSYNC,MSGL_STATUS,"A:%6.1f V:%6.1f A-V:%7.3f ct:%7.3f %3d/%3d %2d%% %2d%% %4.1f%% %d%%\r", 1404 mp_msg(MSGT_AVSYNC,MSGL_STATUS,"A:%6.1f V:%6.1f A-V:%7.3f ct:%7.3f %3d/%3d %2d%% %2d%% %4.1f%% %d%%\r",
1403 a_pts,v_pts,a_pts-v_pts,c_total, 1405 a_pts,v_pts,a_pts-v_pts,c_total,
1404 (int)sh_video->num_frames,(int)sh_video->num_frames_decoded, 1406 (int)sh_video->num_frames,(int)sh_video->num_frames_decoded,
1406 (sh_video->timer>0.5)?(int)(100.0*vout_time_usage/(double)sh_video->timer):0, 1408 (sh_video->timer>0.5)?(int)(100.0*vout_time_usage/(double)sh_video->timer):0,
1407 (sh_video->timer>0.5)?(100.0*audio_time_usage/(double)sh_video->timer):0 1409 (sh_video->timer>0.5)?(100.0*audio_time_usage/(double)sh_video->timer):0
1408 ,cache_fill_status 1410 ,cache_fill_status
1409 ); 1411 );
1410 #endif 1412 #endif
1413
1414 { float t=(GetTimerMS()-timer_start)*0.001f;
1415 float len=(demuxer->movi_end-demuxer->movi_start);
1416 float p=len>1000 ? (float)(demuxer->filepos-demuxer->movi_start) / len : 0;
1417 mp_msg(MSGT_AVSYNC,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %3dfps ETA:%4dmin/%3dmb A-V:%5.3f \r",
1418 mux_v->timer, decoded_frameno, (int)(p*100),
1419 (t>1) ? (int)(decoded_frameno/t) : 0,
1420 (p>0.001) ? (int)(t/p/60) : 0,
1421 (p>0.001) ? (int)(ftell(muxer_f)/p/1024/1024) : 0,
1422 v_pts_corr
1423 );
1424 }
1411 1425
1412 fflush(stdout); 1426 fflush(stdout);
1413 1427
1414 1428
1415 1429