i wrote program play video file, , added section print out additional relevant data:
iplimage* frame; while(1){ frame = cvqueryframe( g_capture ); if (!frame) break; cvshowimage( "example 3", frame); //seperate int fp1 = (int) cvgetcaptureproperty(g_capture, cv_cap_prop_fps); cout << "current fps: " << fp1 << endl; int fp2 = (int) cvgetcaptureproperty(g_capture, cv_cap_prop_pos_msec); cout << "current video position: " << fp2 << endl; int fp3 = (int) cvgetcaptureproperty(g_capture, cv_cap_prop_pos_avi_ratio); cout << "current relative frames position: " << fp3 << endl; int fp4 = (int) cvgetcaptureproperty(g_capture, cv_cap_prop_pos_frames); cout << "current relative frames position 2: " << fp4 << endl; cvsettrackbarpos("position","example 3",++g_slider_position); char c = cvwaitkey(33); if( c == 27 ) break; }
however, reason i'm not getting right data back: fp1 working correctly, stays @ 29. fp2 on other hand fluctuates between 35 , 45, when should steadily counting upwards video progresses. , fp3 , fp4 don't work @ all: give me 0 , -1 respectively, , give me gstreamer-critical
error:
(example 3:21373): gstreamer-critical **: gst_query_set_position: assertion 'format == g_value_get_enum (gst_structure_id_get_value (s, gst_quark (format)))' failed current relative frames position: 0 (example 3:21373): gstreamer-critical **: gst_query_set_position: assertion 'format == g_value_get_enum (gst_structure_id_get_value (s, gst_quark (format)))' failed current relative frames position 2: -1 current fps: 29 current video position: 39
what problem here? test video simple animated clip downloaded youtube, , converted mp4 avi ffmpeg.
Comments
Post a Comment