Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 179889 - totem, kaffeine, mplayer: non-8bit scrambled text in subtitles
Summary: totem, kaffeine, mplayer: non-8bit scrambled text in subtitles
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-26 14:28 UTC by Anton Kuzmin
Modified: 2009-08-03 22:29 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
the text is in utf-8 (Screenshot-anton@localhost:-mnt-sda8.png,39.79 KB, image/png)
2007-05-26 14:30 UTC, Anton Kuzmin
Details
totem preferences - utf8 (Screenshot-Preferences.png,23.16 KB, image/png)
2007-05-26 14:30 UTC, Anton Kuzmin
Details
charmap utility screenshot (Screenshot-Character Map.png,43.36 KB, image/png)
2007-05-27 10:17 UTC, Anton Kuzmin
Details
totem screenshot (Screenshot-Jibeuro.avi.png,156.32 KB, image/png)
2007-05-27 10:44 UTC, Anton Kuzmin
Details
-fontconfig (Screenshot-MPlayer.png,491.19 KB, image/png)
2007-05-27 12:24 UTC, Anton Kuzmin
Details
-font 'Tahoma' (Screenshot-MPlayer-1.png,482.79 KB, image/png)
2007-05-27 12:25 UTC, Anton Kuzmin
Details
.fonts.conf (.fonts.conf,514 bytes, text/plain)
2007-05-27 12:27 UTC, Anton Kuzmin
Details
/etc/fonts/fonts.conf (fonts.conf,5.11 KB, text/plain)
2007-05-27 12:27 UTC, Anton Kuzmin
Details
text file with subtitles (Jibeuro.srt,28.68 KB, text/plain)
2007-05-27 13:18 UTC, Anton Kuzmin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Kuzmin 2007-05-26 14:28:26 UTC
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
Comment 1 Anton Kuzmin 2007-05-26 14:30:25 UTC
Created attachment 120376 [details]
the text is in utf-8
Comment 2 Anton Kuzmin 2007-05-26 14:30:58 UTC
Created attachment 120377 [details]
totem preferences - utf8
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-05-26 14:40:54 UTC
(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.
Comment 4 Anton Kuzmin 2007-05-26 14:47:32 UTC
The font is not broken. It displays Cyrillic text in other applications. See the attachments.
Comment 5 Reimar Döffinger 2007-05-27 09:26:56 UTC
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.
Comment 6 Anton Kuzmin 2007-05-27 10:17:32 UTC
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 :-)
Comment 7 Anton Kuzmin 2007-05-27 10:44:32 UTC
Created attachment 120427 [details]
totem screenshot
Comment 8 Reimar Döffinger 2007-05-27 11:57:19 UTC
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)?
Comment 9 Anton Kuzmin 2007-05-27 12:23:50 UTC
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.
Comment 10 Anton Kuzmin 2007-05-27 12:24:55 UTC
Created attachment 120429 [details]
-fontconfig
Comment 11 Anton Kuzmin 2007-05-27 12:25:17 UTC
Created attachment 120431 [details]
-font 'Tahoma'
Comment 12 Anton Kuzmin 2007-05-27 12:27:38 UTC
Created attachment 120433 [details]
.fonts.conf
Comment 13 Anton Kuzmin 2007-05-27 12:27:57 UTC
Created attachment 120434 [details]
/etc/fonts/fonts.conf
Comment 14 Reimar Döffinger 2007-05-27 13:02:23 UTC
-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.
Comment 15 Anton Kuzmin 2007-05-27 13:17:42 UTC
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)
Comment 16 Anton Kuzmin 2007-05-27 13:18:21 UTC
Created attachment 120439 [details]
text file with subtitles
Comment 17 Dan Andresan 2007-06-30 18:03:45 UTC
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.
Comment 18 Reimar Döffinger 2007-06-30 20:10:28 UTC
I think fontconfig was made default around this time, maybe you could check putting fontconfig=no into your MPlayer configuration?
Comment 19 Anton Kuzmin 2007-07-05 08:37:15 UTC
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.
Comment 20 Samuli Suominen (RETIRED) gentoo-dev 2009-08-03 22:29:30 UTC
Old bug. Try with up to date system and latest mplayer snapshot (20090731) and reopen if this is still a issue