Hi Paridhi,
As I have mentioned above, Board has some video codec problem. thats why cvCreateVideoWriter function fails. In my project I have to save video in board anyhow. So I have remove logitech webcam and I have interface IP camera using FFMPEG and it works successfully for me. I have not used above code.
Still if you find any solution about cvCreateVideoWriter function then please let me know..
Thanks
kishan