LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Subtitle encoding MEncoder (https://www.linuxquestions.org/questions/linux-software-2/subtitle-encoding-mencoder-501902/)

h4m574h 11-15-2006 12:59 PM

Subtitle encoding MEncoder
 
Hello!

I was searching for a solution to "hard-sub" my subtitles to an avi file. I found a great solution in MEncoder and the code which I found on this forums.

The code goes like this:

mencoder -vop pp=de,scale=548:222 -oac copy -ovc lavc -lavcopts keyint=25:vcodec=mpeg4:vbitrate=679:vpass=1 -sub "Domino.srt" -o "Domino_with_subs.avi" "Domino.avi"

Almost everything works great, except the fact that my .srt subs are in Central-European encoding (ISO-8859-2), but MEncoder replaces CE-specific characters into strange symbols. Is there any way to fix this or am I forced to find another solution for hard-subbing my avis?

babis85 11-30-2006 12:16 PM

Quote:

Originally Posted by h4m574h
Hello!

I was searching for a solution to "hard-sub" my subtitles to an avi file. I found a great solution in MEncoder and the code which I found on this forums.

The code goes like this:

mencoder -vop pp=de,scale=548:222 -oac copy -ovc lavc -lavcopts keyint=25:vcodec=mpeg4:vbitrate=679:vpass=1 -sub "Domino.srt" -o "Domino_with_subs.avi" "Domino.avi"

Almost everything works great, except the fact that my .srt subs are in Central-European encoding (ISO-8859-2), but MEncoder replaces CE-specific characters into strange symbols. Is there any way to fix this or am I forced to find another solution for hard-subbing my avis?

Hello, there is an option to specify your encoding of your liking.
Try adding "-subcp ISO-8859-2" on the above command.

Actually, i found your post searching for a solution to my problem. I want to do the same thing but using iso-8859-7. The solution i said above doesn't solve my problem, it might do it to yours. Please tell me the results.

Ah, there is also another option with which you mencoder tries to find out the encoding of the .srt file by your country. You have to know the initial characters of your country. For example, i would use "-subcp enca:gr:iso-8859-7", because i live in greece (so the subtitles are in greek) and if mencoder fail to guess it the right encoding it comes back to the encoding you specified next to your country.

Hope it is helpfull.

And if anyone knows anything about my case please drop me a line.

h4m574h 12-01-2006 06:30 AM

Thank you for your reply, I solved my problem by abandoning MEncoder. =D I mostly did so, because my DVD player said the codec is not supported. But I guess I'll try just for the sake of it =D

I was finaly able to install Avidemux and now I use Avidemux+Subtitle filter and xvid4 encoding. You can try that, maybe it would help - just remember to set subtitle plugin to UTF-8 and when previewing the video choose "Preview in new window", else the subtitle filter won't take effect.

Hope my experience helps.

babis85 12-01-2006 07:18 AM

Thank you, i have already used Avidemux, but with the same results. The subtitles are displayed wrong.Specifically i want ISO-8859-7, but in avidemux there is no such option.

h4m574h 12-02-2006 04:16 AM

I guess I dunnoe than.

Well there was another thing. When I downloaded subtitles they were in wrong ISO, so I had to replace every with a č, etc.

Maybe that could be the problem in your case too. I just used gedit, ctrl+f and replaced everything, saved it in UTF8 and then used subtitler. I know it's a long shot, but try it anyway.

Yes, I'm a linux n00b =D

babis85 12-02-2006 04:46 AM

I' ve even tried something similar to that idea. There is a tool, named iconv with wich you can convert a file of encoding A into encoding B. So, i convert my .srt file from ISO-8859-7 to UTF-8, the characters looked perfectly, but still the import was faulty.

Quote:

iconv -f ISO-8859-7 -t UTF-8 SubInISO88597.srt --output SubInUTF8.srt

xmanwe 10-10-2008 04:23 PM

Quote:

Originally Posted by babis85 (Post 2527155)
I' ve even tried something similar to that idea. There is a tool, named iconv with wich you can convert a file of encoding A into encoding B. So, i convert my .srt file from ISO-8859-7 to UTF-8, the characters looked perfectly, but still the import was faulty.

hm, i am doing iconv -f UTF-8 -t WINDOWS-1250 title1.srt -o title2.srt and i get iconv: illegal input sequence at position 37
How can i covert encoding of my subtitles? what's wrong?

alecz20 10-16-2009 11:36 PM

Quote:

Originally Posted by h4m574h (Post 2525773)
Thank you for your reply, I solved my problem by abandoning MEncoder. =D I mostly did so, because my DVD player said the codec is not supported....

You can try:

Code:

mencoder -oac copy -ovc xvid -xvidencopts fixed_quant=3 -sub "Domino.srt" -o "Domino_with_subs.avi" "Domino.avi"
To encode in xvid. This should work with your player. A lower fixed_quant will produce a larger file with potentially better quality.


All times are GMT -5. The time now is 05:42 PM.