September 19, 2007

Playing Flash Video (FLV) with Java

*** Update: Read this post first!! ***

Today I was challenged by one of my coworkers to be able play an FLV movie inside a Java client (Swing) application. Well it seems like it's a piece of cake. All you need:
To spice up the challenge I added the player inside the ReflectionPanel from the great book: Filthy Rich Clients.
There's nothing special to it... I created this demo in about 15minutes. If you take the FOBS4JMF binary build, all you need is included and preconfigured.

15 comments:

  1. Thanks for your post
    I am currently working on a project which includes tagging of flv media to synchronize it with an auto scrolling pdf.

    can i have the source code of your project to have an idea of how to use flv with java as I cant find any other resource online

    ReplyDelete
  2. I use applet to play flv file
    After I install Fobs4JMF, when I run this applet in eclipse IDE, it's work.
    But when I signed applet and deploy it in webapp project, it doesnot work on any browser

    ReplyDelete
  3. @ Painless,

    Well I'm working on something like that too :)

    There is some information available on the FOBS4JMF page on how to set it up and for the rest it's basically standard Java JMF API.
    I'm sorry I can't give any more details at this time.


    @ Anonymous:

    FOBS4JMF requires native libraries, the current applet plugin doesn't support that yet. You'll have to wait for the Java6uN applet plugin which supports JNLP (Webstart) descriptors. And then use tricks to register FOBS into JMF, that way you can make it work seamlessly on any major platform (windows, mac, linux) without preinstalling anything but Java.
    Soon I'll be giving away some code on that subject.

    ReplyDelete
  4. any sample code please?

    ReplyDelete
  5. I've uploaded a minimal version of the player (for Windows, native libs included) as an Eclipse project, it should compile and run out-of-the-box. Don't mind the multithreading errors and all that, it's my first quick and dirty version that "streams" a VP3 encoded FLV from an HTTP source.

    I'm actually no longer using this to play FLV as I'm waiting for the Java Media Components framework with embedded ON2 codecs annouced at JavaOne this year, which I hope will support both VP3 and VP6.

    Download here: link

    ReplyDelete
  6. is there any slightest bit of chance that you might adapt that player to mobile phones using j2me platfrom? here is my mail adress if you're interested okseci@gmail.com

    ReplyDelete
  7. That won't be possible with the approach explained here. JavaFX mobile is very likely capable of doing what you need.

    ReplyDelete
  8. This particular blog is really informative. I really may have acquired various extremely desired details.

    ReplyDelete
  9. Thanks very much for this helpfull information! thanks!

    ReplyDelete
  10. Thanks for the info, where i can get the source code for such example.
    I am trying to render Flash video inside a panel.

    ReplyDelete
  11. informative read. thanks for sharing this article.

    ReplyDelete
  12. great info, Guru! :) thanks for sharing..

    ReplyDelete