Re: [dvd::rip] Forced Subtitles
|
Subject: |
Re: [dvd::rip] Forced Subtitles |
|
From: |
"Allan N. Snider" <allansnider@xxxxxxxxx> |
|
Date: |
Tue, 31 Jan 2006 03:59:43 -0500 |
Triffid:
Patch is attached. Note that it is quite hackish, but would like
to see it incorporated. Feel free to do with it what you like. The
main drawback is that I only updated the RGB code and left the YUV as
is. This forces you to encode using "--use_rgb -k" (very slow
encoding) which is probably why no interest has been shown. I have
posted this patch to the transcode users mailing list as well, quite
some time ago.
The patch should be applied against transcode 0.6.14. It adds the
following options to extsub:
forced
- render only forced subtitles, [0]
zoom
- scale the subtitles, [1.0x1.0]
rgb
- RGB colour to render with, (hex tuple), [ffffff]
- eg: yellow would be rgb=00c0c0
Existing options have been changed as follows:
antialias
- enhanced from (0=off,1=on) to (0=off,1=before zoom,2=after
zoom,3=before and after)
- (I find a value of 1 works the best, otherwise I see excessive
blurring)
color1, color2
- these have been changed from an absolute pixel value, to a
transparency value, that is
where 0 would have written black, and 255 written white, 0
now means transparent, and
255 means opaque wrt the rgb rendering colour. For example,
128 would average the
original pixel colour with the subtitle colour (50/50).
Since color[12] can be antialiased
(and zoom blurs a bit too), you get nice smooth blending of
the subtitle edges against the
picture.
vertshift
- has been changed to be a simple offset from the bottom of the
picture. A new minimum
bounding box is computed for each subtitle frame, which gives
consistent positioning, no
matter where the subtitle happened to be originally
positioned. Unfortunately, this will
necessitate having to experiment to get the new value correct.
Sorry.
Examples:
-J extsub=track=0:vertshift=80:timeshift=0:
zoom=0.9x0.75:antialias=1:pre=0:
color1=0:color2=255:ca=2:cb=3:rgb=00c0c0
- apply the subtitling as a post operation, hence apply a
similar aspect ratio scaling (and
shrink the original text a bit) that was applied to the
original picture (for 16:9). Draw
the subtitles antialiased using a moderately dark yellow.
-J extsub=track=0:forced=1:vertshift=60:timeshift=0:
antialias=1:pre=0:color1=255:color2=0:ca=2:cb=3:
zoom=0.8x0.68:rgb=00d0d0
- render only forced subtitles, and apply a shrink/aspect ratio
correction
-j -54,0,54,0 -Y 0,0,8,0 -Z 720x408
-J extsub=track=0:vertshift=80:timeshift=0:
zoom=0.9x0.75:antialias=1:pre=0:color1=0:color2=255:
ca=2:cb=3:rgb=00c0c0
- here is an example where I take advantage of "post"
processing the subtitle
to add padding at the bottom of the picture where I want the
subtitle to go
so that I don't have to overlay on the picture. (For this
particular DVD the
subtitles were too hard to read no matter what colour was
used).
- usually for any 2.35:1 format I will always force padding at
the bottom of the
picture and draw the subtitles there.
CAVEAT:
None of the will work unless "--use_rgb -k" is given, which may
possibly interfere
with other filters. (Some are YUV only).
Allan
Triffid Hunter wrote:
I
would be very interested in this patch. If you send it my way, with
your permission I'll try and get it added to gentoo's transcode ebuild
as an option.. I've no "veto" in that regard, but hopefully am
knowledgeable enough to get it done regardless.
have you sent it to the transcode users mailing list?
Allan N. Snider wrote:
This has been requested before. It would
be relatively easy to do. The extsub filter actually does parse the
forced flag from the subtitle stream, but then just throws it away. If
another field were added to the config.sub structure (in subproc.c),
that information could be made available to the filter. Then add an
option to only render the subtitles that have the forced flag set. I
have a patch which does just this (and works), unfortunately, it is
intergrated with numerous other changes to extsub I made that people
normally don't want, as they introduce quite a few headaches in the
encoding process, (such as being forced to encode using rgb instead of
yuv). If you are interested in the source patch, and re-building
transcode for yourself, drop me a note and I will send it to you.
Allan
James Sager wrote:
I'm not sure if this has been requested
before, but can the option to only include subtitles that have been
flagged as forced subtitles be added to dvd:rip? I can see this as
being extremely useful and definitely something that I would want to
see included. This is a great program and I am using it to transcode my
dvd's to XviD for use with MythVideo.
Thanks,
Jim
|
extsub.patch.gz
Description: application/gzip
|
|