Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 ASP

Reply
 
Thread Tools Search this Thread Display Modes
Old 9th February 2005, 19:07   #1  |  Link
Zhnujm
Registered User
 
Zhnujm's Avatar
 
Join Date: Oct 2001
Posts: 983
DivX Media subtitle creation (xsub)

I created a little utility that converts .bmp files to .xsub subtitles, mostly for playback in my hardware player.
The .xsub files can be muxed directly in your avi files with fuse.exe.

Download: link


First thing, we need bitmaps for every subtitle.
For that use SubRip and save subtitles as .bmp files.

Format:
-Philips SVCD Designer
-4bits
-Custom Colors (you HAVE to use custom colors, dont know why), color 1 should be black
-Minimum picture width 720, minimum picture height 576 (PAL) or 480 (NTSC)
-As Output format for the timecode file you have to use TurboTitler .tts format

Then convert the bitmaps to .xsub with bmptoxsub:
BMPTOXSUB timecodefile xsubfile bitmapfile(without the numbers at the end) PAL/NTSC switch

Example:
bmptoxsub english\time.tts test.xsub english\bitmap PAL

The bitmap filenames would be in this example bitmap00001.bmp, bitmap00002.bmp,...
Make sure they start with 00001.

The resulting .xsub file can be muxed with fuse.exe:
fuse -v film.avi -s test.xsub -o film.divx


--edit
I did not even know the name of my program...

Last edited by Zhnujm; 10th February 2005 at 15:36.
Zhnujm is offline   Reply With Quote
Old 10th February 2005, 02:16   #2  |  Link
thefluffy
Guest
 
Posts: n/a
Cool !

Please note the subtitle bitmap limit is 720 x 480, not 720 x 576. If you exceed this limit, you lose the guarantee of DivX Certified playback.

I'm sure the community will appreciate you respecting the limit.
  Reply With Quote
Old 10th February 2005, 03:28   #3  |  Link
LordRPI
Registered User
 
Join Date: Sep 2004
Location: SoCal
Posts: 261
Nice work! I've tested it out with a clip of my own and it's working!

But just so you know

Quote:

Example:
bmp2xsub english\time.tts test.xsub english\bitmap PAL
should be

bmptoxsub english\time.tts test.xsub english\bitmap PAL/NTSC


This is excellent work!
LordRPI is offline   Reply With Quote
Old 10th February 2005, 15:35   #4  |  Link
Zhnujm
Registered User
 
Zhnujm's Avatar
 
Join Date: Oct 2001
Posts: 983
Thanks, at least it works for somebody else than me

Quote:
Originally posted by thefluffy
Cool !

Please note the subtitle bitmap limit is 720 x 480, not 720 x 576. If you exceed this limit, you lose the guarantee of DivX Certified playback.

I'm sure the community will appreciate you respecting the limit.
Does that only mean the bitmap size can not be bigger than 720x480 or also that the bitmap cannot be placed below 480 pixels ?
First thing can surely be solved but the second one would be a major problem for PAL users.
I dont like subtitles in the middle of the screen....
Zhnujm is offline   Reply With Quote
Old 12th February 2005, 02:45   #5  |  Link
thefluffy
Guest
 
Posts: n/a
You have a max of 720 x 480 for the subtitle bitmap. This bitmap is then scaled to the video resolution.

So if the subtitle bitmap and video resolution are the same, then it's 1 for 1.
  Reply With Quote
Old 12th February 2005, 18:55   #6  |  Link
Zhnujm
Registered User
 
Zhnujm's Avatar
 
Join Date: Oct 2001
Posts: 983
But there is no scaling if you use a hardware player.
The subtitle is displayed exactly at the position that you define. Lets say i use a 200x50 bitmap and place it at 300,430-499,479 then it appears near the middle of the PAL screen.

So i need to place it at something like 300,510-499,559.
Zhnujm is offline   Reply With Quote
Old 13th February 2005, 02:56   #7  |  Link
Jeffster
Registered User
 
Join Date: Jan 2003
Location: Land of the Long White Cloud
Posts: 183
I have just tried your converter with a PAL clip and the settings you suggest including 720-576 for the bitmaps.

It works and the subs play back fine.

I then changed the TV standard setting on my standalone from Multi to NTSC... the result is that the subs are no longer visible, as they are positioned too low. Other than that, the clip still plays back okay.

I made a second sample with the same PAL clip using 720-480 for the bitmap size in SubRip. Forcing NTSC output to my TV and it played fine this time with the subs showing up, although the font seems out of proportion (quite tall). Is that the same on your NTSC clips?

Playback in PAL mode though is a problem. Yes the subs are higher up on the screen, but there is some flickering and weirdness when subs appear.

I imagine the recommened subtitle limit of 480 that was mentioned here is so they will be compatible with NTSC only TV's (as I understand it, Multisystem TV's are rare in America)?
Jeffster is offline   Reply With Quote
Old 13th February 2005, 12:25   #8  |  Link
Zhnujm
Registered User
 
Zhnujm's Avatar
 
Join Date: Oct 2001
Posts: 983
What hardware player did you use ? For me (Yamaha 550) the subs stay at the same position if i switch from PAL to NTSC.
Im currently testing some PAL/NTSC clips to see what happens.
The next version wont need fullscreen bitmaps so it should be easier to place them on screen.
Zhnujm is offline   Reply With Quote
Old 13th February 2005, 13:07   #9  |  Link
Jeffster
Registered User
 
Join Date: Jan 2003
Location: Land of the Long White Cloud
Posts: 183
Quote:
Originally posted by Zhnujm
What hardware player did you use ?
Philips 640K
Jeffster is offline   Reply With Quote
Old 13th February 2005, 19:19   #10  |  Link
Zhnujm
Registered User
 
