If your file won't play and the TV reports "Invalid file", the thumbnail is not created instead a one with a warning arrow, then your TV won't eat the file. Since this post gets a lot of hits and is easily found, I've updated the information a bit.

The problem is likely one of these issues:
1. unsupported video format (check the supported list, e.g. LG)
- especially note the restriction of 30 fps for FullHD
- video codecs are usually divx and h264 (up to profile 4.1), no GMC
- audio codecs are usually mp3, ac3, aac.
2. Badly muxed file or unsupported file type
3. Mkv with header compression
Your options are reencoding (1.), which is slow but can always be set up in a way that fixes things or remuxing (2.) which is extremely fast but can only fix some problems, as the codecs and their settings must already be supported by your setup.1. Reencoding1.a. ffmpeg (old style):
ffmpeg -i Oldfile.mp4 -vcodec libx264 -vpre normal -r 25 -crf 23 -ab 384k -acodec ac3 Working.mkv

For really old software and systems you may want to decrease the level e.g. to 2.0 or 1.0 and add -pix_fmt yuv420p lower the maxrate. In case of sound issues, you may want to reencode the sound as well.

Extra tip: Only encode a few seconds in each variant, then cancel, then try to play the files and just completely transform the file with the method that works.

If you like this post, share it and subscribe to the RSS feed so you don't miss the next one. In any case, check the related posts section below. (Because maybe I'm just having a really bad day and normally I write much more interesting articles about theses subjects! Or maybe you'll only understand what I meant here once you've read all my other posts on the topic. ;) )