I don't really understand how the task and the solution are related to each other. Or maybe I didn't understand the task at all... Could you rephrase it? Of course, we can help you, but it's too hard to understand what you want to do. :)
Don't thought about whole task, but this expression after a quick glance can be simplified to ls -ltd $(find . -type f -iname "*.mp4" -printf "%h\n" | sort -u) except space in dir name problems