On Thu, May 26, 2011 at 8:44 PM, Dyogo Veiga <[email protected]> wrote: > Was hoping you could help me but it does not have as fine, thank you so I'll > try looking for other ways to solve my problem if ever you decide to > implement something and want to share with me I'll be happy since we still > have the front-month project. Again thanks for the goodwill ...
A working Python example is now in mlt git: http://goo.gl/f9reH It requires latest git version of mlt to get the updated python binding. > 2011/5/26 Dan Dennedy <[email protected]> >> >> On Thu, May 26, 2011 at 1:34 PM, Dyogo Veiga <[email protected]> wrote: >> > Thanks for the help but I'm still in trouble to return an image of >> > mlt_frame. I need an x varival receive video content at position y. >> >> Did you make the change to the swig binding I mentioned? If not, then >> it will not work! >> >> > This code is written in Python: >> > >> > import mlt >> > >> > mlt.Factory().init() >> > >> > profile = mlt.Profile() >> > >> > p = mlt.Producer(profile, "/home/joao/cachorros.ogg") >> > >> > c = mlt.Consumer(profile, "sdl") >> >> Did I say to create a consumer? NO! >> >> > c.set("rescale", "none") >> > p.seek(1098) I stand in the video frame 1098 >> > >> > frame = p.get_frame() >> > >> > image = frame.get_image() >> > >> > I can not return an image of the method get_image and I needed it >> > because I >> > use the frames of the video to compare with other. >> > >> > if possible would like your help to solve this problem. >> >> I have obligations. I said I would work on this sometime over the next >> few days. Don't push me further, or will require that you pay me for >> any further assistance. >> >> > Sorry, my english is terrible xD >> > >> > >> > >> > 2011/5/26 Dan Dennedy <[email protected]> >> >> >> >> On Thu, May 26, 2011 at 5:55 AM, Dyogo Veiga <[email protected]> >> >> wrote: >> >> > What happens is that I start Factory, Producer and create the >> >> > position >> >> > the >> >> > video without problem. I use the Python language and create a >> >> > variable >> >> > called frame and it receives Producer.get_frame () but when I do >> >> > frame.get_image () method that asks three arguments, the height, >> >> > width >> >> > and >> >> > format but when I pass these parameters of the error. interece >> >> > grateful >> >> > to >> >> > help, >> >> >> >> The scripting languages have some limitations with passing and >> >> returning binary values. In the MLT source tarball, see >> >> src/swig/mlt.i. There is a special function to handle the binary image >> >> return value from Frame::get_waveform() as used by >> >> src/swig/python/waveforms.py. Something similar needs to be created >> >> for Frame::get_image(). It does not exist yet because no one has >> >> needed it. I can make a complete working python script for you, but it >> >> will take a few days and you need to be prepared mlt from source. >> >> >> >> > I participate in a project targeting in Brazil we use the OpenCV but >> >> > he has problems to place the video in ogg the mlt is the solution to >> >> > finish >> >> > the project. Thanks >> >> > >> >> > 2011/5/26 Dan Dennedy <[email protected]> >> >> >> >> >> >> On Wed, May 25, 2011 at 11:05 AM, Dan Dennedy <[email protected]> >> >> >> wrote: >> >> >> > 2011/5/25 Dyogo Veiga <[email protected]>: >> >> >> >> Good afternoon, I have a project targeting video and started to >> >> >> >> use >> >> >> >> mlt >> >> >> >> can >> >> >> >> position the video but I can not return to a variable one frame >> >> >> >> of >> >> >> >> video. If >> >> >> >> someone can help me I am grateful. >> >> >> > >> >> >> > Exact syntax depends on your language, but in pseudo-code it looks >> >> >> > like >> >> >> > this: >> >> >> > >> >> >> > Factory.init() >> >> >> > profile = new Profile("square_pal_wide") // or other >> >> >> > producer = new Producer(profile, "filename") >> >> >> > producer.seek(myPosition) // myPosition is a frame number >> >> >> > frame = producer.get_frame() >> >> >> >> >> >> I forgot that there is something special you need to do here to make >> >> >> some things happy: >> >> >> >> >> >> frame.set("consumer_aspect_ratio", profile.sar()) >> >> >> frame.set("consumer_deinterlace", profile.progressive()) >> >> >> >> >> >> > format = mlt_image_rgb24 // or other >> >> >> > width = 0 >> >> >> > height = 0 >> >> >> > image = frame.get_image(format, width, height) >> >> >> > >> >> >> > // Image contains data in packed format where stride = width * >> >> >> > bytes_per_pixel depending on format. >> >> >> > // You do not destroy this image buffer; the frame object manages >> >> >> > it. >> >> >> > >> >> >> > // If you are using a garbage-collected language, smart pointers, >> >> >> > or >> >> >> > scoped objects, then object destruction is automatic. Otherwise, >> >> >> > you >> >> >> > need to call close functions (C) or delete (C++) your object >> >> >> > pointers. >> >> >> > >> >> >> > Easy, eh? >> >> >> > >> >> >> > -- >> >> >> > +-DRD-+ >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> >> +-DRD-+ >> >> > >> >> > >> >> > >> >> > -- >> >> > Dyogo Ribeiro Veiga >> >> > Graduando em Tecnólogo em Análise e Desenvolvimento de Sistemas - 3º >> >> > Período >> >> > Bolsista de Iniciação Científica - Núcleo de Pesquisas em Sistemas de >> >> > Informação >> >> > (22) 9726-3631 >> >> > >> >> >> >> >> >> >> >> -- >> >> +-DRD-+ >> > >> > >> > >> > -- >> > Dyogo Ribeiro Veiga >> > Graduando em Tecnólogo em Análise e Desenvolvimento de Sistemas - 3º >> > Período >> > Bolsista de Iniciação Científica - Núcleo de Pesquisas em Sistemas de >> > Informação >> > (22) 9726-3631 >> > >> >> >> >> -- >> +-DRD-+ > > > > -- > Dyogo Ribeiro Veiga > Graduando em Tecnólogo em Análise e Desenvolvimento de Sistemas - 3º Período > Bolsista de Iniciação Científica - Núcleo de Pesquisas em Sistemas de > Informação > (22) 9726-3631 > -- +-DRD-+ ------------------------------------------------------------------------------ vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 _______________________________________________ Mlt-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mlt-devel
