SUB: Could not determine file format

This is a wiki page. Be bold and improve it!

If you have any questions about the content on this page, don't hesitate to open a new ticket and we'll do our best to assist you.

Symptoms

Sometimes, mplayer won't recognize the format of a subtitle file.
In the console, it may be displayed:

SUB: Could not determine file format
Cannot load subtitles subtitle_file.srt.

Causes and solutions

Wrong encoding

For example the .srt file is encoded in UTF-16 when the system expects UTF-8.

A simple way to test the validity of the file encoding, is to do:

$ cat -t subtitle_file.srt

If you get some garbage output like:
^@8^@9^@3^@
^@0^@2^@:^@2^@0^@:^@4^@3^@,^@9^@5^@0^@ ^@-^@-^@>^@ ^@0^@2^@:^@2^@0^@:^@4^@7^@,^@1^@5^@0^@
^@T^@h^@e^@r^@e^@ ^@w^@a^@s^@ ^@a^@ ^@b^@a^@r^@b^@e^@d^@ ^@w^@i^@r^@e^@
^@a^@n^@d^@ ^@t^@h^@i^@s^@ ^@G^@e^@r^@m^@a^@n^@ ^@c^@a^@m^@e^@ ^@u^@p^@ ^@t^@o^@ ^@m^@e^@.^@
^@
^@8^@9^@4^@
^@0^@2^@:^@2^@0^@:^@4^@8^@,^@6^@4^@0^@ ^@-^@-^@>^@ ^@0^@2^@:^@2^@0^@:^@5^@2^@,^@1^@6^@0^@
^@-^@ ^@Y^@o^@u^@ ^@d^@i^@d^@n^@'^@t^@ ^@c^@a^@t^@c^@h^@ ^@h^@i^@s^@ ^@n^@a^@m^@e^@?^@
^@-^@ ^@N^@o^@.^@
^@

then you know this is the problem.

The solution is to properly re-encode the file:

iconv -f UTF-16 -t UTF-8 subtitle_file.srt > subtitle_file_fixed.srt

Wrong format

Issues related to this page:

ProjectSummaryStatusPriorityCategoryLast updatedAssigned to
Linux softwareextracting subtitles from mkv fileactivenormalsupport request8 years 1 week