I got here because I got fed up looking at "Audio: Unknown" for all my .avi and other files for which language tagging is impossible.
Remuxing non-mkv files into mkvs seems to be the only solution proposed here.
Unfortunately for various reasons I can't do that, so I looked at alternatives.
First I tried to be clever and made my own MediaInfo.dll.
Plex asks for "Language/String3" for each stream; I changed MediaInfo.dll so that if the returned string would have been empty, we returned "eng" instead.
This didn't work. Looking at the Media Scanner Log Files, Plex first runs MediaInfo and then runs its own internal FFmpeg, which takes priority. (This internal FFmpeg will of course return a language of "".)
After further faffing around, I finally found where the language is stored in the database - with a bash script and sqlite installed, it is possible to change every stream whose language is undefined to English (or whatever.)
I use cygwin on a PC, so this is what I did. Note that Plex should not be running when you execute this as Plex will have the database open.
cd '/cygdrive/c/Users/YOURNAMEHERE/AppData/Local/Plex Media Server/Plug-in Support/Databases'
echo 'select id from media_streams where language="";' | sqlite3 com.plexapp.plugins.library.db | while read id
do
echo $id
echo 'UPDATE media_streams SET language="eng" WHERE id='$id ';' | sqlite3 com.plexapp.plugins.library.db
done
Total sqlite n00b here, probably better ways of doing this, but hey, it works for me :-)
EDIT: Having shelled out for a PlexPass, the first thing I do is download the
newer Media Server. Which appears to use a completely different database format, so different in fact that sqlite3 says "WTF"? Oh well, back to the drawing board :-)
EDIT2: Turns out the cygwin-supplied sqlite3 is ancient. I grabbed a more up-to-date binary of sqlite3 from the Android SDK.
EDIT3: I have PMS running on a Linux box now. I run this script every so often (cron.daily) or explicitly after I add media.
#!/bin/sh
# Dopey script to change "Unknown" languages to "English" for Plex.
#
PLEXDBDIR="/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
if [ -d "${PLEXDBDIR}" ]; then
cd "${PLEXDBDIR}"
echo 'select id from media_streams where language="";' | sqlite3 com.plexapp.plugins.library.db | while read id
do
echo $id
echo 'UPDATE media_streams SET language="eng" WHERE id='$id ';' | sqlite3 com.plexapp.plugins.library.db
done
exit 0
else
echo "### Plex Database dir not found"
exit -1
fi