Want to change frame rate, help, please !!

hi all,
i want to know whether, jmf does provide any support for changing the frame rate ? is there any ways by which one can change the framerate, of a live captured video ?
i came across one class "FrameRateControl" in jmf, tried it, but wasn't successful in changing the frame rate. plz help me guys.
if u have came across, when doing live capturing using jmstudio, we can change the frame rate. can we do that in our programs tooo.
please someone, wew64, watergad.......... help me out..........,
thanks for ur help.
niraj.

the code is here and it is working on windows, but the framerate could not be changed on linux. it keeps saying rcFormat is null on linux. Then I try to change the framerate with JMStudio, it doest not make any difference as well, it seems keep playing the video with preferred frame rate as well. Any ideas?
import java.applet.Applet;
import java.awt.*;
import java.io.*;
import java.net.*;
import javax.media.*;
import javax.media.cdm.CaptureDeviceManager;
import javax.media.control.*;
import javax.media.format.VideoFormat;
import javax.media.util.BufferToImage;
import javax.media.protocol.*;
import javax.swing.*;
import java.util.*;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
public class TVCapture extends Applet {
static Player player = null;
Format [] formats;
     FormatControl [] vfc = null; // Video FormatControl
     CaptureDevice vcd = null; // Video CaptureDevice
     private DataSource vds = null; // Video DataSource
     public void init(){
          try {
               vds = Manager.createDataSource(new MediaLocator("v4l://0")); //on linux
//               vds = Manager.createDataSource(new MediaLocator("vfw://0")); //on windows
          } catch (java.io.IOException _e)   {
               System.out.println(_e);
          } catch (NoDataSourceException _e) {
               System.out.println(_e);
          vcd = (CaptureDevice)vds;
          vfc = vcd.getFormatControls();
          if (vfc != null) {
               System.out.println("vfc ! = null");
               System.out.println("vfc[0] = " + vfc[0]);
               System.out.println("vfc.length = " + vfc.length);
               System.out.println("vfc[0].getFormat = " + vfc[0].getFormat());
               Format [] supportedFormats = vfc[0].getSupportedFormats();
               int i;
               for (i=0; i< supportedFormats.length; i ++) {
     System.out.println("supportedFormats["+i+"]=" + supportedFormats);
//               Format tmpFormat = vfc[0].setFormat(supportedFormats[6]);
               Format tmpFormat = supportedFormats[6];
               System.out.println("tmpFormat = " + tmpFormat);
               System.out.println("tmpFormat.getEncoding() = " + tmpFormat.getEncoding());
               System.out.println("Dimension size =" + ((VideoFormat)tmpFormat).getSize());     
               System.out.println("maxDataLength =" + ((VideoFormat)tmpFormat).getMaxDataLength());     
               System.out.println("tmpFormat.getDataType() = " + tmpFormat.getDataType());
               System.out.println("frameRate = " + ((VideoFormat)tmpFormat).getFrameRate());
               VideoFormat videoFormat = new VideoFormat( tmpFormat.getEncoding(),
                                                  ((VideoFormat)tmpFormat).getSize(),
                                                                 ((VideoFormat)tmpFormat).getMaxDataLength(),
                                                                 tmpFormat.getDataType(),
                                                                 25.0f);
               Format rcFormat = vfc[0].setFormat(videoFormat);
               System.out.println("rcFormat = " + rcFormat);
               //it seems rcFormat is null on linux
               //but setFormat is working on windows
          } else {
               System.out.println("cannot get the formatControls()");
          setLayout(new BorderLayout());
          setSize(320,240);
          try {
//      player = Manager.createRealizedPlayer(new MediaLocator("v4l://0"));
player = Manager.createRealizedPlayer(vds);
player.start();
Component comp;
if ((comp = player.getVisualComponent()) != null) {
     add(comp,BorderLayout.NORTH);
//               add (player.getControlPanelComponent());
} catch (Exception e) {
e.printStackTrace();
public static void playerclose() {
          if(player != null) {           
     player.close();
     player.deallocate();
public void close() {
          if(player != null) {
               player.close();
public void destroy() {
          if (player != null) {
          player.close();
          player.deallocate();
public void stop() {
          if (player != null ) {
          player.stop();

Similar Messages

  • I want to play video on my computer to make some analysis to frames,the problem that I face ,I can't change video frame rate using labview,but I can change frame rate to the video out of labview using some program

    HI All
    I want to play video on my computer to make some analysis to it's frames,the problem that I face ,I can't change video frame rate using labview,but I can change frame rate to the video out of labview using some program .
    I used IMAQ AVI Read Frame VI
    for example I have avi video It's frame rate is 25 fbs ,my image processing code is very fast that can process more 25 fbs,so I want to accelerate video acquisition

    Hi abdelhady,
    I looked into this further, and reading an AVI file into LabVIEW faster than its frames per second won't be possible. LabVIEW could read in frames faster than 25fps, but because it will be pulling the available frame at that point in time this would just give you duplicate frames. If you want to be able to read in frames at faster than 25fps, you would need to speed up your AVI file before reading into LabVIEW.
    There's a good shipping example to show how to read in from an AVI file, "Read AVI File.vi". You'll notice that they add timing to make sure that the while loop runs at the right speed to match up with the frames per second of the file being read. This is to make sure you're not reading duplicate frames.
    Thank you,
    Emily C
    Applications Engineer
    National Instruments

  • HT1918 I have $0.15 left in my account and I want to change to south african store but it says I must finish my balance before I change...help please.

    I have $0.15 left in my account and I want to change to south african store but it says I must finish my balance before I change...help please.

    If you can't spend it then you can try contacting iTunes Support and ask the if they can remove the balance so that you can change countries : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • Support MIDI and dynamic change FRAME RATE

    What MACROMEDIA says about support by FLASH, midi files and
    dynamic change FRAME RATE of the movie?
    this is two nuances that does not suffice me.
    And what about macromedia FLASH 9? When it comes?

    For dimension changing use something like this (is a part of a bash script for video edition so ...) :
    # Le quitamos el over-scan al ancho. OJO!! debe seguir siendo MULTIPLO de OCHO
    WIDTH_SCALED=$(($OUTPUT_V_WIDTH-$OUTPUT_OVS*8)) #multiplicamos el overscan por 8(4 pixeles a cada lado)
    # Obtenemos relacion de aspecto de forma mas precisa
    if [ "$OUTPUT_V_ASPECT" == "1.7777" ]; then # formato panoramico
    ASPECT_PRECISE=`echo "16/9"| bc -l`
    else
    ASPECT_PRECISE=`echo "4/3"| bc -l` # y el formato normal
    fi
    HEIGHT_SCALED=`echo "(${INPUT_V_HEIGHT}*${OUTPUT_V_HEIGHT}*${ASPECT_PRECISE})/${INPUT_V_WIDTH}"| bc -l`
    # Necesito que el alto sea MULTIPLO DE CUATRO para que la longitud del PADDING sea PAR y simplificar el codigo... introduzco un error de 3.999999 pixels (en el peor de los casos)
    HEIGHT_SCALED=$((`echo "scale=0 ; $HEIGHT_SCALED/4"| bc -l`*4))
    # Calculo el Padding
    OUTPUT_V_PAD_WIDTH=$(($OUTPUT_OVS*4))
    OUTPUT_V_PAD_HEIGHT=`echo "scale=0 ; ($OUTPUT_V_HEIGHT-$HEIGHT_SCALED)/2"| bc -l`
    Don't bother about the comments . Is spanish .
    What you want is :
    HEIGHT_SCALED=`echo "(${INPUT_V_HEIGHT}*${OUTPUT_V_HEIGHT}*${ASPECT_PRECISE})/${INPUT_V_WIDTH}"| bc -l`
    About frame rate - this is video edition and i think you can not do this in java . Is more complicated than a simple calc . Under linux i'm using ffmpeg to change fps and encode from avi to mpeg2 .

  • Audio out of sync after changing frame rate

    Hello
    I just changed frame rate from 23.976fps to 24fps inside sequence setting, and the audio is out of sync in timeline.  I can certainly manually right click mouse and choose slip into sync, but it's a tedious job.  Anyone knows why and quick solution?
    Thanks
    Richard
    ps I use 2014.2 latest version

    >Frame rate mode                  : Variable
    No version of Premiere does "well" with Variable Frame Rate
    Below is about iphone, but may help
    Some people find that Iphone won't edit easily because it uses a variable frame rate
    - A possible fix in message #22 http://forums.adobe.com/thread/934466

  • I Want to change depreciation rate

    Hi
    i am in sep'09 and i want to change depreciation rate for few assets from April'09.
    what is the procedure ???
    thanx in advance
    sanju

    Please search the forum, there are lots of threads on this.
    And please do not post duplicate threads.

  • I downloaded a movie on my apple tv and now when I try to watch it tells me there is an error and to try later.  I have tried several times over the last 5 days and nothing changes.  Any help please?

    I downloaded a movie on my apple tv and now when I try to watch it tells me there is an error and to try later.  I have tried several times over the last 5 days and nothing changes.  Any help please?

    What is your current connection via speedtest.net
    Make sure DNS is set to auto (settings - general - network)
    If on wifi try ethernet

  • Changing frame rate when exporting from iMovie '09 using quicktime has no impact on duration.  Why?

    Changing frame rate when exporting from iMovie '09 using quicktime has no impact on duration.  Why?
    I have a file created by digitizing an 8mm film at a rate of 24 fps. I would like to create a downloaded movie at a frame rate of 15 fps.  The Export using Quicktime option seems to provide that capability but the resulting file has the same duration as the original 24 fps file.  How can I get the exported movie to be slowed down?

    joegez,
    There is a feature you can use to slow down the video. In the project, move the mouse pointer over the clip, then click the gear icon. That brings up the Inspector. Click the Clip tab. Then you will see a feature there called Speed. Move the slider to the left to slow down the clip. Or you can enter a percentage in the box on the right.
    Hope this solves the problem for you.

  • I accidentally signed up to download the Windows version of Adobe Acrobat Pro but I actually want the Mac version. Help please!

    I accidentally signed up to download the Windows version of Adobe Acrobat Pro but I actually want the Mac version. Help please!

    Downloads available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 |12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7
    Lightroom:  5.6| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.window using the Lightroom 3 link to see those 'Important Instructions'.

  • HP Pavilion Slimline s5-1414 Accidentally changed frame rate.

    Hi I'm new to this computer got it earlier in the year but never reaally tried it till now. My problem is that I changed the framerate from 60 to 120 fps and now i have no video. How do i fix this? I tried 2 different monitors one which is a pretty old one and the other was an Lg tv which states invalid format. the monitors also seem to have not worked while I'm starting up the computer what should I do to fix this?

    Hi phz19,
    Welcome to the HP Community! Are you referring about the refresh rate on your monitor? Frame rate is something that you can't really modify directly other then changing some settings which will effect it but you can change the refresh rate directly. Do you get anything on the screen at all when you turn on the Pavilion or does it just stay blank?
    Thank you,
    Please click “Accept as Solution ” if you feel my post solved your issue.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Thank you,
    BHK6
    I work on behalf of HP

  • HOW DO I CHANGE FRAME RATE IN iMOVIE 10.0.5?

    WHERE IS THE OPTION TO CHANGE THE FRAME RATE OF A VIDEO IN iMOVIE 10.0.5? I JUST CAN NOT FIND IT, IT USED TO BE ON THE BAR IN THE OPTION OF PROJECT PROPERTIES BUT IT IS NOT THERE ANYMORE, PLEASE HELP.

    The DV specification is to use drop frame TC. Unless you have a camera that's switchable all DV NTSC will be drop frame, which is why FCE works in drop frame. This is not a function you can switch in FCE. You would need to work with Final Cut Pro to get this functionality.

  • PrE 9.0 wont let me share as H.264 1280x720p 29.97 fps - keeps changing frame rate

    As the title says I am unable to create an export with the following settings:
    H.264
    1280x720p
    29.97 (or 30, neither possible) fps
    I have tried editing the existing H.264 presets but the following happens:
    I go into Share > Computer > MPEG and select the Preset "H.264 1440x1080i 30" then hit the "Advanced" button.
    All I want is to change the resolution to match my project size, 1280x720 which I do - but then something happens
    As soon as I change "Frame Dimensions (pixels)" to 1280x720, the fps is automatically changed to 59.94 and when I click the dropdown box for the frame rate, I can only pick the following:
    23.976
    24
    59.94
    Automatic (based on source)
    Since I can't pick 30 or 29.97 I tried picking Automatic but that sets it to 23.976 - even though it clearly states that my source is at 29.97 fps...
    At this point I don't really know what else to try and any help is appreciated.
    Thanks
    EDIT: Just thought I'd also mention that the source is from a GoPro Hero HD cam which shoots in 1280x720 H.264 AVC so I did select "NTSC AVCHD LITE 720p30" as the project profile
    EDIT2: Found Bill Hunt's premade profiles for the GoPro and Premiere Pro. Trying them out right now and it seems to be working. But I still cannot create a profile with 29.97 fps at 1280x720 myself

    With certain file formats and codecs, you will be limited in the configuration of size or frame rate. It sounds like the output format you've selected is one of them.
    Try going to Share/Computer/MOV and see if that makes a difference.

  • How to export a flash project with a changing frame rate to a video

    I have a Flash project that is a series of roughly 1000 images.  The result of the images is a simple animation, and there is music imported on a separate layer.
    There are moments in the music that I wanted to line up with certain frame changes, and there are sections of the music that I wanted to match up with a faster (double-time) frame rate.
    I used this code in several places in the a code layer:
    stage.frameRate = x;
    The result is exactly what I want in SWF -- the animation speeds up and slows down at the exact right moments to match up with the music track, but it seems like it's just not possible to export this variable frame rate project to a video file?
    According to the accepted answer on this post: http://forums.adobe.com/message/4019538, it seems that:
    The export function in Flash Pro doesn't transcribe *frames*, rather it plays the Flash animation and records it like a camcorder
    If that's true, then I would think there is a way to record a variable frame rate project into a video -- does anybody know if this is possible?

    That or Premiere would both get the job done. After Effects might be more desirable as it has a feature called Time Remapping (right-click on the video layer, Time->Enable Time Remapping). You can add keyframes to any point in a video and then drag them around to speed up or slow down the video. That'll allow for very precise tweaks.
    Finally all I'd suggest is when you jump into your next project, make a quick dummy test project to see if the software you're using is easily capable of producing what you want. It'll solve the headache of completing the project only to land where you are now. Now you know Flash won't play nicely with scripts and Export Movie. If your desired end result was always a video I'd probably use video editing software to make the video. There's some free stuff out there if you really look, but no, it won't be as nice as After Effects or Premiere by any stretch. Although when you see how amazing After Effects is, you'll probably want to buy it .

  • Change Frame Rate in Adobe Presenter

    I have a Flash File that runs with 12 Frames Per second and I need to integrate this with Adobe Presenter. The Frame Rate for Adobe Presenter is 30 Frames Per Second. Here is where I am facing an issue.
    Is there a way to change the frame rate for Adobe Presenter??
    Thanks in advance

    Nope.  Unless you want to get into reconfiguring the viewer.swf and other associated swf files, you're pretty much stuck w/ the 30fps setting.
    Rob
    http://www.robrode.com/yabb/

  • FrameRateControl to change frame rate

    I have created code that runs on both Linux and windows.
    The purpose of this code is to change the frame rate of capture device(webcam).
    I have created a processor, and player, get FrameRateControl, and use setFrameRate(5.0f).
    I have tried multiple combinations, just processor, just player, etc. and tried setting frame rate to different number, without success.
    stopping processor, stopping player, setting frame rate, the starting again, and frame rate does not change!!
    I have even created a ProcessorModel, with one format, specified frame rate, but still doesn't change.
    Any one have ideas, or suggestions????
    I can post code, but has lots of comments, and is messy, just a warning.

    tcp packets are always waiting for ack thats why performance are low - and the error correction mechanizem ensuring data will reach his destination is also not helping you -
    you will have to use udp - (rtp/udp)
    contact me for more info
    [email protected]

Maybe you are looking for

  • I am running OS X Version 10.5.8.  What is the next step to upgrading the operating system?

    Need to upgrade operating system.  What is next steps if currently running 10.5.8?

  • Difference between ODAC 11.1.0.7 and Win32_11gR1_client

    Hi, What is the difference between the two installations? If I need ODP for .NET components and install Oracle 11g ODAC 11.1.0.7.20 software, then do I miss any components which are part of Win32_11gR1_client download? Thanks for any help,

  • Downgrade Front Row to 1.3 under Leopard...

    If you guys like Leopard, but hate the new Front Row...then just downgrade Front Row. Move 'front row.app' away from the /System/Library/CoreServices/ (to a safe folder if you want to go back) Download: http://www.apple.com/support/downloads/frontrow

  • Hi :3

    ok, this is my very first question here. i'm having a problem with my internet connection on my dell inspiron laptop. when i connect to my home network it works fine for like a minute and then an exclamation mark shows under the network strength bars

  • MY CPU is extera slow

    I (have) a 06' iMac (and another one same model, even more memory taken up at a different house is not doing this) that has 131 GB free and has been extera slow in the last 4 months help!!!!! Message was edited by: crazy person