I don't get what is going on here. The avi file loads fine and starts playing. It even prints out the println in the console and shows the correct frame rate of the avi file
Time duration = mediaPlayer.getDuration();
float frameRate = frc.getFrameRate();
If you can help it would be most welcome as seeking to a particular frame is the most important function that I need for my application and without a way of getting the frame rate I cannot deduce the frame to move to given the time.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-07-14
my code playing an m4v file gives this output:
Creating processor, please wait
Fobs4JMF - Native shared library found
176.727First Position: 0, 0 Duration: 176727
Frame Rate: 29.97
Putting processor into configured state
Opening Thread[JMF thread: com.sun.media.ProcessEngine@b89838 ( configureThread),9,system]
Configuring as a player
getting track controls
get format and track controls
Video format: FFMPEG_VIDEO, 640x480, FrameRate=29.9, Length=307200 0 extra bytes
Instantiate and set the frame access codec to the data flow path
Realize the processor
Fobs Java2DRenderer: setInputFormat
Fobs Java2DRenderer: setInputFormat
Try to retrieve a FramePositioningControl from the player
Fobs Java2DRenderer: start
Player Started
my code:
System.err.println("Try to retrieve a FramePositioningControl from the player");
fpc = (FramePositioningControl)p.getControl("javax.media.control.FramePositioningControl");
if (fpc == null) {
System.err.println("The player does not support FramePositioningControl.");
return false;
}
returns a non-null fpc.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't get what is going on here. The avi file loads fine and starts playing. It even prints out the println in the console and shows the correct frame rate of the avi file
Fobs4JMF - Native shared library found
8298.08First Position: 0, 0 Duration: 8298083
Frame Rate: 24
Opening Thread[JMF thread: com.sun.media.PlaybackEngine@81ca25 ( configureThread),9,system]
Fobs Java2DRenderer: setInputFormat
Fobs Java2DRenderer: setInputFormat
Fobs Java2DRenderer: start
If I however call getFrameRate on the FrameRateControl as shown below. It returns 0.
fpc = (FramePositioningControl)mediaPlayer.getControl("javax.media.control.FramePositioningControl");
frc = (FrameRateControl)mediaPlayer.getControl("javax.media.control.FrameRateControl");
Time duration = mediaPlayer.getDuration();
float frameRate = frc.getFrameRate();
If you can help it would be most welcome as seeking to a particular frame is the most important function that I need for my application and without a way of getting the frame rate I cannot deduce the frame to move to given the time.
Thanks
my code playing an m4v file gives this output:
Creating processor, please wait
Fobs4JMF - Native shared library found
176.727First Position: 0, 0 Duration: 176727
Frame Rate: 29.97
Putting processor into configured state
Opening Thread[JMF thread: com.sun.media.ProcessEngine@b89838 ( configureThread),9,system]
Configuring as a player
getting track controls
get format and track controls
Video format: FFMPEG_VIDEO, 640x480, FrameRate=29.9, Length=307200 0 extra bytes
Instantiate and set the frame access codec to the data flow path
Realize the processor
Fobs Java2DRenderer: setInputFormat
Fobs Java2DRenderer: setInputFormat
Try to retrieve a FramePositioningControl from the player
Fobs Java2DRenderer: start
Player Started
my code:
System.err.println("Try to retrieve a FramePositioningControl from the player");
fpc = (FramePositioningControl)p.getControl("javax.media.control.FramePositioningControl");
if (fpc == null) {
System.err.println("The player does not support FramePositioningControl.");
return false;
}
returns a non-null fpc.
I am lost. You get the frame rate from a FrameRateControl not a FramePositioningControl ?
Is this forum dead. eg are any Devs from the Fobs4jmf actually posting on here ?