[MPlayer-dev-eng] patch: video filter to OCR subtitles for mplayer

Tuukka Toivonen tuukkat at ee.oulu.fi
Fri Nov 28 12:05:38 CET 2003


On Thu, 27 Nov 2003, D Richard Felker III wrote:

First comment! Great.

>> This filter takes in BGR32 image and binarizes it, setting
>Use YUV! There's absolutely no use in doing BRG32; it just makes it

Well, I think it's not worth of it. A huge reason to use YUV would be to
avoid converting to RGB and back, but it's never converted back to YUV.
Performance-wise, I think RGB is more efficient since I want to easily
access color at each pixel position. With 4:2:0 YUV or others it would be
more tricky. And yet another reason is that I want to have at least 24 bpp
per pixel so that I can number the regions as 1, 2, 3, .. up to maximum
1000*1000 or whatever is the maximum resolution.

Also, for users it's easier to select the subtitle color by using R,G,B
than YUV (this can be given as an argument to the filter). Also the
distance between two colors might be more difficult to compute in YUV than
in RGB... (otherwise user RGB triple could be converted to YUV).

>IMO a filter that does all this should not just be named threshold...

Correct. I'll rename it. Would "subselect" be ok?

Originally I planned to make multiple simple filters and threshold did
nothing else except thresholding but this proved to be not practical.

>Using frame numbers is incorrect, but there's no correct way to do it
>with G1 architecture. With MPlayer G2, you should use the timestamps.

Ouch. MPlayer prints the frame numbers but I guess it's not accessible
to filters then.

Oh well, I'll improve the patch still a little and then probably
post it with proper [patch] tag and hope something happens =)



More information about the MPlayer-dev-eng mailing list