Re: [Mlt-devel] MLT and C#

2010-03-28 Thread Dan Dennedy
On Sat, Mar 27, 2010 at 2:12 AM, Steeve Descarpentries
sdescarpentr...@free.fr wrote:
 Hi,

 I did a swig binding for csharp. I just join the build file.

Thank you for the contribution. I will add the build as well as a
simple play.cs like the others.

 I also run some test step by step to understand howto use mlt, and howto
 use mlt with c#.

 What can I do for now ? (see file mlt test step 1)

 - simple play video
 - simple Xml Out
 - simple Play With Filter
 - simple Play With Patial Filter (not all the video)
 - simple play with a luma transition between 2 video files
 - simple render file with a luma transition between 2 video files
 - Multitrack Play

 I have some problems to :
 Display a simple black colour
 Display a singlle jpg image
 Import and deserialize a mlt xml file
 I will send another mails ...

Unfortunately, there are not a lot people around here to answer
questions. Normally, I take the time to answer questions especially
for new developers. However, at the moment, I am very busy working on
a contract in addition to my commitments outside of MLT. I strongly
suggest at this point that you study the code of other projects, in
particular OpenShot because there is less code to read through to find
good examples of MLT usage.

Also, bear in mind, that for various modules/service, you may need to
scan their C source to understand the properties available and get
some idea of how to use it because the YAML Tiny documentation for
them is incomplete. You should not need to understand it thoroughly,
but just to get some idea of what it expects.

I see you already made quite a bit of learning and progress, and I
think you will answer much of your own questions by the time I would
get around to it. :-) This is because I do not do a lot of coding
against the API itself from an app dev perspective as much as I do
within it and in the modules. So, when questions come like this, I
have to reorient my thinking and sometimes try it myself to come up
with an answer. I hope that you understand my position and the help I
could provide for now. Also, we would be interested to hear about what
you are working on it, if anything in particular!

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel


[Mlt-devel] MLT and C#, Howto display a simple jpg image ?

2010-03-27 Thread Steeve Descarpentries
Hi,

I'm trying to disply a simple jpg image, and mix it with a video.

Here is my code :

private void MultitrackMixPlayFromImage(string file1, string file2)
{
Factory.init(); 
Profile profile = new Profile(atsc_720p_30);

Producer p1 = new Producer( profile,pixbuf,file1);
p1.set(length,101);
p1.set(ttl,30);
p1.set(in,0);
p1.set(out,100);

Producer p2 = new Producer( profile,file2,null);

Playlist playlist1 = new Playlist();
playlist1.append(p1);
Playlist playlist2 = new Playlist();
playlist2.blank(playlist1.get_length()-1 -50);
playlist2.append(p2);
Tractor tr = new Tractor();
Field field = tr.field();

Multitrack multi = tr.multitrack();;

multi.connect(playlist1,0);
multi.connect(playlist2,1);

Transition t = new Transition(profile,luma);
t.set(in,playlist1.get_length()-1 -50);
t.set(out,playlist1.get_length()-1);
field.plant_transition(t,0,1);

if (tr.is_valid())
{

System.Console.WriteLine(string.Format(length : {0},
tr.get_length()));
Consumer c = new Consumer(profile, sdl, null);
c.set(rescale, none);
c.connect(tr);
c.start();  

while (!c.is_stopped())
{
Thread.Sleep(300);
System.Console.WriteLine(string.Format(position : {0},
tr.position()));
if (tr.position() = tr.get_length()-1)
break;
}
c.stop();
}
}


When the consumer start, I have an exception. I think that I didn't use
pixbuf the ggod way, but I can't find the goog way in the mlt
documentation. 

If anyone could help me ?

Thank

Steeve



--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel


[Mlt-devel] MLT and c#, Howto use the colour ?

2010-03-27 Thread Steeve Descarpentries
Hi,

I'm trying to use the colour generator with the csharp binding.

when I had a transition between a black colour playlist and a video
playlist, luma type, the mix don't work !

here is my code :

