Asg 4: OpenCV video transcode
Assignment
Implement a basic video transcoder using OpenCV.
Suggestions (e.g., for Python implementation)
- Simply put, you mainly need three function calls:
cv2.VideoCapture(file)
cv2.VideoWriter_fourcc()
cv2.VideoWriter()
and then the main loop that read and writes each frame.
- The main concern here is output format, size, and sampling rate.
The latter is interesting as it allows you to effectively alter
the video speed.
Further Suggestions
- Just about the only tricky part is not forgetting to close the
output file via
out.release()
.
Example Program Input
None. Find a short video that you like.
Example Program Output
None. Ideally an .mp4
video could be made, although that
may need to be encoded post-facto by ffmpeg as OpenCV might only output
raw video.
Turn in
Turn in all of your code, in one tar.gz
archive of your asg##/ directory, including:
- A
README
file containing
- Course id--section no
- Name
- Brief solution description
(e.g., program design, description of
algorithm, etc., however appropriate).
- Lessons learned, identified interesting features of your
program
- Any special usage instructions
Makefile
- source code
- short video
How to hand in
See handin
notes