Re: [Mlt-devel] More experiments with Java bindings - toying with frames
Brought to you by:
ddennedy,
lilo_booter
From: Charles Y. <cha...@pa...> - 2004-08-08 15:17:56
|
Just because I was doing some optimisations on avformat anyway, I've added support so that you can retrieve rgb24 from it. Obviously, this is very incomplete (since none of the filters understand rgb24). You should be able to get this tomorrow (it's completely untested and I have no idea how well or badly they'll work, esp. in conjunction with fezzik...). On Sun, 2004-08-08 at 16:57, Stepan Roh wrote: > I think I spotted a problem in mlt_frame_get_image(): if someone gets > image different from mlt_image_yuv422, it will get to him on subsequent > calls as mlt_image_yuv422. I guess the fix to it is to have "format" > property and in mlt_frame_get_image() assign current format to it. That > way line > > *format = mlt_image_yuv422; > > will be changed to correct > > *format = mlt_properties_get_int( properties, "format" ); > > and everything will work as expected. Yeah - should be easy enough to add - will check into it. > If I understrand it correctly arguments width, height and format are just > "hints". Am I right? I hope MLT gets more documentation in the future :-) Pretty much - some producers pay attention to them more than others. They're a little inconsistently used at the moment... > It works now with "fezzik" too. Super! However segfault if > "consumer_aspect_ratio" is not set is not very user-friendly > (especially if services.txt says: If a property "consumer_aspect_ratio" > exists on the frame :-) Thought that might happen ;-). > Yes, thanks. Now I'll have to convince Java to show those images. A quick way to convert to a greyscale rgb is something like: uint8_t *rgb = malloc( width * height * 3 ); uint8_t *p = rgb; uint8_t *q = buffer; size = width * height; while ( size -- ) { *p ++ = *q; *p ++ = *q; *p ++ = *q; q += 2; } ... or something like that :-). Anyway, if you wait til tomorrow, you might be able to get rgb24 directly for some mlt producers (you may still have to implement a yuv422->rgb24 converter in the short term though...). Cheers, Charlie |