To retain the best video quality it is essential to avoid re-encoding. MP4, MKV, TS etc etc are "container" formats - methods for multiplexing multiple data streams into one delivery stream. The individual data streams are the video, audio, subtitle, alternative language audio, etc etc. Video may be encoded in a number of ways (MPG, H.264...), audio may be encoded in a number of ways (PCM, MP2, MP3, AAC...). So, to be compatible with any particular player, the container format has to be compatible
and the video and audio streams have to be compatible.
If the video and audio streams are compatible but the container is not, the best solution is to simply re-multiplex the existing video and audio streams into a compatible container. The next best is to keep an existing video stream and re-encode the audio stream. If you are obliged to re-encode the video stream as well, expect a loss of quality in inverse proportion to the time the re-encoding takes.
The HDR-FOX can play a variety of formats - see:
Index (click) >> Miscellaneous >> Video File Support & Manipulation >> Codec Support
General discussions about video format conversion etc (ie, subjects not specific to HDR-FOX even if they have application to it) have their own forum section here:
https://hummy.tv/forum/forums/audio-video-file-manipulation.48/