SlideShare a Scribd company logo
Java (TM)  Media Framework API Vladimir Sakhovski [email_address]
Intro Java Media Framework (JMF) is an API for manipulation and processing of time-based media in Java applications and applets. A key characteristic of time-based media: it requires timely delivery and processing. Strict timing deadlines must be met for receiving and presentation of the data.
Intro (cont) JMF 1.0 API  support for presenting of time-based media. JMF 2.0 API extends by  supporting capturing and storing of media data,  controlling of type of processing during playback,  custom processing on media data streams plug-in API to customize and extend JMF functionality JMF 2.1.1  no changes to the API, updates to the Sun‘s implementation
Intro (cont) JMF RTP APIs are not required by JMF specification Reference implementation of JMF provided by Sun and IBM fully support JMF RTP APIs RTP APIs enable developers to receive, transmit and play RTP streams using JMF
Intro (cont) There are JMF versions for Windows, Solaris, Linux, and pure-Java version (works on any JVM) OS-specific versions should be used to increase performance
JMF data processing model Everyday-life model for operations with time-based media:
JMF data processing model (cont) JMF data processing model
JMF data processing model (cont) JMF data processing model, example
JMF input Input in JMF is generally represented by a  javax.media.MediaLocator  object. MediaLocator  is like an  URL –  it   uniquely identifies a resource in a network Example: media locator  for an RTP session: rtp://address:port[:ssrc]/content-type/[ttl]
JMF input (cont) From  MediaLocator  an instance of  javax.media.protocol. DataSource  object can be created. It represents input data, which is used in  Player s , Processor s and  DataSink s .
JMF processors Input data can be directly rendered to the output destination or some manipulations can be applied before this.  Processor (manipulation) component is represented by an instance of  javax.media.Processor  interface
JMF output The ouput of a  Processor  (just like the input) is presented with the instance of  DataSource.  This way: Processor s can be chained to perform multiple operations on the same media Output from  Processor  can be used as an input to a  Player  or  DataSink  (for rendering to the output destination)
JMF output (cont) Another way to represent output of the JMF process model is with  javax.media.DataSink  interface DataSink  reads media content and renders it to some destination Example: output file, network
Simple audio player Example for a simple program to play a local audio file through  a command-line interface Import import javax.media.*;
Simple audio player (cont) Player private Player audioPlayer = null; public SimpleAudioPlayer(File file) throws IOException, NoPlayerException,  CannotRealizeException { audioPlayer = Manager.    createRealizedPlayer(file.toUrl()); }
Simple audio player (cont) Player  processes an input media data stream and renders it at a precise time. DataSource  is used to deliver the input to the  Player Rendering destination depends on the type of the media (example: speakers, display...)
Simple audio player (cont) A  Player  can be in one of the six states
Simple audio player (cont) To get an instance of the  Player  we use  Manager  class. It acts as a factory for creating many of the specific interface types in JMF, including the  Player  interface audioPlayer = Manager.createRealizedPlayer(file.toUrl());
Simple audio player (cont) Starting/stopping the player public void play() { audioPlayer.start(); } public void stop() { audioPlayer.stop(); audioPlayer.close(); }
Simple audio player (cont) Creating a player in the main() File audioFile = new File(args[0]); SimpleAudioPlayer player = new SimpleAudioPlayer(audioFile); player.play(); ... player.stop();
Simple audio player (cont) Simple (just a few lines of code) No need not to know anything about the media file type to configure a player, everything is handled internally
Simple video player The main difference from the audio player – we must create a visual representation to display the video
Simple video player (cont) Player  has methods to get references to visual components player.getVisualComponent() player.getGainControl() player. getControlPanelComponent()
Simple video player (cont) Controls returned are instances of the  java.awt.Component  class and may be added to the window frame. They are tied directly to the  Player  – any manipulations on controls will have corresponding changes on the media played.
Resources http://java.sun.com/products/java-media/jmf/ 2.0 API Guide  Code Samples and Apps  http://www-106.ibm.com/developerworks/ edu/j-dw-javajmf-i.html

More Related Content

What's hot (20)

PPTX
Sejarah dan Perkembangan OS Mobile Device
Lifia Citra Ramadhanti
 
PPT
Pemrograman non prosedural 1
leni fitriani
 
PDF
Tutorial 3D Max
rezky fadlillah
 
PDF
Push Down Automata (PDA)
dhea zafarina
 
PDF
Java programming-examples
Mumbai Academisc
 
PPTX
Functions in php
Kamal Acharya
 
PDF
Python data handling notes
Prof. Dr. K. Adisesha
 
PDF
How to build a chat application with react js, nodejs, and socket.io
Katy Slemon
 