Zhnujm's Avatar
 
Join Date: Oct 2001
Posts: 983
I tried some combinations:

PAL video, 576 bitmap: perfect
PAL video, 480 bitmap: subtitles to high
NTSC video, 480 bitmap: perfect
NTSC video, 576 bitmap: subtitles to low (out of the screen area)

I will implement 2 modes, one wich uses a 720x576 bitmap for PAL and one that uses 720x480 for PAL and moves the subtitles down as far as possible.
Zhnujm is offline   Reply With Quote
Old 15th February 2005, 19:15   #11  |  Link
thefluffy
Guest
 
Posts: n/a
That is correct.

For NTSC the resolution limit is 720x480.
For PAL the resolution limit is 720x576.
  Reply With Quote
Old 15th February 2005, 22:26   #12  |  Link
Zhnujm
Registered User
 
Zhnujm's Avatar
 
Join Date: Oct 2001
Posts: 983
Well, thats good to hear even after i created a mode to move the subtitles up to 480.....

Heres the new version:
download

Everything is changed, use it like this:

bmptoxsub 1 2 3 4
1: Timecodefile (Philips SVCD-Designer .sub format
2: Output subtitle file (.xsub format)
3: (optional) Path to bitmap files
4: (optional) PALMODE1/PALMODE2(default)

examples:
bmptoxsub test\test.sub subtitle.xsub
bmptoxsub test\test.sub subtitle.xsub c:\files\
bmptoxsub test\test.sub subtitle.xsub PALMODE1


SubRip subtitle format:
SVCD-Designer, 4bits, custom colors,width+height+left+top dividable by 2

It now uses directly the SVCD-Designer .sub format, no need to convert to .tts.
Also theres no need anymore to use fullscreen bitmaps.
The TC&Res option must be enabled in SubRip.

PALMODE1:
Moves subtitles to NTSC save area for PAL->NTSC conversion.

PALMODE2:
Use original subtitle position.

If no path is specified it searches for the bitmap files in the current folder and in the folder where the .sub file is.
Its not tested with NTSC files, so make sure you check the output....
And dont use to complicated filenames, nobody knows what could happen.

Last edited by Zhnujm; 15th February 2005 at 22:33.
Zhnujm is offline   Reply With Quote
Old 16th February 2005, 18:34   #13  |  Link
LordRPI
Registered User
 
Join Date: Sep 2004
Location: SoCal
Posts: 261
Quote:
Originally posted by thefluffy
That is correct.

For NTSC the resolution limit is 720x480.
For PAL the resolution limit is 720x576.
It's funny, when you actually know the guy in person, you read it with an Australian accent
LordRPI is offline   Reply With Quote
Old 16th February 2005, 20:20   #14  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,177
Hi Zhnujm,

Do you have an short PAL and NTSC "example clips" you can provide us?


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 16th February 2005, 21:29   #15  |  Link
Zhnujm
Registered User
 
Zhnujm's Avatar
 
Join Date: Oct 2001
Posts: 983
Heres a short example with 2 subtitle streams:
download

Download may be slow.


It seems to me that the (Software) DivX-Player does not correctly recognise the subtitle position, i have a dvd that has some subtitles at the top, but the DivX-Player shows them at the bottom. Hardware playback is OK.
Zhnujm is offline   Reply With Quote
Old 16th February 2005, 22:25   #16  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,177
Quote:
Originally posted by Zhnujm
,,,It seems to me that the (Software) DivX-Player does not correctly recognise the subtitle position, i have a dvd that has some subtitles at the top, but the DivX-Player shows them at the bottom. Hardware playback is OK.
Are you using a stand-alone player that recognises PAR/DAR signalling in AVI?

If so, you might be interested to know (or you might already know) that MPEG Modifier will accept Mpeg4 streams with an .divx file extension!

I was hoping that after adding 16:9 DAR signalling to your sample, DivX Player would have displayed the subtitles in the correct place... but sadly it didn't


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 16th February 2005, 22:56   #17  |  Link
thefluffy
Guest
 
Posts: n/a
The subtitle stream of small.divx is as follows:

00:00:05.080 00:00:07.720 "small000.bmp" (214 464 505 535)
00:00:07.880 00:00:11.400 "small001.bmp" (172 464 545 535)
00:00:11.560 00:00:14.600 "small002.bmp" (174 464 543 529)
00:00:14.960 00:00:16.800 "small003.bmp" (262 504 455 529)
00:00:17.000 00:00:19.040 "small004.bmp" (182 464 535 529)

Lets take the first one for example; left as 214, right as 505, top as 464, and bottom 535. This subtitle shouldn't play at the top of the screen.

Maybe I'm looking at the wrong file ?
  Reply With Quote
Old 16th February 2005, 23:30   #18  |  Link
Zhnujm
Registered User
 
Zhnujm's Avatar
 
Join Date: Oct 2001
Posts: 983
Quote:
Originally posted by thefluffy
Maybe I'm looking at the wrong file ?
Yes, sorry, maybe i was not that clear, thats NOT the file with the subtitle at the top
I can make it available tomorrow.
Zhnujm is offline   Reply With Quote
Old 17th February 2005, 18:19   #19  |  Link
Zhnujm
Registered User
 
Zhnujm's Avatar
 
Join Date: Oct 2001
Posts: 983
Heres the same file as above, but the first and the third subtitle should be at the top:

download

Its works in hardware, but not with DivX-Player.
Zhnujm is offline   Reply With Quote
Old 17th February 2005, 19:25   #20  |  Link
thefluffy
Guest
 
Posts: n/a
This is a DivX Player bug. Thanks for the feedback !
  Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:53.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.