VideoHelp Forum




+ Reply to Thread
Results 1 to 16 of 16
  1. While using Handbrake, I am trying to convert an MKV file to MP4 with burned in subs. I have a VOBSUB file and a video file. When I play the MKV file on VLC, the subs are aligned:



    But after conversion (and after the subs are burned in), when I play the MP4 file, I get this:


    The subtitles have shifted to the right, they are no longer centered.

    What is causing this? Can I toggle a setting to re-align the subs?

    Any useful help is greatly appreciated.
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Are you doing any resizing/cropping handbrake?

    And maybe you should post this in the handbrake forum, https://forum.handbrake.fr/ as it might be a bug.
    Quote Quote  
  3. Originally Posted by Baldrick View Post
    Are you doing any resizing/cropping handbrake?

    And maybe you should post this in the handbrake forum, https://forum.handbrake.fr/ as it might be a bug.
    Thanks for the response.

    No, I am not cropping anything out, I left all video presets alone. Also, I checked Handbrake forum and I could not find any useful information. I'll post there if no one here can help solve the problem.
    Quote Quote  
  4. The kerning has changed too, so it looks like handbrake and vlc interpret them differently.
    Quote Quote  
  5. Originally Posted by smrpix View Post
    The kerning has changed too, so it looks like handbrake and vlc interpret them differently.
    Is there a way to adjust the kerning in Handbrake?
    Quote Quote  
  6. I don't see how kerning is an issue using IDX/VOBSUB subtitles as these are image based and not text based?

    Perhaps DVDSubEdit could be used to re-position the subtitles (you would need turn them into sup since you dont' have the VOB files - BDSup2Sub++)
    Quote Quote  
  7. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    If you are using an SUP/IDX file make sure the resolution in the IDX is set the same as the video. You subtitles characters are not just misaligned they are wider by .88 times, in the original. This will be exactly how they turn out if the resolution is set to 640 instead of 720 like your video.
    Click image for larger version

Name:	ScreenHunter_37 Oct. 22 23.29.jpg
Views:	10176
Size:	30.8 KB
ID:	20741

    Use a Hex editor to check the IDX file.
    Click image for larger version

Name:	ScreenHunter_37 Oct. 22 23.18.jpg
Views:	14000
Size:	63.9 KB
ID:	20742
    Quote Quote  
  8. Edit: nevermind
    Last edited by roma_turok; 5th Aug 2016 at 12:58.
    Quote Quote  
  9. Originally Posted by Budman1 View Post
    If you are using an SUP/IDX file make sure the resolution in the IDX is set the same as the video. You subtitles characters are not just misaligned they are wider by .88 times, in the original. This will be exactly how they turn out if the resolution is set to 640 instead of 720 like your video.
    Image
    [Attachment 20741 - Click to enlarge]


    Use a Hex editor to check the IDX file.
    Image
    [Attachment 20742 - Click to enlarge]
    Thanks for the information! I checked what you said, and my video/subtitle dimensions are not equal. My video is at 640x480 while my subtitles are at 720x480. Question is: how can I fix this? I tried to change the dimensions of the video on Handbrake to 720x480, but it does not allow me to.
    Quote Quote  
  10. Better might be to shift the subs to the left in your 640x480 video. Open the IDX and:

    Settings

    # Original frame size
    size: 720x480

    # Origin, relative to the upper-left corner, can be overloaded by aligment
    org: -30, 0


    That boldfaced -30 says to shift them to the left by 30 pixels. I don't really know what it's supposed to be, so experiment (and hope Handbrake has a preview). -30 looks approximately right to me. It also requires that Handbrake actually honor the parameters set in the IDX file.
    Last edited by manono; 25th Oct 2013 at 20:07.
    Quote Quote  
  11. Originally Posted by manono View Post
    Better might be to shift the subs to the left in your 640x480 video. Open the IDX and:

    Settings

    # Original frame size
    size: 720x480

    # Origin, relative to the upper-left corner, can be overloaded by aligment
    org: -30, 0


    That boldfaced -30 says to shift them to the left by 30 pixels. I don't really know what it's supposed to be, so experiment (and hope Handbrake has a preview). -30 looks approximately right to me. It also requires that Handbrake actually honor the parameters set in the IDX file.
    I got the program. So, do I edit the script and then remux the IDX file into the MKV?
    Last edited by oshare_banchou; 25th Oct 2013 at 20:50.
    Quote Quote  
  12. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    The easiest way is to just change the IDX file with a hex editor (I use HxD). The example I posted above shows 640x480. Just open the IDX with the HxD editor and position your cursor in the RIGHT HAND area and changed the 640 to 720. That's all I did to make the 2 examples, one correct and one large. Offsetting, as suggested above, will work but only for a particular line.
    since the font matrix is wider than it should be.

    Are you sure about the dimensions because the subtitles are actually too fat which is usually what results when the subtitles think there is only 640 pixel width? Its like changuing your display resolution from 1920 to 640. everything gets real large including the fonts.

    MAKE COPIES FIRST:
    Try changing the IDX file and test it, both larger and smaller width than the current. It should alter the font width and starting position but try to keep within the modulus 16 range (640, 720, 800, etc)
    Last edited by Budman1; 25th Oct 2013 at 22:54. Reason: A Safety Notation
    Quote Quote  
  13. Originally Posted by oshare_banchou View Post
    I got the program.
    To what program are you referring?

    Originally Posted by oshare_banchou View Post
    So, do I edit the script and then remux the IDX file into the MKV?
    I don't use Handbrake but doesn't it allow you to use an external subtitle file?

    Originally Posted by Budman1 View Post
    The easiest way is to just change the IDX file with a hex editor (I use HxD).
    Correct me if I'm wrong, but didn't your method shift it even more to the right? When he wants it shifted back left? And, having never used a hex editor in my life I, for one, wouldn't consider it the easiest method.
    Quote Quote  
  14. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    I will try to clarify my answer earlier. When subtitle (SSA, IDX, etc) are set to say 640x480, it is as if they will be painted on a screen that is 640x480. Now if the size and position is correct but the video is, say 720x480 then the subtitles are 'stretched' to cover the larger video. So, each pixel of the 640x480 subtitle screen becomes in essence 1.125 pixels (720/640) wide. This includes the spaces at the left of the line of subtitles and causes the subtitle line to 'Look' like it is farther right.

    In my example I posted above, you can see the same line of text is farther right and the font stretched wider in the 640x576 example than the 720x576 example. The line is also offset to the right because of this.

    Manono, you are right in that if the subtitles are indeed 720x??? and the video is 640x??? then the reverse is true and the subtitles will in essence be 'Squeezed' together and move farther right, in effect. That is why I asked if the dimensions were maybe reversed since the example that was submitted looked exactly like the opposite was true.

    As far as the HxD (hex editor) is concerned, you just open the editor, drag a file to it and it shows you the hex representation on the left and the text representation on the right. You can place you mouse on the left and change the hex characters if you know what they are OR on the right and just change the text (Type over the 640 and make it 720, SAME number of characters so no problems). Then click file -> save/save as and it prompts you that it is changing the file and automatically makes a backup of the original. Now you have a file with 720x480 subtitles.

    Click image for larger version

Name:	ScreenHunter_37 Oct. 26 11.49.jpg
Views:	4918
Size:	165.6 KB
ID:	20823

    This is for IDX file. If you have an SSA or ASS file just add the PlayY line at the top and it does the same thing. The PlayY has the greatest effect since with ASS/SSA subtitle, the width seems to be adjusted to the height of the subtitle font automatically:

    [Script Info]
    ScriptType: v4.00
    Collisions: Normal
    PlayResX: 852
    PlayResY: 480
    Timer: 100.0000

    I may have misspoken, but I considered the hex editor easier than manipulating a video file, a subtitle file and a 4th program to do the actual manipulation in addition to the conversion program. I just typed 3 numbers, saved it and ran the programs I was familiar with.
    Quote Quote  
  15. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Sorry for the delay but I think I finally found the problem for anyone following this thread. It is possible to modify the Size, Origin x,y , Alignment, scale, etc of the VOBSubs directly within the MKV file but Handbrake does not seem to honor the settings. This is further messed up if the video has dimensions/resolutions that are such as 704x368 with an anamorphic (I believe that's the term) aspect of 2.35 which displays as 864x368.

    I double checked with Format Factory, VirtualDub and PotPlayer via AVISYNTH input to them, and they all show the subtitles correctly as per the IDX settings within the MKV file. If anyone wishes to use this method for using VOBSUBs in another editor converter, or for information only, this is the Method I used:

    1. Use MKVMerge to get the Track ID and Use MKVExtract to extract the IDX/SUB files for use with AVISynth:
    Click image for larger version

Name:	ScreenHunter_37 Oct. 28 10.40.jpg
Views:	4602
Size:	54.4 KB
ID:	20885

    2. Create AVISynth file <WhatEverName.AVS>

    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
    A = FFAudioSource("C:\<PathToVideo\VideoName.mkv>")
    V = FFVideoSource("C:\<PathToVideo\VideoName.mkv>")
    audiodub(A, V)
    LanczosResize(864, 368) #This is for obtaining the 2.35 aspect, otherwise skip it
    loadplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\vsfilter.dll")
    #directshowsource("C:\Users\Bud\Desktop\New folder\heart.mkv") #This can cause duplicate subtitles to display
    vobsub("<PathToIDX\S_vobsub.idx>") #IDX Obtained from above

    3. AFTER MAKING A COPY OF YOUR MKV and storing for safekeeping, Use HxD to search for text such as "size" to locate IDX area within the MKV as shown in my previous post #14 and change necessary items explained below .

    # Settings
    # Original frame size
    size: 720x480

    # Origin, relative to the upper-left corner, can be overloaded by aligment
    org: 0, 0 Can be altered to x, y such as 0, 10 for upper left. Need to Change Alignment OFF at LEFT UPPER --> ON at LEFT UPPER. Use Insert for extra digits

    # Image scaling (hor,ver), origin is at the upper-left corner or at the alignment coord (x, y)
    scale: 100%, 100% Keep at 3 digits such as 080%

    # Alpha blending
    alpha: 100%

    # Smoothing for very blocky images (use OLD for no filtering)
    smooth: OFF

    # In millisecs
    fadein/out: 50, 50

    # Force subtitle placement relative to (org.x, org.y)
    align: OFF at LEFT TOP Change to ON to honor Origin above. Use Delete key to remove extra "F"

    # For correcting non-progressive desync. (in millisecs or hh:mms:ms)
    # Note: Not effective in DirectVobSub, use "delay: ... " instead.
    time offset: 0

    # ON: displays only forced subtitles, OFF: shows everything
    forced subs: OFF

    # The original palette of the DVD
    palette: 000000, 7e7e7e, fbff8b, cb86f1, 7f74b8, e23f06, 0a48ea, b3d65a, 6b92f1, 87f087, c02081, f8d0f4, e3c411, 382201, e8840b, fdfdfd
    AFAIK Unknown,Background color,text smoothing color,1st Text Color, Unknown,Background color, text smoothing color,2nd Text Color...

    # Custom colors (transp idxs and the four colors)
    custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, 000000
    AFAIK scheme same as above

    # Language index in use
    langidx: 0

    # English
    id: en, index: 0 May also be eng, jpn, etc

    # Decomment next line to activate alternative name in DirectVobSub / Windows Media Player 6.x
    # alt: English

    # Vob/Cell ID: 1, 1 (PTS: 0)
    timestamp: 00:00:01:101, filepos: 000000000 Timestamp for Subtitle 1 to show up
    timestamp: 00:00:08:708, filepos: 000001000 Timestamp for Subtitle 2 to show up

    For anyone that does not understand any or all of the above, I apologize for wasting anyone's time but I found no method to make HandBrake honor IDX stings or correct for other needed settings. I thought it may come in handy for others that are familiar with AVISynth and IDX files to use other programs to embed VOB subtitles via AVISynth It is also possible to use this to alter the timestamps to sync the subtitles.
    Quote Quote  
  16. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    An easier program to shift and/or resize the sub is BDSup2Sub,it will output what you want.
    I think,therefore i am a hamster.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!