Try the find command which is recursive by its nature:
Code:
find /path/to/b -mindepth 2 -name \*.avi -exec echo mv '{}' /path/to/b \;
The echo statement will display the commands to execute, without actually executing them. Check the result, then run again without echo.