PPTX
Error managing and exception handling in java
Andhra University
 
PDF
Java applet programming concepts
Victer Paul
 
PPT
Java interfaces
Raja Sekhar
 
PPTX
Manajemen user dan group
Erhyz Ambarak
 
PDF
Studi kelayakan
Fajar Baskoro
 
PPT
OOP in C++
ppd1961
 
PPTX
Constructor and Destructor
Sunipa Bera
 
PPTX
Packages and interfaces
bhuvaneshwariA5
 
PPTX
Inheritance in java
Tech_MX
 
PPT
Thread model in java
AmbigaMurugesan
 
PPTX
metode pengembangan JAD
Rizma Ariyani
 
PDF
OPERASI INPUT OUTPUT di Linux
Ibrahim Naki
 
Sejarah dan Perkembangan OS Mobile Device
Lifia Citra Ramadhanti
 
Pemrograman non prosedural 1
leni fitriani
 
Tutorial 3D Max
rezky fadlillah
 
Push Down Automata (PDA)
dhea zafarina
 
Java programming-examples
Mumbai Academisc
 
Functions in php
Kamal Acharya
 
Python data handling notes
Prof. Dr. K. Adisesha
 
How to build a chat application with react js, nodejs, and socket.io
Katy Slemon
 
Error managing and exception handling in java
Andhra University
 
Java applet programming concepts
Victer Paul
 
Java interfaces
Raja Sekhar
 
Manajemen user dan group
Erhyz Ambarak
 
Studi kelayakan
Fajar Baskoro
 
OOP in C++
ppd1961
 
Constructor and Destructor
Sunipa Bera
 
Packages and interfaces
bhuvaneshwariA5
 
Inheritance in java
Tech_MX
 
Thread model in java
AmbigaMurugesan
 
metode pengembangan JAD
Rizma Ariyani
 
OPERASI INPUT OUTPUT di Linux
Ibrahim Naki
 

Viewers also liked (8)

PPTX
Week3 Quiz Live Lecture 2010
Brent Heard
 
PPTX
Hawk Eye - The smart video surveillance system
Shahid Vadakkekad
 
PPTX
Android Mp3 Player
Chirag Aggarwal
 
PPT
JAVA Media Player
Nausad Ahamed
 
PPT
Java Media Player thorugh JMF
Prashant Singh
 
PPTX
Android mp3 player
Subhrajit Das
 
PPSX
Data Flow Diagram Example
Kaviarasu D
 
PPTX
Dfd examples
Mohit
 
Week3 Quiz Live Lecture 2010
Brent Heard
 
Hawk Eye - The smart video surveillance system
Shahid Vadakkekad
 
Android Mp3 Player
Chirag Aggarwal
 
JAVA Media Player
Nausad Ahamed
 
Java Media Player thorugh JMF
Prashant Singh
 
Android mp3 player
Subhrajit Das
 
Data Flow Diagram Example
Kaviarasu D
 
Dfd examples
Mohit
 
Ad

Similar to Java Media Framework API (20)

PPT
J2me
My Đá
 
PPT
Last videoppt
Manni Singh
 
PDF
mjar
mohit2988
 
PPT
1– Introduction To Direct Show
guest7973cb
 
PPT
Android RTMP client library
Sandeep Marathe
 
PPT
Scmad Chapter12
Marcel Caraciolo
 
PPT
Prasentation Managed DirectX
A. LE
 
PPT
Jsr135 sup
SMIJava
 
PPT
Game programming with Groovy
James Williams
 
PDF
Game Programming I - Introduction
Francis Seriña
 
PDF
Android media
Krazy Koder
 
PPT
Streaming Overview Final.ppt
Videoguy
 
PPT
Streaming Overview Final.ppt
Videoguy
 
PPT
Streaming Overview Final.ppt
Videoguy
 
PPT
Streaming Overview Final.ppt
Videoguy
 
PPT
Android Audio & OpenSL
Yoss Cohen
 
PPT
OpenMAX Overview
Yoss Cohen
 
PPT
Audio and Video streaming.ppt
Videoguy
 
PPTX
Designing of media player
Nur Islam
 
PPTX
Windows Movie Maker , Data about Windows movie making
tiyasolanki20
 
J2me
My Đá
 
Last videoppt
Manni Singh
 
mjar
mohit2988
 
1– Introduction To Direct Show
guest7973cb
 
Android RTMP client library
Sandeep Marathe
 
Scmad Chapter12
Marcel Caraciolo
 
Prasentation Managed DirectX
A. LE
 
Jsr135 sup
SMIJava
 
Game programming with Groovy
James Williams
 
Game Programming I - Introduction
Francis Seriña
 
