Page 1 of 1

A program to create "random movie"

PostPosted: Sun Feb 03, 2013 4:14 pm
by thecatzman
I need help to create a program which will play animations (.wmv, .avi or anything else) to create a movies which will be different at each watch.
At the root of the program there will be folders. In these folders, there will be files. The program will play these files by following codes.
For example:

-start
-at begining play randomly one file from folder A
-after that, play randomly three files (but do not repeat the same file) from folder B
-after that play randomly one file from folder C or play one file from folder D
-after that if last file come from folder C, play randomly one file from folder E; if last file come from folder D play randomly one file from folder F
-after that, play randomly 2,3,4 or 5 files ((but do not repeat the same file)) from folder G
-the end


So I need a program to do that, and example of code lines ( in my example, I think I show all the needed actions ).
I hope someone could help me. I know nothing about coding, but with examples (and some help) I am sure I can do it.

Re: A program to create "random movie"

PostPosted: Mon Feb 04, 2013 3:54 pm
by OwnerOfSuccuby
Just a question - will this files all be downloaded as one zip folder and then unziped ? I mean they have to be on users computer as i understand ?
All files have to have for example the same resolution and format - for example mp4. As i know wmv is some kind of format that flash can dislike.

If so may be i can help a little with it. It is possible as i understand to make on flash. Can you post some sample videos with the resolution and format (i hope for example mp4) - that you are planning to use ?

They can be just as example and very very shot. But i need to see it to understand its structure and coding type.

Re: A program to create "random movie"

PostPosted: Mon Feb 04, 2013 5:12 pm
by OwnerOfSuccuby
Test some prototype - of how is possible to play videos - it works - but a little blinking when new video starts - is it a problem ?. I can post some example:

Re: A program to create "random movie"

PostPosted: Mon Feb 04, 2013 7:16 pm
by thecatzman
OwnerOfSuccuby Wrote:Just a question - will this files all be downloaded as one zip folder and then unziped ? I mean they have to be on users computer as i understand ? .

Yes, all the files will be on a zip folder and then unziped.

All files have to have for example the same resolution and format - for example mp4. As i know wmv is some kind of format that flash can dislike.

No problem

If so may be i can help a little with it. It is possible as i understand to make on flash. Can you post some sample videos with the resolution and format (i hope for example mp4) - that you are planning to use ?

They can be just as example and very very shot. But i need to see it to understand its structure and coding type.

Ok I will do it.


OwnerOfSuccuby Wrote:Test some prototype - of how is possible to play videos - it works - but a little blinking when new video starts - is it a problem ?. I can post some example:

I prefer without blinking but it is not very important.

Re: A program to create "random movie"

PostPosted: Mon Feb 04, 2013 7:29 pm
by OwnerOfSuccuby
Okey i will look may be one idea will work how to remove blinking.

Re: A program to create "random movie"

PostPosted: Tue Feb 05, 2013 7:40 pm
by thecatzman
this is the videos ( titfight contents)

Re: A program to create "random movie"

PostPosted: Wed Feb 06, 2013 6:32 pm
by OwnerOfSuccuby
Try this one:

I test it with *.mp4 formats and *.flv formats.

If you will use not mp4 in system folder change format from mp4 to what you will try to use. The same for if ypu add videos to folder make variables = number of videos in it. They have to be named like 1,2,3,4,5,6,7,8,9,10,11, and etc.

I do not know why but flash dislike *.avi - so better try mp4 :roll: :mrgreen:

Re: A program to create "random movie"

PostPosted: Thu Feb 07, 2013 5:40 pm
by thecatzman
OwnerOfSuccuby Wrote:Try this one:

I test it with *.mp4 formats and *.flv formats.

If you will use not mp4 in system folder change format from mp4 to what you will try to use. The same for if ypu add videos to folder make variables = number of videos in it. They have to be named like 1,2,3,4,5,6,7,8,9,10,11, and etc.

I do not know why but flash dislike *.avi - so better try mp4 :roll: :mrgreen:



ok, thank you, I will take a look at it ;)

Re: A program to create "random movie"

PostPosted: Sat Feb 09, 2013 11:01 pm
by thecatzman
Ok, so I am trying to understand how it works step by step. Let me know if I am wrong.

