add verification on return value
add video format support verification
format update
Merge pull request #371 from ruil2/encode_ret

add verification on return value -- review request #128