summaryrefslogtreecommitdiffstats
path: root/DOCS/tech/vop.txt
blob: dd85855fdbfdb989fdb7a804b560bee2a076e675 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
VideoOutPlugins - Video Filters
===============

video filters are plugin-like code modules implementing the interface
defined in vf.h

basically it means video output manipulation, ie. these plugins can
modify the image and the image properties (size, colorspace etc) between
the video decoders (vd.h) and output layer (libvo or video encoders)

the actual API is a mixture of the video decoder (vd.h) and libvo
(video_out.h) APIs.

the main differences:
- vf plugins may be "loaded" multiple times, with different parameters
  and context - it's new in mplayer, old APIs weren't reentrant
- vf plugins don't have to implement all functions - all funcs has
  'fallback' version, so the plugins only override these if want
- each vf plugin has its own get_image context, and they can interchange
  images/buffers using these get_image/put_image calls.

API details:
-- TO DO --  (see vf.h fpr API and vf_*.c for examples)

Current plugins:
================

-vop crop[=w:h:x:y]
    Simple cropping plugin.
    w,h (cropped width,height) defaults to original width,height
    x,y (position of cropped subimage on the original image) defaults to center
    MPI: EXPORT only, using stride manipulation

-vop expand[=w:h:x:y:o]
    Expanding _and_ (optional) OSD rendering plugin.
    w,h (expanded width,height) defaults (-1) to original width,height
    x,y (position of original image on the expanded image) defaults (-1) to center
    o   (0=disable/1=enable SUB/OSD rendering) defaults (0) to disabled
    MPI: DR (if possible) or copy
    Special: mpcodecs core uses it to solve stride restrictions between filters
	     mencoder uses (autoload) it to render SUB/OSD

-vop flip
    Flips image upside-down (vertical mirroring)
    No parameters.
    MPI: DR (if possible) or EXPORT, using stride manipulation
    Special: dec_video autoloads it when flipping is required and libvo can't do

-vop mirror
    Horizontal mirroring
    No parameters.
    MPI: TEMP

-vop rotate[=x]
    Rotate image +/- 90 degrees
    Optional 'x' parameter (0..3) controls horizontal and vertical mirroring
    MPI: TEMP

-vop scale[=w:h]
    Software scaling (zoom) _and_ yuv<->rgb colorspace conversion
    w,h (new width/height after scaling) defaults to original width,height
	note: if -zoom is used, and underlaying filters (including libvo)
	uncapable of scaling, then it defaults to d_width/d_height !
	note 2: w/h values -1 means original width/height, 0 means scaled
	d_width/d_height. -2/-3 means calculating w or h using the other
	dimension and the original (-3) or prescaled (-2) aspect ratio.
    MPI: TEMP, accepts stride
    Special: dec_video and mpcodecs core autoloads it for colorspace conv.

-vop yuy2
    Forced software YV12/I420 -> YUY2 conversion
    (usefull for video cards/drivers with slow YV12 but fast YUY2 support)
    MPI: TEMP, accepts stride

-vop rgb2bgr[=swap]
    RGB 24/32 <-> BGR 24/32 colorspace conversion (default) or
    RGB 24/32 <-> RGB 24/32 conversion with R<->B swapping ('swap' option)
    MPI: TEMP, accepts stride

-vop palette
    RGB/BGR 8 -> RGB/BGR 15/16/24/32 colorspace conversion using palette
    MPI: TEMP, accepts stride
    
-vop format[=fourcc]
    _restrict_ the list of supported colorspaces (query-format()) to a single,
    given fourcc. The 'fourcc' option defaults to 'yuy2', but may be any
    format name, like rgb15, bgr24, yv12 etc...
    note again, it does NOT do any conversion, it just limits the _next_
    plugins format list.
    MPI: passthru

-vop pp[=flags]
    Postprocessing filter.  (usefull for codecs without built-in
    postprocessing, like libmpeg12 or libavcodec)
    Flags is a bitmask set of enabled filters (see manpage for -pp details),
    defaults to the value of divx_quality (set by -pp commandline option)
    MPI: DR (if possible) or TEMP
    Special: dec_video autoloads it if -pp option used but codec can't do pp.

-vop lavc[=quality:fps]
    Fast software YV12->MPEG1 conversion, usefull for dxr3/dvb drivers
    It uses libavcodec. Currently faster and better quality than -vop fame!
    Param quality: fixed qscale (1<=quality<32) or bitrate (32<=quality KBits)
    Param fps: force output fps (float value). If not give, or 0, it's
    autodetected based on height (240,480->29.97fps, others -> 25fps)
    MPI: EXPORT special

-vop fame
    Fast software YV12->MPEG1 conversion, usefull for dxr3/dvb drivers
    It uses libfame.
    MPI: EXPORT special

-vop dvbscale[=aspect]
    Setup scaling to the optimal values for the DVB card.
    (use HW for X-scaling, calc sw Y scaling to keep aspect)
    The 'aspect' parameter controls aspect ratio, it should be calculated
    as aspect=DVB_HEIGHT*ASPECTRATIO, default is 576*(4/3)=768
    (for 16:9 TV set it to 576*(16/9)=1024)
    It's only usefull together with expand+scale:
	-vop lavc,expand=-1:576:-1:-1:1,scale=-1:0,dvbscale
    MPI: passthru

-vop cropdetect
    It's a special filter, it doesn't alter the image itself, but detects
    (using some kind of heuristics) the black borders/bands of the image,
    and prints the optimal -vop crop= parameters to the stdout/console.
    MPI: EXPORT

-vop test[=first frame number]
    generate various test patterns
    MPI: TEMP, accepts stride

-vop noise[=lumaNoise[u][t][h]:chromaNoise[u][t][h]
    add noise
    0<= lumaNoise, chromaNoise <=100
    u uniform noise (gaussian otherwise)
    t temporal noise (noise pattern changes between frames)
    h high quality (slightly better looking, slightly slower)
    MPI: DR (if possible) or TEMP, accepts stride