Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Burning subtitle on video with foreign letters

  1. #1
    Join Date
    May 2010
    Location
    Tehran - Iran
    Beans
    198
    Distro
    Ubuntu 12.04 Precise Pangolin

    Burning subtitle on video with foreign letters

    Hi,
    I wanna burn an Italian Subtitle on a video, Currently I use this line code:
    Code:
    mencoder movie.avi -sub movie.srt -subfont-text-scale 6 -o movie.hardsubs.avi -oac copy -ovc lavc -lavcopts vbitrate=1200
    But Italian letters Like (è,ì,ù, ...) show as "??".
    what can I do?
    Tnx alot.
    We Can.

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,804
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Burning subtitle on video with foreign letters

    You need to specify the character set that the subtitles file are encoded with. Take a look at the -subcp option to mencoder. The file might be in UTF-8, for instance, while mencoder is expecting something like ISO-8859-1.

    Have you tried playing the movie with mplayer? You can play with the character set and see which one displays correctly, then use the same one with mencoder. If you install smplayer from the repositories, you can change the character set from the Options > Preferences > Subtitles screen. That's probably easier than futzing with mplayer from the command line.
    Last edited by SeijiSensei; March 30th, 2013 at 07:05 PM.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    May 2010
    Location
    Tehran - Iran
    Beans
    198
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Burning subtitle on video with foreign letters

    Thank you for helping
    I found that whit this encode: ISO-8859-3, the smplayer shows subtitle fine,
    I added this code to command "-subfont-encoding ISO-8859-3" but neither mplayer nor mencoder show any different in results
    ?!
    We Can.

  4. #4
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,804
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Burning subtitle on video with foreign letters

    Did you try "-subcp"?
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    May 2010
    Location
    Tehran - Iran
    Beans
    198
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Burning subtitle on video with foreign letters

    Quote Originally Posted by SeijiSensei View Post
    Did you try "-subcp"?
    This one helped me out
    thank u very much
    BTW is there any command that put the Subtitle on the CENTER on video instead of bottom?
    We Can.

  6. #6
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,804
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Burning subtitle on video with foreign letters

    You can use other mencoder switches to position fonts, I believe, but I, for one, would never want to watch a show with subtitles in the center. Having to read while watching is bad enough, but having the subtitles overlay much of actual image would make them incredibly annoying, at least for me. And I watch a lot of subtitled material so I'm speaking from experience here.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  7. #7
    Join Date
    Aug 2008
    Location
    Bengaluru
    Beans
    157
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Burning subtitle on video with foreign letters

    I have tried the -subcp option for a sub-title file in Indian language. The command works; but, either I see ??? or wide dashes only. What am I missing ?

    This option results in messages while encoding as 'Subtitle word '�?� ?�??�?�??�??�??� ' too long !
    mencoder movie.mp4 -sub movie_kn.srt -oac lavc -ovc lavc -o movie-subs.mp4

    Next attempt was with -subcp whose value is set to utf8 because I don't know what is the code page for Kannada language.
    mencoder movie.mp4 -sub movie_kn.srt -subcp utf8 -oac lavc -ovc lavc -o movie-subs.mp4
    The resulting file does not show sub-title but just wide white dashes. The same behavior is seen with values utf-8 or unicode. The only difference I noticed is, with unicode the message about long words is seen again.

    With -subcp enca:kn:en, the same message about long words is seen again.
    mencoder movie.mp4 -sub movie_kn.srt -subcp enca:kn:en -oac lavc -ovc lavc -o movie-subs.mp4

    With -subfont-encoding unicode, the same message about long words is seen again.
    mencoder movie.mp4 -sub movie_kn.srt -subfont-encoding unicode -oac lavc -ovc lavc -o movie-subs.mp4

    With -subfont-encoding as utf8 or utf-8, the sub-title is not seen at all.
    mencoder movie.mp4 -sub movie_kn.srt -subfont-encoding utf8 -oac lavc -ovc lavc -o movie-subs.mp4
    Debugging tip:
    When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
    --- Sherlock Holmes.

  8. #8
    Join Date
    Aug 2008
    Location
    Bengaluru
    Beans
    157
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Burning subtitle on video with foreign letters

    I came across this archived post which refers to providing path to a TTF font file. I used it for my case; the problem with dashes/lines still exist.

    mencoder movie.mp4 -sub movie_kn.srt -subcp utf8 -font /usr/share/fonts/truetype/ttf-kannada-fonts/lohit_kn.ttf -oac lavc -ovc lavc -of mpeg -o movie-subs.mp4
    Debugging tip:
    When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
    --- Sherlock Holmes.

  9. #9
    Join Date
    Sep 2006
    Beans
    3,489

    Re: Burning subtitle on video with foreign letters

    Does ffmpeg have the same issue? You'll have to get the real ffmpeg because the fake one in the repo does not have this feature.

    1. Download and extract (if this example does not work then just get it via the FFmpeg Download page):
    Code:
    wget http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.$(date +"%F").tar.gz
    tar xzvf ffmpeg.static.32bit.$(date +"%F").tar.gz
    2. Then run it (notice the ./ before ffmpeg):
    Code:
    ./ffmpeg -i movie.mp4 -vf subtitles=movie_kn.srt -codec:v libx264 -crf 23 -preset medium -codec:a copy movie-subs.mp4
    Also see:

  10. #10
    Join Date
    Aug 2008
    Location
    Bengaluru
    Beans
    157
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Burning subtitle on video with foreign letters

    Thanks for the response.
    This seems to be right version of the ffmpeg command.
    ffmpeg -i movie.mp4 -scodec movie_kn.srt -vcodec libx264 -crf 23 -preset medium -acodec copy movie-subs.mp4

    The version of ffmpeg used is :
    ffmpeg version 0.8.9-4:0.8.9-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers
    built on Nov 9 2013 19:08:00 with gcc 4.6.3


    The resulting video has no subtitles at all. I am trying other options now.

    BTW, ffmpeg is supposed to be deprecated soon and avconv is expected to be the replacement. Have you worked with avconv too ?
    Debugging tip:
    When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
    --- Sherlock Holmes.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

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