The code is certainly ok and works well. Also, the dependence on 6.31 or 6.40 is probably just chance. Theoretically, the CODEC could cause the problem. Check wether you're getting the same message when using a movie file in a different format.