private void MultitrackMixPlayWithColour(string file1, string file2)
{
Factory.init(); 
Profile profile = new Profile(atsc_720p_30);

Producer p0 = new Producer(profile,colour,black);
p0.set(length,101);
p0.set_in_and_out(0,100);

Producer p2 = new Producer( profile,file2,null);

Playlist playlist1 = new Playlist();
playlist1.append(p0);
Playlist playlist2 = new Playlist();
playlist2.blank(playlist1.get_length()-1 -50);
playlist2.append(p2);
Tractor tr = new Tractor();
Field field = tr.field();

Multitrack multi = tr.multitrack();;

multi.connect(playlist1,0);
multi.connect(playlist2,1);

Transition t = new Transition(profile,luma);
t.set(in,playlist1.get_length()-1 -50);
t.set(out,playlist1.get_length()-1);
field.plant_transition(t,0,1);

if (tr.is_valid())
{

System.Console.WriteLine(string.Format(length : {0},
tr.get_length()));
Consumer c = new Consumer(profile, sdl, null);
c.set(rescale, none);
c.connect(tr);
c.start();  

while (!c.is_stopped())
{
Thread.Sleep(300);
System.Console.WriteLine(string.Format(position : {0},
tr.position()));
if (tr.position() = tr.get_length()-1)
break;
}
c.stop();
}
}

= frame from 0 to 50, I had well the black colour
= Frame 51 to 100, I can hear the sound of my video (playlist2), but
the screen stay black, no mix from black to the video, like I would.
= Frame 101 to the end, I have the video.

I don't understand why the transition don't run well.

Thanks

Steeve





--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel


[Mlt-devel] MLT and C#

2010-03-27 Thread Steeve Descarpentries
Hi,

I did a swig binding for csharp. I just join the build file.

I also run some test step by step to understand howto use mlt, and howto
use mlt with c#.

What can I do for now ? (see file mlt test step 1)

- simple play video
- simple Xml Out
- simple Play With Filter
- simple Play With Patial Filter (not all the video) 
- simple play with a luma transition between 2 video files
- simple render file with a luma transition between 2 video files
- Multitrack Play

I have some problems to : 
Display a simple black colour
Display a singlle jpg image
Import and deserialize a mlt xml file
I will send another mails ...

Steeve




build
Description: application/shellscript
private void SimplePlay(string file)
{
Factory.init();
Profile profile = new Profile(atsc_720p_30);
Producer p = new Producer( profile,file,null);
if (p.is_valid())
{
System.Console.WriteLine(string.Format(fps : 
{0}, p.get_fps()));
System.Console.WriteLine(string.Format(length 
: {0}, p.get_length()));
System.Console.WriteLine(string.Format(speed : 
{0}, p.get_speed()));
System.Console.WriteLine(string.Format(in : 
{0}, p.get_in()));
System.Console.WriteLine(string.Format(out : 
{0}, p.get_out()));
System.Console.WriteLine(string.Format(width : 
{0}, profile.width()));
System.Console.WriteLine(string.Format(heigth 
: {0}, profile.height()));
System.Console.WriteLine(string.Format(name : 
{0}, p.get(ressource)));

Consumer c = new Consumer(profile, sdl, null);
c.set(rescale, none);
c.connect(p);
c.start();  

while (!c.is_stopped())
{
Thread.Sleep(300);

System.Console.WriteLine(string.Format(position : {0}, p.position()));
if (p.position() = p.get_length()-1)
break;
}
c.stop();
}
}

private void SimpleXmlOut(string file)
{
Factory.init();
Profile profile = new Profile(atsc_720p_30);
Producer p = new Producer( profile,file,null);
if (p.is_valid())
{
Consumer c = new Consumer(profile, xml, 
/home/steeve/xmlTestOut.xml);
c.set(rescale, none);
c.connect(p);
c.start();  

while (!c.is_stopped())
{
Thread.Sleep(300);

System.Console.WriteLine(string.Format(position : {0}, p.position()));
if (p.position() = p.get_length()-1)
break;
}
c.stop();
}
}

private void SimplePlayWithFilter(string file, string filter)
{
Factory.init();
Profile profile = new Profile(atsc_720p_30);
Producer p = new Producer( profile,file,null);
if (p.is_valid())
{
Filter fi = new Filter(profile, grayscale);
SWIGTYPE_p_mlt_service_s s2 = p.get_service();
Service s2b = new Service(s2);
s2b.attach(fi);
fi.set_in_and_out(50,150);
Playlist playlist = new Playlist();
playlist.append(p);
Consumer c = new Consumer(profile, sdl, null);
c.set(rescale, none);
c.connect(playlist);
c.start();  

while (!c.is_stopped())
{