Description: OpenCV Computer Vision Library, so use image or video processing, so that there is no sound in playing video temporarily
Software: Use OpenCV player (no sound)
Feature Description: Creates a new playback form. Join the progress bar to drag the video playback.
Flow chart:
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvd3f0agfoyq==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
Function Description:
1. New Progress bar Cvcreattrackbar ("", "", &,frames,callback)
2, get total frame number Cvgetcaptureproperty (&,id)
Double Cvgetcaptureproperty (cvcapture* capture, int property_id); capture video capture structure. the property_id property identity. Can be one of the following:Cv_cap_prop_frame_count-The total number of frames in a video file
3. Callback function Cvset (&. ID, POS)
int Cvsetcaptureproperty (cvcapture* capture, int property_id, double value) The identifier for the property_id property. Can be one of the following:cv_cap_prop_pos_frames-Unit is the position of the frame number (only valid for video files)
Source:
#include "cv.h" #include "highgui.h" int g_slider_position=0; cvcapture* g_capture =null;void cvtrackcalllback (int pos) { cvsetcaptureproperty (g_capture, Cv_cap_prop_pos_ FRAMES, POS);} int main (int argc, char** argv) {Cvnamedwindow ("Example3", cv_window_autosize); g_capture = cvcreatefilecapture ("Video Path") ; int frames = (int) cvgetcaptureproperty (g_capture,cv_cap_prop_frame_count); if (frames!=0) { Cvcreatetrackbar ("Test", "Example3", &g_slider_position,frames,cvtrackcalllback); } iplimage* Frame;while (1) {frame = Cvqueryframe (g_capture) cvshowimage ("Example3", frame); Cvwaitkey (0);} return 0;}
The execution structure is as follows:
Have a problem, willing to communicate with you!
Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.
Use OPENCV players to create a video control (no sound)