Android media
Krazy Koder
 
Streaming Overview Final.ppt
Videoguy
 
Streaming Overview Final.ppt
Videoguy
 
Streaming Overview Final.ppt
Videoguy
 
Streaming Overview Final.ppt
Videoguy
 
Android Audio & OpenSL
Yoss Cohen
 
OpenMAX Overview
Yoss Cohen
 
Audio and Video streaming.ppt
Videoguy
 
Designing of media player
Nur Islam
 
Windows Movie Maker , Data about Windows movie making
tiyasolanki20
 
Ad

More from elliando dias (20)

PDF
Clojurescript slides
elliando dias
 
PDF
Why you should be excited about ClojureScript
elliando dias
 
PDF
Functional Programming with Immutable Data Structures
elliando dias
 
PPT
Nomenclatura e peças de container
elliando dias
 
PDF
Geometria Projetiva
elliando dias
 
PDF
Polyglot and Poly-paradigm Programming for Better Agility
elliando dias
 
PDF
Javascript Libraries
elliando dias
 
PDF
How to Make an Eight Bit Computer and Save the World!
elliando dias
 
PDF
Ragel talk
elliando dias
 
PDF
A Practical Guide to Connecting Hardware to the Web
elliando dias
 
PDF
Introdução ao Arduino
elliando dias
 
PDF
Minicurso arduino
elliando dias
 
PDF
Incanter Data Sorcery
elliando dias
 
PDF
Rango
elliando dias
 
PDF
Fab.in.a.box - Fab Academy: Machine Design
elliando dias
 
PDF
The Digital Revolution: Machines that makes
elliando dias
 
PDF
Hadoop + Clojure
elliando dias
 
PDF
Hadoop - Simple. Scalable.
elliando dias
 
PDF
Hadoop and Hive Development at Facebook
elliando dias
 
PDF
Multi-core Parallelization in Clojure - a Case Study
elliando dias
 
Clojurescript slides
elliando dias
 
Why you should be excited about ClojureScript
elliando dias
 
Functional Programming with Immutable Data Structures
elliando dias
 
Nomenclatura e peças de container
elliando dias
 
Geometria Projetiva
elliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
elliando dias
 
Javascript Libraries
elliando dias
 
How to Make an Eight Bit Computer and Save the World!
elliando dias
 
Ragel talk
elliando dias
 
A Practical Guide to Connecting Hardware to the Web
elliando dias
 
Introdução ao Arduino
elliando dias
 
Minicurso arduino
elliando dias
 
Incanter Data Sorcery
elliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
elliando dias
 
The Digital Revolution: Machines that makes
elliando dias
 
Hadoop + Clojure
elliando dias
 
Hadoop - Simple. Scalable.
elliando dias
 
Hadoop and Hive Development at Facebook
elliando dias
 
Multi-core Parallelization in Clojure - a Case Study
elliando dias
 

Recently uploaded (20)

PDF
Novus Safe Lite- What is Novus Safe Lite.pdf
Novus Hi-Tech
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PDF
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
PDF
UiPath vs Other Automation Tools Meeting Presentation.pdf
Tracy Dixon
 
PPTX
Darren Mills The Migration Modernization Balancing Act: Navigating Risks and...
AWS Chicago
 
PDF
CIFDAQ'S Token Spotlight for 16th July 2025 - ALGORAND
CIFDAQ
 
DOCX
TLE9 COOKERY DLL WEEK3 technology and li
jamierha cabaero
 
PPTX
UI5Con 2025 - Beyond UI5 Controls with the Rise of Web Components
Wouter Lemaire
 
PDF
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
PDF
Sustainable and comertially viable mining process.pdf
Avijit Kumar Roy
 
PDF
How a Code Plagiarism Checker Protects Originality in Programming
Code Quiry
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 
PDF
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
PPTX
Top Managed Service Providers in Los Angeles
Captain IT
 
PPTX
The Yotta x CloudStack Advantage: Scalable, India-First Cloud
ShapeBlue
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PDF
GITLAB-CICD_For_Professionals_KodeKloud.pdf
deepaktyagi0048
 
Novus Safe Lite- What is Novus Safe Lite.pdf
Novus Hi-Tech
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
UiPath vs Other Automation Tools Meeting Presentation.pdf
Tracy Dixon
 
Darren Mills The Migration Modernization Balancing Act: Navigating Risks and...
AWS Chicago
 
CIFDAQ'S Token Spotlight for 16th July 2025 - ALGORAND
CIFDAQ
 
TLE9 COOKERY DLL WEEK3 technology and li
jamierha cabaero
 