So about this lines:
var vVideoScenariy:Array=new Array();

It launch your program. So It must be the first line.



vVideoScenariy.push("System/A/"+String(Math.round((1+Math.random()*(vA-1))))+"."+vFormat);

It choose randomly one file in the folder "System/A"
But for example, If I would like to play one file from folder C instead of folder A, it will be
vVideoScenariy.push("System/C/"+String(Math.round((1+Math.random()*(vC-1))))+"."+vFormat);






var tmpBArray:Array=new Array();
var itmpBadr:int;

It prepare to launch another serie of videos (but I don't understand why this lines are not before the "//C-E or D-F" action too.)





for (var i1:Number = 1; i1 <= vB; i1++) {
tmpBArray.push(i1);
}
for (var i2:Number = 1; i2 <= 3; i2++) {

if (tmpBArray.length>0){
itmpBadr=Math.round((Math.random()*(tmpBArray.length-1)));
vVideoScenariy.push("System/B/"+String(tmpBArray[itmpBadr])+"."+vFormat);
tmpBArray.splice(itmpBadr,1);
}

}


It will play randomly 3 files from foider B
Now if I want to play randomly 2 files from folder C for example, it will be

for (var i1:Number = 1; i1 <= vC; i1++) {
tmpBArray.push(i1);
}
for (var i2:Number = 1; i2 <= 2; i2++) {

if (tmpBArray.length>0){
itmpBadr=Math.round((Math.random()*(tmpBArray.length-1)));
vVideoScenariy.push("System/C/"+String(tmpBArray[itmpBadr])+"."+vFormat);
tmpBArray.splice(itmpBadr,1);
}

}




Let me know if I am wrong.

Re: A program to create "random movie"

PostPosted: Sun Feb 10, 2013 7:56 am
by Kurushimi
OwnerOfSuccuby Wrote:Test some prototype - of how is possible to play videos - it works - but a little blinking when new video starts - is it a problem ?. I can post some example:

Holy fook! Is this taking random sound from my computer?

(EDIT: If not, why did I hear Manowar?)

Re: A program to create "random movie"

PostPosted: Sun Feb 10, 2013 8:20 am
by thecatzman
Kurushimi Wrote:
OwnerOfSuccuby Wrote:Test some prototype - of how is possible to play videos - it works - but a little blinking when new video starts - is it a problem ?. I can post some example:

Holy fook! Is this taking random sound from my computer?

(EDIT: If not, why did I hear Manowar?)

This is a clip with a song by manowar (it is write at the end of the clip).

Re: A program to create "random movie"

PostPosted: Sun Feb 10, 2013 8:36 am
by OwnerOfSuccuby
Oh yes may be in the video with dark elf if you talk about that prototype :mrgreen:

About how it works:

var vVideoScenariy:Array=new Array(); - is a array of scenario. All videos that will be put there will play.

vVideoScenariy.push("System/A/"+String(Math.round((1+Math.random()*(vA-1))))+"."+vFormat);


It choose randomly one file in the folder "System/A"
But for example, If I would like to play one file from folder C instead of folder A, it will be

vVideoScenariy.push("System/C/"+String(Math.round((1+Math.random()*(vC-1))))+"."+vFormat);


You put adress of your video to this scenario. For example you put video from first directiry A:
vVideoScenariy.push("System/A/VideoName.mpg");

The video that will be pushed first will play first.

var tmpBArray:Array=new Array();
var itmpBadr:int;


It prepare to launch another serie of videos (but I don't understand why this lines are not before the "//C-E or D-F" action too.)


I need all other arrays not for videos - but to chose randomly X videos from for example dirrectory B with out repeats. It can be another way - even with out arrays but i like this method.

The only one array that will play videos is : vVideoScenariy

All other are just for simpler adding video adress to it.

It will play randomly 3 files from foider B
Now if I want to play randomly 2 files from folder C for example, it will be


Yes you are right but - it is better to rename array to tmpCArray - becouse it is anoother array and tmpBArray.- is already in use for B.

And to change all B to -> C
itmpBadr -> itmpCadr
And etc ;)