From: ddennedy Date: Tue, 16 Mar 2004 05:21:00 +0000 (+0000) Subject: updated services docs plus minor fixes discovered during X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=1c246bcd681406f848726ff685eddb62efd7ee83;p=mlt updated services docs plus minor fixes discovered during git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@214 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/demo/luma1.pgm b/demo/luma1.pgm index 64433aa8..9d42359e 100644 Binary files a/demo/luma1.pgm and b/demo/luma1.pgm differ diff --git a/demo/mlt_obscure b/demo/mlt_obscure index a8f9a36f..0c0f8382 100644 --- a/demo/mlt_obscure +++ b/demo/mlt_obscure @@ -1,5 +1,5 @@ inigo \ clip2.mpeg \ --filter obscure:25%,25%:25%x25% in=0 out=68 \ +-filter obscure:25%,25%:25%x25%:10x10 in=0 out=68 \ -filter region:circle.png filter=obscure composite.start=55%,25%:12%x50% in=68 out=200 \ $* diff --git a/docs/services.txt b/docs/services.txt index 6500f5ff..23fbf4bc 100644 --- a/docs/services.txt +++ b/docs/services.txt @@ -1,3 +1,9 @@ +SERVICES +-------- + +Services marked as "(Proprietary)" are not distributed with the GPL version +of mlt. + Producers --------- @@ -20,8 +26,11 @@ Producers Read Only Properties + string resource - file location double fps - this is fixed at 25 for PAL currently - double aspect_ratio - this is determined on the first frame read + double source_fps - the framerate of the resource + double aspect_ratio - sample aspect ratio of the resource + - this is determined on every frame read Dependencies @@ -32,9 +41,10 @@ Producers Audio sync discrepancy with some content. Not all libavformat supported formats are seekable. - ogg is currently broken. - mpeg seeking is inaccurate - doesn't seek to i-frames so you may + Ogg Vorbis is currently broken. + MPEG seeking is inaccurate - doesn't seek to i-frames so you may get junk for a few frames. + RAW DV seeking not supported. fezzik @@ -45,6 +55,8 @@ Producers Constructor Argument 'file' - produce a/v from file + - can also be the name of a producer service that can + accept the resource specified post construction. Initialisation Properties @@ -78,7 +90,39 @@ Producers None. - ffmpeg + + colour + + Description + + A simple colour generator. + + Constructor Argument + + colour - A colour value is a hexadecimal representation of RGB plus + alpha channel as 0xrrggbbaa. + - Also colours can be the words: white, black, red, green, + or blue. + - The default colour is black. + + Initialisation Properties + + none + + Read Only Properties + + none + + Dependencies + + none + + Known Bugs + + none + + + ffmpeg (DEPRECATED) Description @@ -140,8 +184,12 @@ Producers string resource - file location double fps - output frames per second - double aspect_ratio - aspect ratio of video] int length - duration of resource (in frames) + + Mutable Properties + + string quality - one of "best," "fast" or anything else chooses + medium. Dependencies @@ -149,13 +197,14 @@ Producers Known Bugs - None. + DVCPRO is incorrectly identified as 16:9 aspect ratio. You must use + libdv from CVS or a post 0.101 release. - mcdv + mcdv (Proprietary) Description - Mainconcept based dv decoder for video and audio. + MainConcept based dv decoder for video and audio. Constructor Argument @@ -170,23 +219,22 @@ Producers string resource - file location double fps - output frames per second - double aspect_ratio - aspect ratio of video int length - duration of resource (in frames) Dependencies - mainconcept dv sdk and libdv. + MainConcept DV or DVCPRO SDK, libdv. "dv_sdk" installed parallel to mlt. Known Bugs - Can be problematic with some NTSC DV files? + None - mcmpeg + mcmpeg (Proprietary) Description - Mainconcept based mpeg decoder for video and audio. + MainConcept based mpeg decoder for video and audio. Constructor Argument @@ -201,12 +249,13 @@ Producers string resource - file location double fps - output frames per second - double aspect_ratio - aspect ratio of video - + double aspect_ratio - sample aspect ratio of video + int length - duration of resource (in frames) + Dependencies - mainconcept mpeg sdk. - "mpeg_sdk_demo" installed parallel to mlt. + MainConcept MPEG SDK. + "mpeg_sdk_release" installed parallel to mlt. Known Bugs @@ -222,8 +271,24 @@ Producers Constructor Argument string file - a text file containing Pango markup, see: - http://developer.gnome.org/doc/API/2.0/pango/PangoMarkupFormat.html - - requires xml-like encoding special chars: <, >, & to <, >, & + http://developer.gnome.org/doc/API/2.0/pango/PangoMarkupFormat.html + - requires xml-like encoding special chars from: + <, >, & -to- <, >, & + + Details + + Supplying a filename with extension ".txt" causes the Fezzik + producer to load with pango. If the filename begins with "+" the + pango producer interprets the filename as pango text. This is a + shortcut to embed titles in inigo commands. For westley, it is + recommended that you embed the title text in the property value. + If you need to embed Pango markup in a westley XML file, then + enclose the value inside "". + + Pango has builtin scaling. It will rescale the originally rendered + title to whatever the consumer requests. Therefore, it will lose + its aspect ratio if so requested, and it is up to the consumer to + request a proper width and height that maintains the image aspect. Initialisation Properties @@ -232,42 +297,47 @@ Producers Mutable Properties - int video_standard - enum mlt_video_standard from mlt_frame.h - PAL = 0, NTSC = 1 - this determines proper pixel aspect ratio - - string markup - a string containing Pango markup see: - http://developer.gnome.org/doc/API/2.0/pango/PangoMarkupFormat.html - - requires xml-like encoding special chars: <, >, & to <, >, & - - string fgcolour - an rgba colour specification of the text (i.e. 0xrrggbbaa) - string bgcolour - an rgba colour of the background rectangle - int align - paragraph alignment: 0 = left, 1 = center, 2 = right - int pad - the number of pixels to pad the background rectangle beyond edges of text - default 0 + string markup - a UTF-8 string containing Pango markup see: + http://developer.gnome.org/doc/API/2.0/pango/PangoMarkupFormat.html + - requires xml-like encoding special chars from: + <, >, & -to- <, >, & + string fgcolour - an RGBA colour specification of the text + (i.e. 0xrrggbbaa) + string bgcolour - an RGBA colour of the background rectangle + string align - paragraph alignment: left, centre, right + - also, numbers 0, 1 and 2 can be used respectively. + int pad - the number of pixels to pad the background rectangle + beyond edges of text. default 0. string markup - see constructor argument - string text - non-markup text (can contain markup chars un-encoded) - string font - the default typeface to use when not using markup - default "Sans 48" + string text - non-markup string in UTF-8 encoding (can contain + markup chars un-encoded) + string font - the default typeface to use when not using markup. + default "Sans 48". FreeType2 renders at 72 dpi. Read Only Properties - string resource - the text/markup file or "pango" if no file + string resource - the text/markup file or "pango" if no file. + int real_width - the original, unscaled width of the rendered title. + int real_height - the original, unscaled height of the title. + int width - the last requested scaled image width. + int height - the last requested scaled image height. Dependencies - libpango-1.0, libpangoft2-1.0, libfreetype, libgdk_pixbuf-2.0, libglib-2.0, - libgobject-2.0, libgmodule-2.0, libfontconfig + libpango-1.0, libpangoft2-1.0, libfreetype, libgdk_pixbuf-2.0, + libglib-2.0, libgobject-2.0, libgmodule-2.0, libfontconfig. Known Bugs - no frame-alignment functionality + The foreground and background Pango markup span attributes are not + supported. + Word wrapping is not supported. pixbuf Description - A graphics overlay generator using gdk-pixbuf + A still graphics to video generator using gdk-pixbuf Constructor Argument @@ -275,10 +345,23 @@ Producers a gdk-pixbuf loader. see /usr/lib/gdk-pixbuf/loaders definitely png, jpeg, tiff, pnm, and xpm - If "%" in filename, the filename is used with sprintf - generate a filename from a counter for multi-file/flipbook animation. - The file sequence ends when numeric discontinuity >100. - - If filename contains "/.all.", suffix with an extension to load - all pictures with matching extension from a directory + generate a filename from a counter for multi-file/flipbook + animation. The file sequence ends when numeric + discontinuity >100. + - If filename contains "/.all.", suffix with an extension to + load all pictures with matching extension from a directory. + - If filename contains the string ""). + + Details + + Pixbuf has builtin scaling. It will rescale the originally rendered + title to whatever the consumer requests. Therefore, it will lose + its aspect ratio if so requested, and it is up to the consumer to + request a proper width and height that maintains the image aspect. Initialisation Properties @@ -287,14 +370,16 @@ Producers Mutable Properties - int video_standard - enum mlt_video_standard from mlt_frame.h - PAL = 0, NTSC = 1 - this determines proper pixel aspect ratio - double ttl - how long (seconds) to repeat each picture in file sequences + int ttl - how long (in frames) to repeat each picture in file + sequences. default is 25. Read Only Properties - string resource - file location + string resource - file location. See Constructor Argument above. + int real_width - the original, unscaled width of the rendered title. + int real_height - the original, unscaled height of the title. + int width - the last requested scaled image width. + int height - the last requested scaled image height. Dependencies @@ -302,7 +387,7 @@ Producers Known Bugs - in/out settings are incorrectly handled. + XXX: in/out settings are incorrectly handled. ppm @@ -336,6 +421,7 @@ Producers Description Construct a service network from an XML description. + See docs/westley.txt. Constructor Argument @@ -351,8 +437,11 @@ Producers Known Bugs - Non-referenced producers and playlists are not destroyed. + Non-referenced producers and playlists are not destroyed until the + network is destroyed. A referenced producer or playlist must appear before the reference. + A filter that occurs before a producer has been defined causes a + segfault. vorbis @@ -385,33 +474,80 @@ Producers Filters ------- + brightness + + Description + + Shift the luma component using a constant value. + + Constructor Argument + + start - the constant floating point numeric value to apply. + - the default is 0. + + Initialisation Properties + + int in - in point + int out - out point + double start - see Constructor Argument above. + double end - the ending adjustment value. the filter interpolates + between the start and end adjustments over the + duration of the effect. + + Read Only Properties + + none + + Dependencies + + none + + Known Bugs + + Does not go completely to black or white. + + deinterlace Description - Deinterlace a frame consisting of two fields by linearly blending. + Deinterlace a frame consisting of two fields using bob, weave, + greedy, one-field, and linear blend methods. This code is + appropriated from the Xine XV video output plugin. Constructor Argument - none + method - a string containing the deinterlace method: bob, weave, + greedy, onefield, or linearblend. The default is + linearblend. Initialisation Properties int in - in point int out - out point - + Read Only Properties none + Mutable Properties + + string method + + Details + + If the frame properties "progressive" or "consumer_progressive" + are non-zero, then the filter is not applied. Also, if applied, + this sets the frame property "progressive" to 1. + Dependencies none Known Bugs - Not a bug, but it only provides fair quality at a fair performance; - i.e., it excels at neither. + Not a bug, but it only provides fair quality. + ffmpeg_dub @@ -441,6 +577,7 @@ Filters Known Bugs Uses pipes and is therefore not compatible with bluefish. + gamma @@ -450,7 +587,7 @@ Filters Constructor Argument - gamma - a floating point value + gamma - a floating point value. The default is 1.0, or none. Initialisation Properties @@ -468,6 +605,7 @@ Filters Known Bugs none + greyscale @@ -496,6 +634,46 @@ Filters none + luma + + Description + + Applies a luma transition between the current and next frames. + Useful for transitions from a slideshow created using producer + pixbuf. + + Constructor Argument + + file - a luma wipe + + Initialisation Properties + + int in - in point + int out - out point + + Read Only Properties + + none + + Mutable Properties + + int period - how long to wait between success iterations of the + transition. For best results set this to a multiple + of ttl used in pixbuf. The default is 24. + + luma. - all properties beginning with "luma." are passed to the + encapsulated luma transition. For example, luma.out controls + the duration of the wipe. + + Dependencies + + transition_luma and its dependencies + + Known Bugs + + none + + obscure Description @@ -509,6 +687,7 @@ Filters Initialisation Properties string start - in the format X,Y:WxH[:PWxPY] + - PWxPY is the size of the averaging region in pixels. string end - in the format X,Y:WxH[:PWxPY] int in - in point int out - out point @@ -525,39 +704,46 @@ Filters none - resize + region Description - - Image scaling and padding + + Apply one or filters to a region of the video image. The region + can be shaped as well using the alpha channel of another producer. Constructor Argument - - scale - "affine" to use affine transform scaling, otherwise - center and pad. - - Initialisation Properties + file - A file whose alpha channel will "shape" the region. + - The string "circle" is a shortcut but it requires pixbuf with + the librsvg loader. The circle is automatically stretched + to the region to create an ellipse. + + Initialisation Properties + int in - in point int out - out point - + plus and region transition properties + Read Only Properties - - none + + see the region transition Dependencies - - none + + transition_region Known Bugs - - none + + "circle" is unpredictable in the absence of the librsvg pixbuf loader. + resample Description - Adjust an audio stream's sampling rate + Adjust an audio stream's sampling rate. + This filter is automatically invoked by Fezzik for the sake of + normalisation over inputs and with the consumer. Constructor Argument @@ -585,14 +771,16 @@ Filters Description Scale the producer video frame size to match the consumer. + This filter is automatically invoked by Fezzik in order to normalise + sample aspect ratio. Constructor Argument interpolation - the rescaling method, one of: nearest (lowest quality, fastest), tiles, - bilinear (good quality, moderate speed), - hyper (best quality, slowest) + bilinear (default; good quality, moderate speed), + hyper (best quality, slowest). Initialisation Properties @@ -619,6 +807,45 @@ Filters none + resize + + Description + + Image scaling and padding and field order adjustment. + + Details + + Normally resize is used to pad the producer's + output to what the consumer has requested after an upstream rescale + filter first scales the image to maximise usage of the image area. + This filter also adjusts the field order to lower field first + if the frame property "top_field_first" has been set to 1. + Therefore, when done, it sets the top_field_first to 0. + This filter is automatically invoked by Fezzik as part of image + sample aspect ratio normalisation. + + Constructor Argument + + scale - "affine" to use affine transform scaling, otherwise + center and pad. + + Initialisation Properties + + int in - in point + int out - out point + + Read Only Properties + + none + + Dependencies + + none + + Known Bugs + + Assumes lower field first output. + volume Description @@ -713,49 +940,103 @@ Transitions Description - An alpha-channel based compositor for two frames. + A key-framable alpha-channel compositor for two frames. + + Details + + Performs dissolves and luma wipes in addition to alpha compositing. + + By default, the aspect ratio of the B frame is respected and the + size portion of the geometry specification simply defines a + bounding rectangle. + + This performs field-based rendering unless the A frame property + "progressive" or "consumer_progressive" or the transition property + "progressive" is set to 1. Constructor Argument - string start - X,Y:WxH[:mix] + string start - a geometry specification as X,Y:WxH[!][:mix] + - X, Y, W, H are assumed to pixel units unless they + have the suffix '%' + - '!' is a shortcut to specify distort, see below. + - mix is always a 2 digit percentage, defaults to 100. + - default is "85%,5%:10%x10%" Initialisation Properties - string end - X,Y:WxH[:mix] + string end - the ending size and position. + string key[F] - X,Y:WxH[:mix] - set a key frame for geometry between + the in and out. F is a frame number and can be + negative to make it relative to the out point. int in - in point int out - out point + string factory - The name of a factory service used as a non-PGM + producer loader. The default is fezzik. Read Only Properties none - + + Mutable Properties + + int progressive - set to 1 to disable field-based rendering. + string distort - when set, causes the B frame image to fill the WxH + completely with no regard to B's aspect ratio. + string halign - when not distorting, set the horizontal alignment + of B within the geometry rectangle. + - one of: left (0), centre (1), or right (2). + - the default is left. + string valign - when not distorting, set the vertical alignment of + B within the geometry rectangle. + - one of: top (0), middle (1), or bottom (2). + - the default is top. + string luma - the luma map file name. If not supplied, a dissolve. + double softness - only when using a luma map, how soft to make the + edges between A and B. 0.0 = no softness. 1.0 = + too soft. + Any property starting with "luma." is passed to the non-PGM luma + producer. + Dependencies none Known Bugs - Need to add field-based rendering. + Assumes lower field first during field rendering. luma Description - A generic dissolve and wipe transition processor. It gets its name + A generic dissolve and wipe transition processor. + + Details + + luma gets its name from how it uses a grayscale "map" file. As the luma value varies over time, a threshold filter is applied to the map to determine - what parts of frame A vs. frame B to show. It only reads PGM - files, but it does handle 16 bit PGM. This performs field-based - rendering. + what parts of frame A vs. frame B to show. It reads PGM files + up to 16 bits! Alternatively, it can use the first frame from any + producer that outputs yuv, but it will be limited to the luma + gamut of 220 values. + This performs field-based rendering unless the A frame property + "progressive" or "consumer_progressive" or the transition property + "progressive" is set to 1. Constructor Argument - string resource - the luma map file name. If not supplied, a dissolve. + string resource - the luma map file name - either PGM or any other + producable video. + - If not supplied, a dissolve. Initialisation Properties int in - in point int out - out point + string factory - The name of a factory service used as a non-PGM + producer loader. The default is Fezzik. Mutable Properties @@ -763,6 +1044,8 @@ Transitions double softness - only when using a luma map, how soft to make the edges between A and B. 0.0 = no softness. 1.0 = too soft. + Any property starting with "producer." is passed to the non-PGM luma + producer. Read Only Properties @@ -773,9 +1056,8 @@ Transitions none Known Bugs - - The luma map must be the same size as the B frame. - The PGM parser does not handle comments. + + Assumes lower field first output. mix @@ -811,11 +1093,48 @@ Transitions Known Bugs Samples from the longer of the two frames are discarded. + + + region + + Description + + Apply zero or more filters to B frame as it is composited onto + a region of the A frame. The "shape" of the region can be defined + by the alpha channel of a third producer. + + Constructor Argument + + resource - a shape producer + + Initialisation Properties + + string resource - nothing is rectangle, "circle" is a pixbuf- + generated SVG circle, anything else is loaded by the factory. + string factory - the service that creates the shape producer. + - the default is fezzik. + string filter[N] - one or more filters to apply. All filter + properties are passed using the same filter "key" + Any property starting with "composite." is passed to the + encapsulated composite transition. + + Read Only Properties + + none + + Dependencies + + transition_composite + + Known Bugs + + none + Consumers --------- - bluefish + bluefish (Proprietary) Description @@ -863,12 +1182,24 @@ Consumers Constructor Argument - string video_standard - "PAL" (default) or "NTSC" + string target Initialisation Properties + + int buffer + string rescale + Read Only Properties + + none + Dependencies + + libdv + Known Bugs + + none sdl @@ -906,6 +1237,7 @@ Consumers Description Serialise the service network to XML. + See docs/westley.txt for more information. Constructor Argument @@ -925,4 +1257,3 @@ Consumers Untested arbitrary nesting of multitracks and playlists. Property "id" is generated as service type followed by number if no property named "id" exists, but it fails to guarantee uniqueness. - diff --git a/src/modules/core/composite_line_yuv_mmx.S b/src/modules/core/composite_line_yuv_mmx.S index 7a5fb801..27af4dc2 100644 --- a/src/modules/core/composite_line_yuv_mmx.S +++ b/src/modules/core/composite_line_yuv_mmx.S @@ -44,27 +44,34 @@ _composite_line_yuv_mmx: .loop: - movl $0xff, %ecx # a = 255 + movl $0xffff, %ecx # a = 255 cmpl $0, 20(%ebp) # if alpha == NULL je .noalpha movl 20(%ebp), %edi # a = alpha[ j ] movb (%edi,%edx), %cl .noalpha: + movl %ecx, -24(%ebp) # save ecx movl 24(%ebp), %eax # mix = weight cmpl $0, 28(%ebp) # if luma == NULL je .noluma movl 28(%ebp), %edi # mix = ... movl %edx, %ebx - #sall $1, %ebx - movw (%edi,%ebx), %ax # luma[ j*2 ] - cmpw %cx, %ax + sall $1, %ebx + movw (%edi,%ebx), %bx # luma[ j*2 ] + cmpl %ebx, %eax jl .luma0 - movl %eax, %ebx - addl 32(%ebp), %ebx # + softness - cmpw %bx, %cx + movl %ebx, %ecx + addl 32(%ebp), %ecx # + softness + cmpl %ecx, %eax jge .luma1 - /* TODO: linear interpolate between edges eax and ebx */ + /* TODO: linear interpolate between edges */ + subw %bx, %ax + sall $8, %eax + subw %bx, %cx + movl %edx, %ebx + divw %cx + movl %ebx, %edx jmp .noluma .luma0: movl $0, %eax @@ -75,6 +82,7 @@ _composite_line_yuv_mmx: shrl $8, %eax movl %edx, %ebx # edx will be destroyed by mulw + movl -24(%ebp), %ecx # restore ecx mull %ecx # mix = mix * a... movl %ebx, %edx # restore edx shrl $8, %eax # >>8 @@ -137,8 +145,8 @@ _composite_line_yuv_mmx: /* for..next */ addl $1, %edx # j++ - cmpl %edx, 16(%ebp) # if ( j == width_src ) - je .out + cmpl 16(%ebp), %edx # if ( j == width_src ) + jge .out addl $2, %esi addl $2, 12(%ebp) diff --git a/src/modules/core/filter_luma.c b/src/modules/core/filter_luma.c index b1b27d6f..e36ee3a2 100644 --- a/src/modules/core/filter_luma.c +++ b/src/modules/core/filter_luma.c @@ -39,7 +39,10 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * mlt_properties properties = mlt_filter_properties( filter ); mlt_transition luma = mlt_properties_get_data( properties, "luma", NULL ); mlt_frame b_frame = mlt_properties_get_data( properties, "frame", NULL ); - int out = 24; + int out = mlt_properties_get_int( properties, "period" ); + + if ( out == 0 ) + out = 24; if ( luma == NULL ) { @@ -49,11 +52,10 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * { mlt_properties luma_properties = mlt_transition_properties( luma ); mlt_properties_set_int( luma_properties, "in", 0 ); - mlt_properties_set_int( luma_properties, "out", out ); + mlt_properties_set_int( luma_properties, "out", 24 ); mlt_properties_set_int( luma_properties, "reverse", 1 ); mlt_properties_pass( luma_properties, properties, "luma." ); mlt_properties_set_data( properties, "luma", luma, 0, ( mlt_destructor )mlt_transition_close, NULL ); - out = mlt_properties_get_int( luma_properties, "out" ); } } @@ -119,4 +121,3 @@ mlt_filter filter_luma_init( void *arg ) } return this; } - diff --git a/src/modules/core/transition_luma.c b/src/modules/core/transition_luma.c index d4d40749..f0032c13 100644 --- a/src/modules/core/transition_luma.c +++ b/src/modules/core/transition_luma.c @@ -437,8 +437,9 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f float frame_delta = delta_calculate( transition, a_frame ); float luma_softness = mlt_properties_get_double( properties, "softness" ); - int progressive = mlt_properties_get_int( b_props, "progressive" ) || + int progressive = mlt_properties_get_int( a_props, "progressive" ) || mlt_properties_get_int( a_props, "consumer_progressive" ) || + mlt_properties_get_int( properties, "progressive" ) || mlt_properties_get_int( b_props, "luma.progressive" ); int top_field_first = mlt_properties_get_int( b_props, "top_field_first" ); int reverse = mlt_properties_get_int( properties, "reverse" ); diff --git a/src/modules/fezzik/producer_fezzik.c b/src/modules/fezzik/producer_fezzik.c index bcc801c1..3f0445b1 100644 --- a/src/modules/fezzik/producer_fezzik.c +++ b/src/modules/fezzik/producer_fezzik.c @@ -165,4 +165,3 @@ mlt_producer producer_fezzik_init( char *arg ) // Return the tractor's producer return producer; } -