P0l1m0rph1c
22nd June 2004, 01:04
OK, I didn't know actually where to put this thread, but here seems apropriate somehow.
We are making an app that will automatize the creation of a DVD from an AVI file, basically. The problem where we are stuck now is how to handle the subs.
We are using spumux to mux the subtitles in the program MPEG2 stream. spumux accepts both PNG and BMP, but they must be 4bpp (and <16 colors). To make those PNG's, we are doing it with avisynth, with a script similar to the following:
LoadPLugin("vsfilter.dll")
BlankClip(13)
AssumeFPS(25)
LanczosResize(720, 574)
TextSub("legpt.sub", 25)
ConvertToRGB24()
ImageWriter("C:\subs\", 0, 13, "PNG")
The problem with this aproach is that this will actually creat 24bpp PNG's, instead of 4bpp, which we don't have a clue how to make with avisynth. So, there are two options: either we (with your help) find a way of writing 4bpp PNG's directly from the script, or we just find another way to render the subtitles.
If i understand correctly, ImageWriter does accept only 24bpp input, except if EBMP is chosen. So, if this is to be made by Avisynth, it would be needed to make a conversion from RGB24 to RGB4 (?), and write a BMP or PNG with each image.
I believe another method for rendering the subs would be better, but we don't actually know which one to use, and probably how...
Any help you could give would be much apreciated.
We are making an app that will automatize the creation of a DVD from an AVI file, basically. The problem where we are stuck now is how to handle the subs.
We are using spumux to mux the subtitles in the program MPEG2 stream. spumux accepts both PNG and BMP, but they must be 4bpp (and <16 colors). To make those PNG's, we are doing it with avisynth, with a script similar to the following:
LoadPLugin("vsfilter.dll")
BlankClip(13)
AssumeFPS(25)
LanczosResize(720, 574)
TextSub("legpt.sub", 25)
ConvertToRGB24()
ImageWriter("C:\subs\", 0, 13, "PNG")
The problem with this aproach is that this will actually creat 24bpp PNG's, instead of 4bpp, which we don't have a clue how to make with avisynth. So, there are two options: either we (with your help) find a way of writing 4bpp PNG's directly from the script, or we just find another way to render the subtitles.
If i understand correctly, ImageWriter does accept only 24bpp input, except if EBMP is chosen. So, if this is to be made by Avisynth, it would be needed to make a conversion from RGB24 to RGB4 (?), and write a BMP or PNG with each image.
I believe another method for rendering the subs would be better, but we don't actually know which one to use, and probably how...
Any help you could give would be much apreciated.