python opencv videowrite doesn't write video -


i started programming python opencv. used following page opencv 3.0.0 tutorial

tutorial @ read docs

when tried use example saves videos, doesn't work. displays content webcam, , creates file called output.avi, when checked size of ouput.avi, 0 bytes. tried using different codecs, yuy2

i use python 2.7.8 , opencv 3.0.0 , windows 8.1

replacing:

fourcc = cv2.videowriter_fourcc(*'xvid') 

with:

fourcc = cv2.videowriter_fourcc('m','j','p','g') 

worked me...

more generally:

look fourcc code of video compression format you're after here, , whatever code - instance 'fmp4' ffmpeg - plug in in following manner:

cv2.videowriter_fourcc('f','m','p','4')


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -