Hi krish_22,
What OS are you using? I believe that the “1” at the end of line 20 of your original post might be the problem. By default that last parameter of “1” is for color and is supported by windows only. You can try 0 in place of FOURCC which is for uncompressed avi.
Let me know if this works
Regards
Intel_Alvarado