[mythtv] [PATCH]Black border filter

Kristof Pelckmans kristof.pelckmans at antwerpen.be
Tue Aug 31 16:34:10 EDT 2004


Here is an implementation for an automatic aspect ratio detection filter.

Kristof

An excerpt from the README file :

MythTV Blackborder Filter
~~~~~~~~~~~~~~~~~~~~~~~~~
I. Summary

The blackborder detection filter looks for horizontal black borders in
a captured stream. It can be extended to vertical black borders,
but this is not implemented yet.

II. When to use

The filter enables automatic aspect ratio detection.

Example :
capture aspect : 4:3
'real' video aspect : 16:9
output aspect : 16:9

Without the blackborder detection, MythTV will only consider the
capture aspect and thus center the 4:3 captured video on the 16:9 screen :
 ______________
|  |________|  |
|  |        |  |
|  |________|  |
|__|________|__|

The manual 4:3 zoom function enables one to cut off the top and bottom
black borders.

With blackborder detection, the video stream will be flagged as
16:9 and MythTV will zoom into the non-black part of the video.

III. How to use

example :
blackborder=0:70:76:430:18:20,blackborder=0:40:46:490:18:20

The first filter detects a 16:9 video stream in a 4:3 capture stream
and the second is for a 14:9 video stream in a 4:3 capture stream.

The different parameters :
1) 0 for horizontal, 1 for vertical (not implemented)
2) start line
3) end line
4) 'black' pixel threshold : all pixels below this threshold will be
considered as black
5) 'black' line threshold : minimum number of black pixels that have to be
present to consider a line 'black'

IV. Calibration

For the moment, the calibration of the filter has to be done manually.
I got the threshold idea from the image->colors->threshold option of
The Gimp. Using captured yv12 images I determined my threshold values.

For more information on the internals and the possible enhancements, I refer to
the README.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: blackborder.patch
Type: text/x-patch
Size: 32676 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20040831/7d89fd20/blackborder.bin


More information about the mythtv-dev mailing list