Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hello, I've just installed Mplayer and it's all running very nicely, I can do pretty much everything I need except display downloaded Japanese subtitle files. English subtitle files work just ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2004
    Location
    Japan
    Posts
    5

    Mplayer Japanese subtitles


    Hello,

    I've just installed Mplayer and it's all running very nicely, I can do pretty much everything I need except display downloaded Japanese subtitle files. English subtitle files work just fine with -sub , but Japanese subtitles appear corrupt (like they do when you try to view Japanese web pages if you don't have Japanese subtitles installed or have your encoding set wrong).

    I have no problems viewing Japanese file formas in any other applications (Mozilla, Open Office etc.). I'm running Fedora Core 2 with Japanese language support enabled on installation.

    Running a DVD which already has Japanese subtitles built-in also works just fine. But most American DVDs dont have Japanese subtitles

    Anybody know what I'm missing here?

    (Ooh, just read the "Asking good questions" forum, I've tried reading through the documentation, searching the web and spending a huge ammount of time trying to find out the answer to this one, but I'm going round and round in circles and my head is beginning to hurt. )

    Thanks!

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Well, the thing with MPlayer is that it uses its completely own font set, internationalization functions, encoding functions and everything. I think it's hardly integrated with the rest of the system at all.

    You would first of all need a Japanese MPlayer font to do that. I just looked over at mplayerhq.hu, and they don't seem to provide such a thing. In the MPlayer source distribution, however, there is a font creation program, but it's been ages since I last used it.

    The reason it works with DVDs is probably because, at least as far as I know, DVDs don't make the movie player render the subtitle text. I think it contains a video overlay for subtitles or something like that. I'm not exactly sure how it works.

    Could you provide a link to a Japanese subtitle file, so that I may have a look at it (what encoding it uses, and see if I can make it work on my system)? Also, what charset encoding is your FC2 installation set to use (check "echo $LANG")?

    One last question: In just what way do the subtitles appear garbled? Would it be possible for you to post a screenshot?

  3. #3
    Just Joined!
    Join Date
    Jun 2004
    Location
    Japan
    Posts
    5
    Thanks for the quick response. I'll post details when I get home from work later.

  4. #4
    Just Joined!
    Join Date
    Jun 2004
    Location
    Japan
    Posts
    5
    Here's the subtitles I'm using, I can read them just fine in Open Office. (They seem to be timed for some VCD version, not the DVD release so kick in a bit late)

    http://divxstation.com/dl/subtitles/20776.srt

  5. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    This seems to be a tricky one. I've done some initial experiments, and I got some encouraging results, mixed with some discouraging ones.

    When converted that subfile from Shift-JIS to UTF-8 (using iconv) and started mplayer with "-fontconfig -font 'Kochi Mincho'", it seems to be able to read and recognize the Japanese characters. However, it doesn't render them. It still just renders the characters in the Latin1 area. I don't know yet what font renderer library it uses in conjunction with fontconfig, though. Those were just initial results. I'll continue my research. =)

  6. #6
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Yes! I got it to work. I have to say, this was very good for me too, I learned a lot about MPlayer. It seems that MPlayer, uninternationalized as it is, naively assumes that subfiles are encoded with iso-8859-1, instead of, as the more logical assumption would be, your local charset on the system. However, that's manually settable with the -subcp option. Thus, the following command line worked for me:
    Code:
    mplayer -fontconfig -font 'Kochi Mincho' -sub ~/20778.srt -subcp shift-jis moviefile.avi
    Of course, you're free to replace Kochi Mincho with whatever font you prefer, but I have to say that the subtitles were beautifully rendered with that font. I really like Kochi Mincho for Japanese characters. =)

    I don't know if your MPlayer version is compiled with freetype and fontconfig support, of course, but I guess there's only one way for you to find out. ;-)

  7. #7
    Just Joined!
    Join Date
    Jun 2004
    Location
    Japan
    Posts
    5
    Excellent! Thank you so much. Mplayer really is quite fun to play with isn't it? But this one really had me stumped. Gonna have to study more...

    Now to invite all my friends round for a Return of the King party (not released locally until mid August sometime).

  8. #8
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Well, I have to admit I don't really like MPlayer that much. It's too monolithic for my taste. However, it is undisputably the most mature, fast and stable movie player there is for Linux right now, but I long for the day that gstreamer reaches that point. Much better architecture there.

  9. #9
    Just Joined!
    Join Date
    Jun 2004
    Location
    Japan
    Posts
    5
    Hmm. Mplayer wasn't compiled with Fontconfig support. This is what comes of skipping the complicated bits and installing with rpm files I guess...
    Is there an easy way to enable it? I've searched the documentation but it doesn't seem to be all that handy. (the only references to fontconfig beign "If Mplayer isn't installed with Fontconfig support then...).

  10. #10
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Well, if the RPM you got doesn't have compiled-in fontconfig support, then all you can do is recompile it from source. The configure script should automatically detect that you have fontconfig and freetype support on your system.

    However, make sure that you have the development files for fontconfig and freetype installed. As you may or may not know, most distros only install the neccessary runtime files for libraries, which isn't enough to compile programs that use them. In Fedora Core 2, these packages are called fontconfig-devel and freetype-devel.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •