I have a Chromecast that I use to stream video from my laptop to our TV. It works great, however, until VLC (Videolan) releases their promised upgrade with Chromecase support, I am limited to streaming files in the mp4 format. Fortunately, ffmpeg allows me to convert other formats to mp4. Unfortunately, figuring out what parameters to use can be daunting. So far I have determined the commands to use to convert avi, flv and mkv. The last two are a simple repackaging of the contents (takes but a few seconds). The first, avi, requires a complete recoding. The following commands perform the conversion to mp4 with no loss in quality.
ffmpeg -y -i in.avi -c:v libx264 -crf 17 -preset slow -c:a aac -strict -2 -b:a 192k -ac 2 out.mp4 ffmpeg -y -i in.flv -vcodec copy -acodec copy out.mp4 ffmpeg -y -i in.mkv -vcodec copy -acodec copy out.mp4
But who wants to have to remember all that and type it in every time. That's why I coded up some vbscript to do it for me. It can be run from the command line (supports wild cards), or you can drag and drop a file onto a shortcut to the script. Copy the code and save it in a file with a name like ConvertVideo.vbs. Before running it you should do the following (only necessary to do this once)
Open a command shell as Administrator and type
cscript //nologo //h:cscript //s
This sets cscript.exe as the default script engine. If you don't do this then you will get a MSGBOX popup window for every console write.
It should be simple to add converters for other file formats. Just add another cmds entry with the correct command line options and modify the helpinfo text. If you figure out extra formats please post the command line here.