@@ -51,7 +51,7 @@ Otherwise open it using **cap.open()**.
51
51
52
52
You can also access some of the features of this video using ** cap.get(propId)** method where propId
53
53
is a number from 0 to 18. Each number denotes a property of the video (if it is applicable to that
54
- video) and full details can be seen here: cv::VideoCapture::get() .
54
+ video) and full details can be seen here: cv::VideoCapture::get().
55
55
Some of these values can be modified using ** cap.set(propId, value)** . Value is the new value you
56
56
want.
57
57
@@ -66,7 +66,7 @@ Playing Video from file
66
66
-----------------------
67
67
68
68
It is same as capturing from Camera, just change camera index with video file name. Also while
69
- displaying the frame, use appropriate time for cv2.waitKey(). If it is too less, video will be very
69
+ displaying the frame, use appropriate time for ` cv2.waitKey() ` . If it is too less, video will be very
70
70
fast and if it is too high, video will be slow (Well, that is how you can display videos in slow
71
71
motion). 25 milliseconds will be OK in normal cases.
72
72
@code {.py}
@@ -95,7 +95,7 @@ Saving a Video
95
95
--------------
96
96
97
97
So we capture a video, process it frame-by-frame and we want to save that video. For images, it is
98
- very simple, just use cv2.imwrite(). Here a little more work is required.
98
+ very simple, just use ` cv2.imwrite() ` . Here a little more work is required.
99
99
100
100
This time we create a ** VideoWriter** object. We should specify the output file name (eg:
101
101
output.avi). Then we should specify the ** FourCC** code (details in next paragraph). Then number of
@@ -109,10 +109,10 @@ platform dependent. Following codecs works fine for me.
109
109
- In Fedora: DIVX, XVID, MJPG, X264, WMV1, WMV2. (XVID is more preferable. MJPG results in high
110
110
size video. X264 gives very small size video)
111
111
- In Windows: DIVX (More to be tested and added)
112
- - In OSX : * (I don't have access to OSX. Can some one fill this?) *
112
+ - In OSX: MJPG (.mp4), DIVX (.avi), X264 (.mkv).
113
113
114
- FourCC code is passed as cv2.VideoWriter_fourcc('M','J','P','G') or
115
- cv2.VideoWriter_fourcc(\ * 'MJPG') for MJPG.
114
+ FourCC code is passed as ` cv2.VideoWriter_fourcc('M','J','P','G') ` or
115
+ ` cv2.VideoWriter_fourcc(*'MJPG') ` for MJPG.
116
116
117
117
Below code capture from a Camera, flip every frame in vertical direction and saves it.
118
118
@code {.py}
0 commit comments