static void calc_timecode(int pos, int do_frames) { MPEG_timecode_t tc; mpeg_timecode(&tc, pos, mpeg_framerate_code(mpeg_conform_framerate(fps)), fps); if (!do_frames) tc.f=0; sprintf(timecode,"%2d:%2.2d:%2.2d:%2.2d",tc.h,tc.m,tc.s,tc.f); }
static char *print_status(int frame, double framerate) { MPEG_timecode_t tc; static char temp[256]; mpeg_timecode(&tc, frame, mpeg_framerate_code(mpeg_conform_framerate(framerate)), framerate); sprintf(temp, "%d:%2.2d:%2.2d.%2.2d", tc.h, tc.m, tc.s, tc.f); return temp; }
char *format_time(int pos, double fps) { char temp[128]; MPEG_timecode_t tc; y4m_ratio_t r = mpeg_conform_framerate(fps); mpeg_timecode(&tc, pos, mpeg_framerate_code(r), fps ); snprintf(temp,sizeof(temp),"%d:%2.2d:%2.2d:%2.2d",tc.h, tc.m, tc.s, tc.f ); return strdup(temp); }
static void stats(video_playback_stats *stats) { if (exit_flag) return; current_frame = stats->frame; if (gui_mode) { printf("@%g/%d/%ld/%d\n",info->editlist->video_fps,stats->frame, info->editlist->video_frames,stats->play_speed); } else { MPEG_timecode_t tc; mpeg_timecode(&tc, stats->frame, mpeg_framerate_code (mpeg_conform_framerate(info->editlist->video_fps)), info->editlist->video_fps); printf("%d:%2.2d:%2.2d.%2.2d (%6.6d/%6.6ld) - Speed: %c%d, Norm: %s, Diff: %f\r", tc.h, tc.m, tc.s, tc.f, stats->frame, info->editlist->video_frames, stats->play_speed>0?'+':(stats->play_speed<0?'-':' '), abs(stats->play_speed), stats->norm==1?"NTSC":"PAL", stats->tdiff); } fflush(stdout); }