Srt Subtitle problem in HandBrake Software

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
Bronx
Posts: 4
Joined: Sat Apr 17, 2010 8:40 pm

Srt Subtitle problem in HandBrake Software

Post by Bronx »

I have some movie material, and a Subtitle file in .srt format for it...
When I open "VLC Player" for e.g, and play the movie with this external .srt file, all the letter characters in this Subtitle are played OK on the screen.
- I have this special diacritic characters for my Country locale also, and they are also quite interpret correctly over "VLC Player", and over any similar multimedia player...

But, because one reason (disregard why), I want to attach this particular Subtitle file (not as .mkv...), permanently to this movie material, and I want to do that with "HandBrake".
But, when I do that, I do not know which Subtitles "Char Code" to pick it up, for this Subtitle file of mine, because, I really get the movie material after "HandBrake" operation quiet OK,
with the Subtitle file really attach on the movie it self, but it still misses, some diacritic letters, important for my country, later when "HandBrake" finish its job with attaching the
Subtitle to a movie file, and when I try, again to play this file via "VLC Player", for e.g.
- It is not the "VLC Player" problemo all here, because he is setup correctly, an again, he plays before this diacritic letters special for my country, without any problem...

Then I try, at least 10 different settings for the "HandBrake" Subtitles "Char Code", but I always get, not 100% percent accurate diacritic characters for my Country locale
- some of them are still missing, or they are interpreted as totally some wrong characters.


I believe that "HandBrake" Power users has already know this particular "foreigner" problem, but, I will try, once more, to explain more better,
my Croatian language has special, 5 diacritic letters (5 big letters, and 5 small letters of them), some of them contains normally, a so-called:
a) "caron/inverted circumflex = ˇ ",
b) and some of them contains "acute accent/apex = ´ ".

-> For so-called "diacritic letters" in general, please see via Wikipedia or similar...

I probably can't type this special diacritic letters of mine exactly here, because, maybe this Forum writing limitation, so, this is the best as I can explain..., but I will try to type it here:
"HandBrake", after attaching the Subtitle .srt file on the movie it self, do not exactly interpret (just put empty space), or do not correctly interpret (just input totally wrong letter)
this diacritic letters of mine, special for my Country, Croatia: Š, š; Đ, đ; Č, č; Ć, ć; Ž, ž.

I put my ".srt Subtitle" file, thru "HandBrake" "Subtitle" window, and setup the "Srt language" as "Hrvatski" (-> means "Croatian"),
but, I just do not know which "Char Code" to put exactly, to finally get above mentioned Diacritic letters to work really successful after "HandBrake" is finish with its job...?


~ At the very end, great thanks in advance to anybody wish to help all here!
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Srt Subtitle problem in HandBrake Software

Post by JohnAStebbins »

It would help if you told us what you tried. But the most common char code used for languages with special characters is "UTF-8". "UTF-16", then "ISO-8859-2" would be my next guesses.
Bronx
Posts: 4
Joined: Sat Apr 17, 2010 8:40 pm

Re: Srt Subtitle problem in HandBrake Software

Post by Bronx »

Thank You for your kindest reply!

My apologize, I at least test 10 different of them... The problem is that I didn't make a note which one... :mrgreen:
Do not ask..., normally I am much smarter than I was this particular time... :mrgreen:

- I remember, I already try ASCII, I also try ISO-8859-1, ISO-8859-2, ISO-8859-3 , ISO-8859-4, ISO-8859-9, UTF-8...

I will definitively try all your suggestions, and post later the result.
But that will not be probably till tomorrow...

In any case, also, if I discover at the very end, the bingo solution, I will post all here that result for others! :)
Bronx
Posts: 4
Joined: Sat Apr 17, 2010 8:40 pm

Re: Srt Subtitle problem in HandBrake Software

Post by Bronx »

