Of course, sudo is useless, I did a bad copy and paste as I was testing it with sudo and took the shell code from there. It is working with avi, even if my source is an mp4 file (the streaming of an ipcamera). I think it depends on the type of the video source.