Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
9deb206e
Commit
9deb206e
authored
Jul 28, 2017
by
puqeko
Committed by
GitHub
Jul 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tested codecs for OSX
parent
34f9c039
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
py_video_display.markdown
...torials/py_gui/py_video_display/py_video_display.markdown
+6
-6
No files found.
doc/py_tutorials/py_gui/py_video_display/py_video_display.markdown
View file @
9deb206e
...
@@ -51,7 +51,7 @@ Otherwise open it using **cap.open()**.
...
@@ -51,7 +51,7 @@ Otherwise open it using **cap.open()**.
You can also access some of the features of this video using
**cap.get(propId)**
method where propId
You can also access some of the features of this video using
**cap.get(propId)**
method where propId
is a number from 0 to 18. Each number denotes a property of the video (if it is applicable to that
is a number from 0 to 18. Each number denotes a property of the video (if it is applicable to that
video) and full details can be seen here: cv::VideoCapture::get()
.
video) and full details can be seen here: cv::VideoCapture::get().
Some of these values can be modified using
**cap.set(propId, value)**
. Value is the new value you
Some of these values can be modified using
**cap.set(propId, value)**
. Value is the new value you
want.
want.
...
@@ -66,7 +66,7 @@ Playing Video from file
...
@@ -66,7 +66,7 @@ Playing Video from file
-----------------------
-----------------------
It is same as capturing from Camera, just change camera index with video file name. Also while
It is same as capturing from Camera, just change camera index with video file name. Also while
displaying the frame, use appropriate time for
cv2.waitKey()
. If it is too less, video will be very
displaying the frame, use appropriate time for
`cv2.waitKey()`
. If it is too less, video will be very
fast and if it is too high, video will be slow (Well, that is how you can display videos in slow
fast and if it is too high, video will be slow (Well, that is how you can display videos in slow
motion). 25 milliseconds will be OK in normal cases.
motion). 25 milliseconds will be OK in normal cases.
@code{.py}
@code{.py}
...
@@ -95,7 +95,7 @@ Saving a Video
...
@@ -95,7 +95,7 @@ Saving a Video
--------------
--------------
So we capture a video, process it frame-by-frame and we want to save that video. For images, it is
So we capture a video, process it frame-by-frame and we want to save that video. For images, it is
very simple, just use
cv2.imwrite()
. Here a little more work is required.
very simple, just use
`cv2.imwrite()`
. Here a little more work is required.
This time we create a
**VideoWriter**
object. We should specify the output file name (eg:
This time we create a
**VideoWriter**
object. We should specify the output file name (eg:
output.avi). Then we should specify the
**FourCC**
code (details in next paragraph). Then number of
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,10 +109,10 @@ platform dependent. Following codecs works fine for me.
-
In Fedora: DIVX, XVID, MJPG, X264, WMV1, WMV2. (XVID is more preferable. MJPG results in high
-
In Fedora: DIVX, XVID, MJPG, X264, WMV1, WMV2. (XVID is more preferable. MJPG results in high
size video. X264 gives very small size video)
size video. X264 gives very small size video)
-
In Windows: DIVX (More to be tested and added)
-
In Windows: DIVX (More to be tested and added)
-
In OSX
:
*(I don't have access to OSX. Can some one fill this?)*
-
In OSX
: MJPG (.mp4), DIVX (.avi), X264 (.mkv).
FourCC code is passed as
cv2.VideoWriter_fourcc('M','J','P','G')
or
FourCC code is passed as
`cv2.VideoWriter_fourcc('M','J','P','G')`
or
cv2.VideoWriter_fourcc(
\*
'MJPG')
for MJPG.
`cv2.VideoWriter_fourcc(*'MJPG')`
for MJPG.
Below code capture from a Camera, flip every frame in vertical direction and saves it.
Below code capture from a Camera, flip every frame in vertical direction and saves it.
@code{.py}
@code{.py}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment