An .srt file is encoded as utf8 file (also tried cp1251, koi8-r). The subtitles are in Russian. Instead of the text I see squares. The same problem is in kaffeine and mplayer. A couple or more months ago the subtitles were OK. Reproducible: Always Portage 2.1.2.7 (default-linux/amd64/2006.1, gcc-4.1.2, glibc-2.4-r4, 2.6.20-suspend2-r5 x86_64) ================================================================= System uname: 2.6.20-suspend2-r5 x86_64 AMD Turion(tm) 64 Mobile Technology MT-32 Gentoo Base System release 1.12.10 Timestamp of tree: Sat, 26 May 2007 09:30:01 +0000 dev-java/java-config: 1.3.7, 2.0.32 dev-lang/python: 2.4.4 dev-python/pycrypto: 2.0.1-r5 sys-apps/sandbox: 1.2.17, 1.2.18.1 sys-devel/autoconf: 2.13, 2.60, 2.61 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.16.1-r3, 2.17 sys-devel/gcc-config: 1.3.13-r4, 1.3.16 sys-devel/libtool: 1.5.22, 1.5.23b virtual/os-headers: 2.6.20-r2 ACCEPT_KEYWORDS="amd64 ~amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=athlon64 -msse3 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-O2 -march=athlon64 -msse3 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="ftp://gentoo.cites.uiuc.edu/pub/gentoo/ http://gentoo.cites.uiuc.edu/pub/gentoo/ ftp://ftp.nyx.hu/gentoo" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X a52 aac acpi alsa amd64 apache2 aspnet2 audiofile bitmap-fonts blender-game bluetooth bzip2 cairo cdr cli contentcache cracklib crypt dbus disassembler djvu dv dvb dvd dvdr dvdread dvi encode examples exif fat ffmpeg firefox flac fuse gd gdbm gif glibc-omitfp glitz gnome gpm gstreamer gtk hal howl iconv imagemagick immqt isdnlog java java5 javascript jpeg jpeg2k kde kdeenablefinal kdehiddenvisibility lame libg++ libnotify mad midi mikmod mjpeg mng mp3 mpeg mplayer mudflap music musicbrainz mysql nautilus ncurses nforce2 nls nptl nptlonly nsplugin ntfs nvidia offensive ogg opengl openmp pam pcre pdf pdo php plotutils plugins pmu png postgres ppds pppd python qt3 quicktime readline reflection reiserfs ruby sdl session sharedmem sndfile socks5 spell spl sqlite ssl startup-notification streamripper subtitles subversion svg tagwriting tcpd theora tidy truetype truetype-fonts type1-fonts unicode urandom usb vcd vorbis xcomposite xforms xfs xine xml xorg xv xvid zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa vmware" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Created attachment 120376 [details] the text is in utf-8
Created attachment 120377 [details] totem preferences - utf8
(In reply to comment #0) > An .srt file is encoded as utf8 file (also tried cp1251, koi8-r). The subtitles > are in Russian. > > Instead of the text I see squares. Eh; if the text is broken no matter what encoding you use, then you should find yourself a non-broken font.
The font is not broken. It displays Cyrillic text in other applications. See the attachments.
Are you sure the other applications don't just take the Cyrillic characters from some other font? All KDE applications at least behave like that. Try using e.g. kcharselect to find out which characters that font actually contains.
Created attachment 120425 [details] charmap utility screenshot See, Cyrillic. I also tried Trebuchet MS, which I use in mozilla firefox quite a lot. I know the difference between some crappy fonts and these :-)
Created attachment 120427 [details] totem screenshot
At least on my system there is something weird going on, gucharmap claims Trebuchet MS has unicode character 0x400 and 0x40D whereas kcharselect claims it does not. Did you try playing the file with mplayer from command line? Tried using -fontconfig and different values for -subcp and -subfont-encoding (though normall you shouldn't need to set -subfont-encoding)?
Yes, it's in my gentoo, too. Anyway, Russian doesn't have such letters as 0x400 and 0x40D. I think I have found something interesting. I tried starting mplayer from the command line like you said. $ mplayer -fontconfig Jibeuro.avi -sub Jibeuro.srt -subcp UTF-8 -subfont-encoding unicode -unicode Jibeuro.avi With all kinds of variations all I got was underscore characters instead of normal characters and punctuation marks .?!, were displayed normally. When I changed -fontconfig to -font 'Tahoma' it worked! The subtitled were displayed correctly! See the attached files.
Created attachment 120429 [details] -fontconfig
Created attachment 120431 [details] -font 'Tahoma'
Created attachment 120433 [details] .fonts.conf
Created attachment 120434 [details] /etc/fonts/fonts.conf
-font 'Tahoma' should not work right if -fontconfig is not enabled, since then it expects the path to a ttf file... And in my tests -font only makes a difference if 1) I specify the path to a ttf file or 2) I use -fontconfig in addition. Otherwise it falls back to the default font, e.g. ~/.mplayer/subfont.ttf. I am a bit surprised that I have to use -subcp utf8, I thought that would have been made default by now. I also thought that -fontconfig was supposed to try to get missing characters from other fonts, but it seems that is not the case either. Overall I am convinced that the problem is that MPlayer does not like something about your font. Not sure what exactly though.
There's no ~/.mplayer/subfont.ttf in my system. I also used other fonts(Candara, Trebuchet MS, Arial) and they all looked like themselves. I'm going to include .srt file... # equery b /usr/bin/mplayer [ Searching for file(s) /usr/bin/mplayer in *... ] media-video/mplayer-1.0.20070427 (/usr/bin/mplayer) $ mplayer -font 'Tahoma' Jibeuro.avi -sub Jibeuro.srt -subcp UTF-8 -subfont-encoding unicode -unicode Jibeuro.avi MPlayer dev-SVN-rUNKNOWN-4.1.2 (C) 2000-2007 MPlayer Team CPU: AMD Turion(tm) 64 Mobile Technology MT-32 (Family: 15, Model: 36, Stepping: 2) 3DNowExt supported but disabled CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 0 SSE: 1 SSE2: 1 Compiled for x86 CPU with extensions: MMX MMX2 3DNow SSE SSE2 Playing Jibeuro.avi. AVI file format detected. [aviheader] Video stream found, -vid 0 [aviheader] Audio stream found, -aid 1 VIDEO: [DIV3] 640x352 24bpp 23.976 fps 954.3 kbps (116.5 kbyte/s) Clip info: Software: Nandub v1.0rc2 Name: The way home Subject: The way home Artist: postx Copyright: Comments: SUB: Detected subtitle file format: subviewer SUB: Read 374 subtitles. SUB: Added subtitle file (1): Jibeuro.srt SUB: Detected subtitle file format: subviewer SUB: Read 374 subtitles. SUB: Added subtitle file (2): ./Jibeuro.srt ========================================================================== Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Selected video codec: [ffdivx] vfm: ffmpeg (FFmpeg DivX ;-) (MS MPEG-4 v3)) ========================================================================== ========================================================================== Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000) Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3) ========================================================================== AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample) Starting playback... VDec: vo config request - 640 x 352 (preferred colorspace: Planar YV12) VDec: using Planar YV12 as output csp (no 0) Movie-Aspect is undefined - no prescaling applied. VO: [xv] 640x352 => 640x352 Planar YV12 A: 185.1 V: 185.1 A-V: 0.015 ct: 0.117 4438/4438 4% 0% 1.0% 0 0 ===== PAUSE ===== Exiting... (Quit)
Created attachment 120439 [details] text file with subtitles
Anton, try with mplayer 1.0.20070321 I was running with this version and everything was OK with romanian fonts (latin2, iso8859-2) When mplayer 1.0.20070622-r1 became stable, I hit similar problems with what you described (square boxes, or underlines instead of some diacritics). Furthermore, the font was not right, I have set it to be Serif type, and it looked like Sans. Reverting back to the previous stable version, no problems at all, font is Serif kind with romanian characters. There *is* a problem. I can test with intermediate unstable versions and see when it was introduced. If you use the version which works for me, does it work for you? Can you test? Thanks, Dan.
I think fontconfig was made default around this time, maybe you could check putting fontconfig=no into your MPlayer configuration?
media-video/mplayer-1.0.20070622-r1: Can't view subtitles even with my old trick: $ mplayer Jibeuro.avi -font Tahoma -subcp UTF-8 -subfont-encoding unicode -unicode Supplying the full path to the font doesn't help either. Output: VO: [xv] 640x352 => 640x352 Planar YV12 New_Face failed. Maybe the font path is wrong. Please supply the text font file (~/.mplayer/subfont.ttf). media-video/mplayer-1.0.20070321: My old trick worked. Putting fontconfig=no in ~/.mplayer/config turned off subtitles completely. Setting LINGUAS="ru" didn't help either.
Old bug. Try with up to date system and latest mplayer snapshot (20090731) and reopen if this is still a issue