• Post Reply Bookmark Topic Watch Topic
  • New Topic

FLV to JPEG conversion  RSS feed

Ramya Rajan
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to convert a FLV ( Flash Video ) file to a JPEG file by capturing its first frame. I have gone through the FLV format specification and was able to grab the video data of the first frame. But falied when tried to load the byte array into an Image object. Code snippet and Error is shown below. Please help me.
Image pic = Toolkit.getDefaultToolkit().createImage( dataimage ); // dataimage is an array of bytes
MediaTracker tracker = new MediaTracker(new Frame());
tracker.addImage( pic, 0 );
try { tracker.waitForID(0); }
catch (InterruptedException e) { e.printStackTrace(); }

if (tracker.statusID(0, true) != MediaTracker.COMPLETE)
throw new AWTException("Could not load: " + tracker.statusID(0, true));

Error: java.awt.AWTException: Could not load: 4
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!