improved mp4-setup, better detection of mediaend