Well, in last 3 days, I make this movie + subtitle of mine, with any available Char Codes in the HandBrake Software it self.
I was still, not be able to fix my diacritic letters problem... :(

Well, I am a beginner on this Forum, so, I apologize in advanced, if I did not make something OK here,
I will attach requested right now... I'll hope that now is OK...
And, I also post, even a picture here, since the picture in generally, can talk a thousand words, and help of course...:

Image

Image


Code: Select all

### CLI Query:  -i "C:\John Doe\John Doe Movie.mkv" -t 1 -c 1 -o "C:\John Doe\John Doe Movie + Subtitles.mp4" -f mp4 -4  --strict-anamorphic  -e x264 -q 20 -a 1 -E faac -6 dpl2 -R 48 -B 160 -D 0.0 --srt-file "C:\John Doe\John Doe Movie.srt" --srt-codeset UTF-8 --srt-offset 0 --srt-lang eng --srt-default=1 -x ref=2:bframes=2:subq=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0 -v 1

### User Query: False

#########################################

[04:13:32] hb_init: checking cpu count
[04:13:32] hb_init: starting libhb thread
HandBrake 0.9.4 (2009112300) - MinGW i386 - http://handbrake.fr
2 CPUs detected
Opening C:\John Doe\John Doe Movie.mkv...
[04:13:32] hb_scan: path=C:\John Doe\John Doe Movie.mkv, title_index=1
[04:13:32] scan: trying to open with libdvdread
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[04:13:32] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska, from 'C:\John Doe\John Doe Movie.mkv':
  Duration: 01:40:42.91, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mpeg4, yuv420p, 640x272 [PAR 1:1 DAR 40:17], 23.98 tbr, 1k tbn, 23.98 tbc
    Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16
[04:13:32] scan: decoding previews for title 1
[04:13:32] scan: 10 previews, 640x272, 23.976 fps, autocrop = 0/0/0/0, aspect 2.35:1, PAR 1:1
[04:13:32] scan: title (0) job->width:640, job->height:272
[04:13:32] libhb: scan thread found 1 valid title(s)
+ title 1:
  + vts 0, ttn 0, cells 0->0 (0 blocks)
  + angle(s) 0
  + duration: 01:40:42
  + size: 640x272, pixel aspect: 1/1, display aspect: 2.35, 23.976 fps
  + autocrop: 0/0/0/0
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 01:40:42
  + audio tracks:
    + 1, Unknown (MP3) (iso639-2: und)
  + subtitle tracks:
[04:13:32] 1 job(s) to process
[04:13:32] starting job
[04:13:32] work: sanitizing track 0 mixdown Dolby Pro Logic II to Stereo
[04:13:32] job configuration:
[04:13:32]  * source
[04:13:32]    + C:\John Doe\John Doe Movie.mkv
[04:13:32]    + title 1, chapter(s) 1 to 1
[04:13:32]    + container: matroska
[04:13:32]  * destination
[04:13:32]    + C:\John Doe\John Doe Movie + Subtitles.mp4
[04:13:32]    + container: MPEG-4 (.mp4 and .m4v)
[04:13:32]      + 64-bit formatting
[04:13:32]  * video track
[04:13:32]    + decoder: mpeg4
[04:13:32]    + frame rate: same as source (around 23.976 fps)
[04:13:32]    + strict anamorphic
[04:13:32]      + modulus: 0
[04:13:32]      + storage dimensions: 640 * 272 -> 640 * 272, crop 0/0/0/0
[04:13:32]      + pixel aspect ratio: 1 / 1
[04:13:32]      + display dimensions: 640 * 272
[04:13:32]    + encoder: x264
[04:13:32]      + options: ref=2:bframes=2:subq=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0
[04:13:32]      + quality: 20.00 (RF)
[04:13:32]  * subtitle track 0, English (id ff) Text [SRT] -> Pass-Through 
[04:13:32]  * audio track 0
[04:13:32]    + decoder: Unknown (MP3) (track 1, id 1)
[04:13:32]    + mixdown: Stereo
[04:13:32]    + encoder: faac
[04:13:32]      + bitrate: 160 kbps, samplerate: 48000 Hz
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[04:13:32] dvd: not a dvd - trying as a stream/file instead
[04:13:32] reader: first SCR 0 id 0 DTS -3780
[04:13:32] encx264: keyint-min: 24, keyint-max: 240
[04:13:32] encx264: encoding with stored aspect 1/1
[04:13:32] encx264: Encoding at constant RF 20.000000
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
x264 [info]: profile Main, level 2.1
ERROR: Invalid byte for codeset in input, discard byte
ERROR: Invalid byte for codeset in input, discard byte
ERROR: Invalid byte for codeset in input, discard byte
ERROR: Invalid byte for codeset in input, discard byte
[04:13:32] sync: expecting 144908 video frames
ERROR: Invalid byte for codeset in input, discard byte
ERROR: Invalid byte for codeset in input, discard byte
ERROR: Invalid byte for codeset in input, discard byte
ERROR: Invalid byte for codeset in input, discard byte
ERROR: Invalid byte for codeset in input, discard byte
ERROR: Invalid byte for codeset in input, discard byte
ERROR: Invalid byte for codeset in input, discard byte
ERROR: Invalid byte for codeset in input, discard byte
ERROR: Invalid byte for codeset in input, discard byte
[04:52:11] reader: done. 1 scr changes
[04:52:13] sync: got 144838 frames, 144908 expected
[04:52:13] work: average encoding speed for job is 62.390862 fps
[04:52:15] mux: track 0, 144838 frames, 417323833 bytes, 552.48 kbps, fifo 64
[04:52:15] mux: track 1, 283261 frames, 120846145 bytes, 159.98 kbps, fifo 1024
[04:52:15] mux: track 2, 961 frames, 30373 bytes, 0.04 kbps, fifo 8
[04:52:15] mpeg4-decoder done: 144839 frames, 0 decoder errors, 0 drops
[04:52:15] render: lost time: 0 (0 frames)
[04:52:15] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: frame I:1973  Avg QP:15.67  size: 18478  PSNR Mean Y:48.44 U:54.01 V:53.54 Avg:49.54 Global:48.72
x264 [info]: frame P:61549 Avg QP:19.95  size:  5047  PSNR Mean Y:44.66 U:50.84 V:50.36 Avg:45.77 Global:44.90
x264 [info]: frame B:81316 Avg QP:24.25  size:   865  PSNR Mean Y:43.99 U:51.39 V:50.91 Avg:45.20 Global:44.36
x264 [info]: consecutive B-frames:  9.4% 20.8% 69.8%
x264 [info]: mb I  I16..4: 32.2%  0.0% 67.8%
x264 [info]: mb P  I16..4:  6.5%  0.0%  7.2%  P16..4: 47.6% 15.4%  7.7%  0.0%  0.0%    skip:15.7%
x264 [info]: mb B  I16..4:  1.4%  0.0%  0.6%  B16..8: 21.8%  1.2%  0.8%  direct: 4.4%  skip:70.0%  L0:30.1% L1:47.5% BI:22.4%
x264 [info]: coded y,uvDC,uvAC intra: 51.0% 66.0% 26.8% inter: 12.7% 13.8% 1.0%
x264 [info]: i16 v,h,dc,p: 43% 26% 17% 14%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 22% 18%  5%  5%  6%  5%  5%  4%
x264 [info]: Weighted P-Frames: Y:2.4%
x264 [info]: ref P L0: 68.8% 13.6% 17.6%
x264 [info]: SSIM Mean Y:0.9881598
x264 [info]: PSNR Mean Y:44.332 U:51.195 V:50.711 Avg:45.502 Global:44.620 kb/s:552.76
[04:52:15] mp3-decoder done: 0 frames, 0 decoder errors, 0 drops
[04:52:15] libhb: work result = 0

Rip done!
HandBrake has exited.

The movie+subtitle file, after the HandBrake finish, is played quite OK (and despite this above noted: ERROR: "Invalid byte for codeset in input, discard byte") ,
just the problem with, also above mentioned Diacritic letters are still present, and it is still present, no matter which Char Code, actually I set up for mine
Croatian language (Hrvatski), and I also try all here and already, practically all available Char Code options, in the HandBrake Software v0.9.4 (2009112300)
- MinGW i386...

-Well, In the best possible scenario, I will get, just some of my language and already detailed explained in my first post, diacritics, quite correctly showed,
but not all of them will be quite correctly showed, in the same finish movie + subtitle file... :(
And..., on "totally bad" movie + subtitle file creations (with some different Char Code all here), I get the, quite bad result all here, where my diacritics are usually
presented in the movie, as totally wrong characters (for example as: "□" or "ĕ"), or, furthermore, they are even not existed - the words in subtitle does not contain
this "problematic" diacritic letter(s) of mine at all, because it is completely skipped, for example, the word Chocolate: "Čokolada", latter in the movie Subtitle and
after the job done in HandBrake, is played as "okolada", so the diacritic "Č" character is missing and it is skipped totally all here... :(

But, the funny part of all this clue story here, I repeat, when I play, as separate way, this movie file, and import the Subtitle file for it, quite manually over VLC Player,
Webteh BSplayer..., all Multimedia Players that I tested all this, will correctly show my above mentioned diacritic letters without any problems at all! :)
But, this is not the way, after, when I want, with the HandBrake Software help, to "attach" this same subtitle directly onto a movie file, then, and only then,
I get the above described diacritic problems...
Bronx
Posts: 4
Joined: Sat Apr 17, 2010 8:40 pm

Re: Srt Subtitle problem in HandBrake Software

Post by Bronx »

Well, as many times, where the problem seems to be big as a mountain, the solution is so simple, and it is in front of your nose... :)
Regarding the "ERROR: "Invalid byte for codeset in input, discard byte", I found this related thread all here:

http://forum.handbrake.fr/viewtopic.php?f=11&t=14720

Surprisingly, my .srt Subtitles was not saved as "Unicode", it was saved as "ANSI"... :(
So, I open the .srt Subtitle in Notepad, and save it as "Unicode" now,
and everything is OK, when I now setup the HandBrake Subtitle Char Code as UTF-16,
and make movie+subititle again... :)

I just want to input that right now, when I discover my funny mistake,
to help someone else all here, with the same problem in the future... :)

Thanks everybody for help all here!

Cheers!
Last edited by Anonymous on Sun Apr 25, 2010 1:11 am, edited 1 time in total.
Reason: URL
Post Reply