So there IS something strange with OMV's downloader and you are going to analyze it, right?
I did analyze it and what I posted is the strange but expected(?) behavior of youtube-dl. I will try explain it better:
youtube-dl with no arguments - downloads highest quality video and highest quality audio separately, can merge into mkv if ffmpeg available
youtube-dl with --format=best - same as no arguments
youtube-dl with --format=best[ext=mp4] - downloads best mp4 and best audio, may not be the highest video, can merge into mkv if ffmpeg available
Yes, there work but you don't end up with what you are asking for - an mp4 in my example. Maybe mkv is ok??
These are the arguments the plugin uses:
youtube-dl with --format=bestvideo[ext=mp4]/bestaudio - downloads video that satisfies both requirements in one video, may not be the highest video or highest audio, doesn't need ffmpeg, always get the video type you ask for.
I'm not sure what the best option is. I guess I can add an option to leave out the best* arguments?
Would it make sense to introduce some kind of "Extra Options" field to customize the way how the plugin downloads a file? There are so many command line switches available for youtube-dl, which you can never map all of them in the GUI.
I have always regretted that there is no possibility of individual customizing. For me a way to customize output format and resolution would be valuable.
Right now, all of the logic to determine what arguments to use is in the php code. To do what you are asking would require that logic to be in the client side javascript. If the plugin allowed both (extra options from the client and logic in the php code), the plugin would have to validate commands (tough) and remove duplicate arguments. I will have to look at it to come up with some ideas.