{"action":"opened","issue":{"url":"https://api.github.com/repos/mshabunin/test2/issues/70","labels_url":"https://api.github.com/repos/mshabunin/test2/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/mshabunin/test2/issues/70/comments","events_url":"https://api.github.com/repos/mshabunin/test2/issues/70/events","html_url":"https://github.com/mshabunin/test2/issues/70","id":95402319,"number":70,"title":"CreateVideoWriter does not report error","user":{"login":"mshabunin","id":3304494,"avatar_url":"https://avatars.githubusercontent.com/u/3304494?v=3","gravatar_id":"","url":"https://api.github.com/users/mshabunin","html_url":"https://github.com/mshabunin","followers_url":"https://api.github.com/users/mshabunin/followers","following_url":"https://api.github.com/users/mshabunin/following{/other_user}","gists_url":"https://api.github.com/users/mshabunin/gists{/gist_id}","starred_url":"https://api.github.com/users/mshabunin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mshabunin/subscriptions","organizations_url":"https://api.github.com/users/mshabunin/orgs","repos_url":"https://api.github.com/users/mshabunin/repos","events_url":"https://api.github.com/users/mshabunin/events{/privacy}","received_events_url":"https://api.github.com/users/mshabunin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mshabunin/test2/labels/auto-transferred","name":"auto-transferred","color":"ededed"},{"url":"https://api.github.com/repos/mshabunin/test2/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/mshabunin/test2/labels/category:%20python%20bindings","name":"category: python bindings","color":"ededed"},{"url":"https://api.github.com/repos/mshabunin/test2/labels/priority:%20normal","name":"priority: normal","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-16T10:18:49Z","updated_at":"2015-07-16T10:18:49Z","closed_at":null,"body":"Transferred from http://code.opencv.org/issues/1476\r\n```\n|| ken_seehart - on 2011-11-17 21:46\n|| Priority: Normal\n|| Affected: None\n|| Category: python bindings\n|| Tracker: Bug\n|| Difficulty: None\n|| PR: None\n|| Platform: None / None\n```\n\nCreateVideoWriter does not report error\n-----------\n```\nCreateVideoWriter should raise an exception when it fails, but does not.\r\n\r\n\r\n<pre>\r\n>>> import cv\r\n>>> w = cv.CreateVideoWriter('nonexistentdir/foobar/myvid.mpg', cv.CV_FOURCC('Z','Y','X','W'), 5, (354,332), 1)\r\n>>> w\r\n<VideoWriter 02E5EC10>\r\n>>> \r\n>>> im = cv.LoadImage('logo_largel.png')\r\n>>> cv.WriteFrame(w, im)\r\n0\r\n</pre>\r\n\r\nClearly, it should fail to open the output file for writing, and also fail due to the bogus ZYXW codec. Either of these conditions should raise an exception, or at least return something other than a healthy looking VideoWriter instance.\r\n\r\nThis is an important defect because without any error detection I am unable to troubleshoot my code.\r\n\r\nAs a side comment, the documentation does not state the meaning of the return value of cv.WriteFrame().\n```\n\nHistory\n-------\n##### ken_seehart - on 2011-12-01 00:18\n```\nPerhaps this should be expanded to a more general defect: The python bindings appear to have essentially no error handling whatsoever. A good start would be to forward cv::Exception into a python exception. Perhaps the C++ code needs more comprehensive error handling as well.\n```\n##### Alexander Shishkov on 2012-02-12 20:14\n```\n-   Description changed from [[CreateVideoWriter]] should raise an\n    exception when it fails, but does not. ... to CreateVideoWriter\n    should raise an exception when it fails, but does not. &l... More\n```"}}