UI5Con 2025 - Beyond UI5 Controls with the Rise of Web Components
Wouter Lemaire
 
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
Sustainable and comertially viable mining process.pdf
Avijit Kumar Roy
 
How a Code Plagiarism Checker Protects Originality in Programming
Code Quiry
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
Top Managed Service Providers in Los Angeles
Captain IT
 
The Yotta x CloudStack Advantage: Scalable, India-First Cloud
ShapeBlue
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
GITLAB-CICD_For_Professionals_KodeKloud.pdf
deepaktyagi0048
 

Java Media Framework API

  • 1. Java (TM) Media Framework API Vladimir Sakhovski [email_address]
  • 2. Intro Java Media Framework (JMF) is an API for manipulation and processing of time-based media in Java applications and applets. A key characteristic of time-based media: it requires timely delivery and processing. Strict timing deadlines must be met for receiving and presentation of the data.
  • 3. Intro (cont) JMF 1.0 API support for presenting of time-based media. JMF 2.0 API extends by supporting capturing and storing of media data, controlling of type of processing during playback, custom processing on media data streams plug-in API to customize and extend JMF functionality JMF 2.1.1 no changes to the API, updates to the Sun‘s implementation
  • 4. Intro (cont) JMF RTP APIs are not required by JMF specification Reference implementation of JMF provided by Sun and IBM fully support JMF RTP APIs RTP APIs enable developers to receive, transmit and play RTP streams using JMF
  • 5. Intro (cont) There are JMF versions for Windows, Solaris, Linux, and pure-Java version (works on any JVM) OS-specific versions should be used to increase performance
  • 6. JMF data processing model Everyday-life model for operations with time-based media:
  • 7. JMF data processing model (cont) JMF data processing model
  • 8. JMF data processing model (cont) JMF data processing model, example
  • 9. JMF input Input in JMF is generally represented by a javax.media.MediaLocator object. MediaLocator is like an URL – it uniquely identifies a resource in a network Example: media locator for an RTP session: rtp://address:port[:ssrc]/content-type/[ttl]
  • 10. JMF input (cont) From MediaLocator an instance of javax.media.protocol. DataSource object can be created. It represents input data, which is used in Player s , Processor s and DataSink s .
  • 11. JMF processors Input data can be directly rendered to the output destination or some manipulations can be applied before this. Processor (manipulation) component is represented by an instance of javax.media.Processor interface
  • 12. JMF output The ouput of a Processor (just like the input) is presented with the instance of DataSource. This way: Processor s can be chained to perform multiple operations on the same media Output from Processor can be used as an input to a Player or DataSink (for rendering to the output destination)
  • 13. JMF output (cont) Another way to represent output of the JMF process model is with javax.media.DataSink interface DataSink reads media content and renders it to some destination Example: output file, network
  • 14. Simple audio player Example for a simple program to play a local audio file through a command-line interface Import import javax.media.*;
  • 15. Simple audio player (cont) Player private Player audioPlayer = null; public SimpleAudioPlayer(File file) throws IOException, NoPlayerException, CannotRealizeException { audioPlayer = Manager. createRealizedPlayer(file.toUrl()); }
  • 16. Simple audio player (cont) Player processes an input media data stream and renders it at a precise time. DataSource is used to deliver the input to the Player Rendering destination depends on the type of the media (example: speakers, display...)
  • 17. Simple audio player (cont) A Player can be in one of the six states
  • 18. Simple audio player (cont) To get an instance of the Player we use Manager class. It acts as a factory for creating many of the specific interface types in JMF, including the Player interface audioPlayer = Manager.createRealizedPlayer(file.toUrl());
  • 19. Simple audio player (cont) Starting/stopping the player public void play() { audioPlayer.start(); } public void stop() { audioPlayer.stop(); audioPlayer.close(); }
  • 20. Simple audio player (cont) Creating a player in the main() File audioFile = new File(args[0]); SimpleAudioPlayer player = new SimpleAudioPlayer(audioFile); player.play(); ... player.stop();
  • 21. Simple audio player (cont) Simple (just a few lines of code) No need not to know anything about the media file type to configure a player, everything is handled internally
  • 22. Simple video player The main difference from the audio player – we must create a visual representation to display the video
  • 23. Simple video player (cont) Player has methods to get references to visual components player.getVisualComponent() player.getGainControl() player. getControlPanelComponent()
  • 24. Simple video player (cont) Controls returned are instances of the java.awt.Component class and may be added to the window frame. They are tied directly to the Player – any manipulations on controls will have corresponding changes on the media played.
  • 25. Resources http://java.sun.com/products/java-media/jmf/ 2.0 API Guide Code Samples and Apps http://www-106.ibm.com/developerworks/ edu/j-dw-javajmf-i.html