creating a jpg from flv movie

  • solomon_13000
  • Born
  • Born
  • solomon_13000
  • Posts: 2

Post 3+ Months Ago

I found this code an I tried it but it does not seem to work:


var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
myVideo_mc.myVideo_video.attachVideo(stream_ns);

//select an external FLV to play
stream_ns.play("nutrigrain.flv");

//create an instance of the class
//pass the mc to reflect, the opacity of the reflection, the ratio of the gradient mask, and how often to update (milliseconds)
reflect = new Reflect(myVideo_mc, 50, 255, 5);

The Class:

import flash.display.BitmapData;

class Reflect {

private var version:String = "2.0";

private var mcBMP:BitmapData;

private var reflectionBMP:BitmapData;

private var updateInt:Number;



function Reflect(mc:MovieClip, alpha:Number, ratio:Number, updateTime:Number) {

//create a bmp obj out of it

mcBMP = new BitmapData(mc._width, mc._height, true, 0xFFFFFF);

mcBMP.draw(mc);

reflectionBMP = new BitmapData(mc._width, mc._height, true, 0xFFFFFF);

reflectionBMP.draw(mc);

mc.createEmptyMovieClip("reflection_mc", mc.getNextHighestDepth());

mc.reflection_mc.attachBitmap(mcBMP, 1);

mc.reflection_mc._yscale = -100;

mc.reflection_mc._y = mc._height;



//create the gradient mask

mc.createEmptyMovieClip("gradientMask_mc", mc.getNextHighestDepth());

var fillType:String = "linear";

var colors:Array = [0xFFFFFF, 0xFFFFFF];

var alphas:Array = [alpha, 0];

var ratios:Array = [0, ratio];

var matrix = {matrixType:"box", x:0, y:0, w:mc._width, h:mc._height/4, r90/180)*Math.PI};

var spreadMethod:String = "pad";

mc.gradientMask_mc.beginGradientFill(fillType, colors, alphas, ratios, matrix, spreadMethod);

mc.gradientMask_mc.moveTo(0, 0);

mc.gradientMask_mc.lineTo(0, mc._height/2);

mc.gradientMask_mc.lineTo(mc._width, mc._height/2);

mc.gradientMask_mc.lineTo(mc._width, 0);

mc.gradientMask_mc.lineTo(0, 0);

mc.gradientMask_mc.endFill();

mc.gradientMask_mc._y = mc._height/2;

mc.reflection_mc.cacheAsBitmap = true;

mc.gradientMask_mc.cacheAsBitmap = true;

mc.reflection_mc.setMask(mc.gradientMask_mc);

updateInt = setInterval(this, "update", updateTime, mc);


}

private function update(mc):Void{

mcBMP.draw(mc);

reflectionBMP.draw(mc);

mc.reflection_mc.attachBitmap(mcBMP, 1);

}

}

also the part I am confuse is:

myVideo_mc.myVideo_video.attachVideo(stream_ns);

Is myVideo_mc - FLVPlayback component. myVideo_video Represents?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

what exactly are you trying to do?

If all you need is an image file open your project in flash

Pick File -> Export Image... -> In the save as dialog select jpeg as the type.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

myVideo_mc is a movieclip holder for your video.
myVideo_video is the video object which you must create.
see this post on how to do it
For the other part you need Flash 8 pro, to use the bitmap class.
  • nukacola
  • Beginner
  • Beginner
  • User avatar
  • Posts: 36

Post 3+ Months Ago

flash to video encoder pro grabs every frame of the swf ot flv as an image.
  • bozboz
  • Novice
  • Novice
  • bozboz
  • Posts: 31
  • Loc: Brighton

Post 3+ Months Ago

How about if you are trying to use flvs loaded dynamically at runtime. Is there any way to grab the first frame of the flv to use as say a thumbnail, without loading the whole thing first?
  • nukacola
  • Beginner
  • Beginner
  • User avatar
  • Posts: 36

Post 3+ Months Ago

bozboz wrote:
How about if you are trying to use flvs loaded dynamically at runtime. Is there any way to grab the first frame of the flv to use as say a thumbnail, without loading the whole thing first?


of course there is!
print screen :lol:
but without loading... i really dont know.. what are you trying to do?
  • nukacola
  • Beginner
  • Beginner
  • User avatar
  • Posts: 36

Post 3+ Months Ago

make a scripted button for the flv.

if the flashmovie inside the file with a button - make this button for the first frame of the flv. and movie which will be loading - to the second frame.
first frame stop();
for the button on(release) {gotoAndPlay(2);}

if the file loading from the outside - for the button on(release) {onLoadMovie(link to movie)}
======
or onLoadMovie script. serach about this anywhere

i`m a real lamer in this....
  • bozboz
  • Novice
  • Novice
  • bozboz
  • Posts: 31
  • Loc: Brighton

Post 3+ Months Ago

no i think you missed what i was suggesting :)

I was looking for a way to create a thumbnail dynamically - automatically

so you wouldnt need to manually print screen and make a thumbnail for the button, just use the first frame of the flv clip as the button image

Im sure you can do it somehow
  • nukacola
  • Beginner
  • Beginner
  • User avatar
  • Posts: 36

Post 3+ Months Ago

i`m a real lamer in coding
  • bozboz
  • Novice
  • Novice
  • bozboz
  • Posts: 31
  • Loc: Brighton

Post 3+ Months Ago

takes a while mate, stick with it

Post Information

  • Total Posts in this topic: 10 posts
  • Users browsing this forum: No registered users and 18 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.