How to play an AVI file in Java

Hi,
Its very URGENT,
please help me in playing AVI(*.avi )files on JWindow or JFrame.
Thanks in Advance

The Player creation
          try {
              File soundFile = new File("sav/audio/B.wav");
               Player player = Manager.createRealizedPlayer(soundFile.toURL());
               player.start();
               player.close();
          } catch (Exception e) {
               e.printStackTrace();
          }After the Player is created you get the Component like so
JFrame frame = new JFrame();
frame.getContentPane().add(player.getVisualComponent());You, of course, have to size the JFrame accordingly, and set it up as you normally would. The "Visual Component" is just like any other component, as it can be added to a panel, etc.

Similar Messages

  • JMF: How to play an  avi file NOT in a Frame...is this possible?

    -----Primary Task------
    Using JMF, I want to play an avi video file NOT in a Frame
    ---------Why?----------
    I want to play this avi file in a "non-decoration" container (ie. no Windows GUI, eg. Window/JWindow, Panel/JPanel)
    -------Problem---------
    The MediaPlayer method in JMF 2.2.1e requires a Frame container, according to JMFUtil.java (eg. mediaplayer = jmapps.util.JMFUtils.createMediaPlayer)
    ------Questions--------
    1. Is there any way to change the method of JMFUtil.java to enable video files to play NOT in a Frame, like a Window or Panel?
    2. If not, do you know of any "tricks" to get rid of the Frame decorations?
    3. If not, any other solutions?

    sigh... first read the API, then ask.
    Frame.setUndecorated(boolean) might help. http://java.sun.com/j2se/1.4.1/docs/api/java/awt/Frame.html#setUndecorated(boolean)

  • How to play .flv, .avi files in Media element c# 2012

    I want to play .flv and .avi extention files in my video player . But it doesnt work. I installed K-lite Codec also. But i am not sure user will installed codecs or not . so i dont want to take risk. So plz help. I know that there is no default plug ins
    for playing .flv or .avi files in c# 2012 .But still i want a helpful reply.
    Thanx in Advance
    Nitikesh Pattnaik

    Nitikesh,
    Sorry but you have posted to a forum that deals exclusively with question/issues about Microsoft Project, a Project management application. I suggest you delete this post and find a more appropriate forum.
    John

  • How to play Windows AVI file using Teststand

    Hi,
    I'm trying to play a Windows AVI (*.avi) file using the Windows Media Player, launched by
    a Teststand CallExecutable type step.
    When the step executes, the Windows Media Player app. starts o.k., but the file to be played
    causes an error which states the file type is not recognised.
    Yet if the AVI file is selected in Windows Explorer, it runs fine, i.e. the file type is associated with
    Windows Media Player.
    If the 1st error is ignored, a 2nd is displayed. This states the file cannot be played, and suggests that
    the path may be incorrect or the server is unavailable.
    When configuring the Teststand CallExecutable step, the Argument Expression field contains the full
    absolute address of the AVI (*.avi) file to load and play.
    I have also tried using an expression and also placing the AVI file in the same directory as the
    Windows Media Player .exe, but the file will still not play.
    If I use the Run utility from the Windows Start menu, I can enter the same details on a single command
    line, and the AVI (*.avi) loads and plays just fine.
    What should I do to get Windows Media Player to run the AVI (*.avi) file using the Teststand CallExecutable step ?
    thanks,
    Gary.

    Gary -
    FYI, with TS 3.5, the MessagePopup step can also display html files. The html file can reference the player control and tell it to run immediately. The html code looks like this:
    <HTML>
    <HEAD>
    <TITLE>Multimedia Control Page</TITLE>
    </HEAD>
    <BODY LANGUAGE = VBScript>
    <p>
    My header text
    <p>
    <object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA​6" id="WindowsMediaPlayer1" width="300" height="200">
     <param name="URL" value="c:\windows\clock.avi">
     <param name="rate" value="1">
     <param name="balance" value="0">
     <param name="currentPosition" value="0">
     <param name="defaultFrame" value>
     <param name="playCount" value="1">
     <param name="autoStart" value="-1">
     <param name="currentMarker" value="0">
     <param name="invokeURLs" value="-1">
     <param name="baseURL" value>
     <param name="volume" value="50">
     <param name="mute" value="0">
     <param name="uiMode" value="full">
     <param name="stretchToFit" value="-1">
     <param name="windowlessVideo" value="0">
     <param name="enabled" value="-1">
     <param name="enableContextMenu" value="-1">
     <param name="fullScreen" value="0">
     <param name="SAMIStyle" value>
     <param name="SAMILang" value>
     <param name="SAMIFilename" value>
     <param name="captioningID" value>
     <param name="enableErrorDialogs" value="0">
    </object>
    </p>
    My footer text
    </BODY>
    </HTML>
    Scott Richardson
    National Instruments

  • How to play a AVI video file in Nokia 5230

    Hi, Can anybody please tell me the procedure how to play a avi file in Nokia 5230.Thx in advance.

    5230 can't play .avi files out of the box you need to install application like smartmovie player or core player to play it. These two, unfortunately, aren't free. A work around is to convert .avi files to .mp4 format using a video converter like Super by erightsoft(google for it).
    If a reply has solved your problem click Accept as solution button, doing it will help others know the solution. Thanks.

  • How can the Windows Media Player 12 be made to play WVC210 .avi files?

    I just built a new computer and it won't play the motion captured videos of the WVC210. It has Windows 7 Home Premium as the operating system. My machines running XP play the WVC210 files GREAT. Is there a codec I can add to the WMP12 so that it will play the .avi files. I have 3 cameras around the property, 2 WVC210 and 1 WVC200. 1 camera has the audio turned off so switching to MP4 (no audio) made that work OK. But the camera in the office I need to have audio and would rather stick to WMP over something like VLC. VLC plays the files fine but I much prefer WMP. I'm hopeing to find out how to have Windows Media Player 12 play the .AVI files from the WVC210 cameras. Any Help??

    There appears to be issues with codecs on WMP 12 and Windows 7
    AND\OR your WMP is missing the necessary codecs.
    Google the Net and you should find different things to try
    for the WMP 12.
    Troubleshoot problems in Windows Media Player
    http://windows.microsoft.com/en-US/windows-vista/Troubleshoot-problems-in-Windows-Media-Player
    It looks like additional codecs may needed to download with WMP12 and windows 7
    http://www.tech-exclusive.com/2009/01/22/download-windows-7-codec-pack-for-windows-media-player-12/
    Media Feature Pack for Windows 7 N and Windows 7 KN (KB968211)
    http://www.microsoft.com/downloads/details.aspx?FamilyID=31017ed3-166a-4c75-b90c-a6cef9b414c4&displaylang=en
    Information about the Multimedia file types that Windows Media Player supports
    http://support.microsoft.com/kb/316992
    Another possible solution:
    K-Lite Codec Pack 5.9.0 Full, Standard and Basic
    http://www.free-codecs.com/download/K_Lite_Codec_Pack.htm
    I hope this helps let us know how it goes!
    T.

  • My QuickTime player us not playing .avi files and says I need a codec I can't play no .avi files on QuickTime. How could I fix this because I want to play these files with QuickTime.

    My QuickTime player us not playing .avi files and says I need a codec I can't play no .avi files on QuickTime. How could I fix this because I want to play these files with QuickTime.

    Hmm . . . comes with a Utility MPEG2 Component ML app with no explanation of what it's for?
    The utility app is an "assistant PKG installer." It allows Lion and Mountain Lion users to install the older QT MPEG-2 Playback Component installer PKG file which is not allowed to run on its own under Lion or Mountain Lion since these operating systems already have a QT X only MPEG-2 component embedded in the QT embedded structure. Without this utility you would have to either copy the component from an older system to your Lion or Mountain Lion system, use Pacifist for installation, or manually open the PKG contents and transfer the component to the appropriate component folder.
    As to your "discussion" regarding the playback of AVI file types, there are really only two strategies here:
    1) You can add component support so that QT can play the files natively or
    2) You can convert the file contents to compression formats that are natively compatible with the unmodified QT component configuration.
    Each user should decide for his or her own self which approach best suits their needs for a particular source file. In most cases, conforming the system's codec component configuration to play the source file directly results in higher video quality since no transcoding takes place but this strategy will not work if a codec which is required is not available for the user's operating system. On the other hand, converter utilities tend to support more built-in codecs and are easier to use since the user does not have to concern him or herself with the nature of the particular source compression formats but at the risk of some potential loss in visual quality. As to what converter to use, once again this is a matter of personal choice. In the case of commercial converters like iSkysoft, the codecs are built in while MPEG Streamclip accesses the host operating system's QT codec component configuration. I personally prefer the free HandBrake app for AVI, MKV, TS, MTS, and M2TS conversions since it has an exceptionally full-featured X.264 GUI with some user options that 97% of users are likely to never use.

  • How to play mkv,avi,mov format files on ipad

    How to play mkv,avi,mov format files on ipad

    Install free OPlayer Lite and try.
    https://itunes.apple.com/sg/app/oplayerhd-lite-best-free-video/id385896088?mt=8

  • How to call a .bat file from java code?

    How to call a .bat file from java code? and how can i pass parameters to that .bat file?
    Thanks in advance

    thanks for ur reply
    but still i am getting the same error.
    I am trying to run a .bat file of together tool, my code looks like below
    import java.lang.Runtime;
    import java.lang.Process;
    import java.io.File;
    class SysCall{
         public static void main(String args[]){
              String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
              //String path="D://Borland//Together6.2//bin//Together.bat ";
              Runtime r= Runtime.getRuntime(); //Declare the system call
              try{
                   System.out.println("Before batch is called");
                   Process p=r.exec(cmd);
                   System.out.println(" Exit value =" + p.exitValue());
                   System.out.println("After batch is called");
              /*can produce errors which must be caught*/
              catch(Exception e) {
                   e.printStackTrace();
                   System.out.println (e.toString());
    I am getting the below exception
    Before batch is called
    java.lang.IllegalThreadStateException: process has not exited
    at java.lang.Win32Process.exitValue(Native Method)
    at SysCall.main(SysCall.java:17)
    java.lang.IllegalThreadStateException: process has not exited

  • How to create a Batch file for java application  ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    [http://static.springsource.org/spring-batch/]
    Assuming you want to develop a batch application rather than actually just create a .bat file ..

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

  • I have a seagate 1tb hard drive and a 16gb memory stick, how do i transfer avi files from one to another as the click drag and drop wont work, please help?

    i have a seagate 1tb hard drive and a 16gb memory stick, how do i transfer avi files from one to another as the click drag and drop wont work, please help?

    Greetings,
    What happens when you drag it?
    Make sure the drive you are moving the files to has enough available space to receive the file:
    Click on the movie file and go to File >  Get Info and note the "size"
    Check the drive to which you are moving the file to make sure it has enough available space: https://idisk.me.com/madisonfile-Public/web/finder-drive-available-space-and-for mat.html
    Also note the format of the drive you are copying too.  If it is not Mac OS Extended or FAT (not recommended unless you are taking it to a windows computer) then that may be the issue.
    Hope that helps.

  • How to create the exe file for java project.

    How to create the exe file for java project.
    am done the project in java swing , i like to create the project in exe format, so any one help for me,
    send the procedure for that.
    thanking u.

    How to create the exe file for java project.Have you ever heard of google? I pasted your exact "question" into a google search:
    http://www.google.com/search?q=How+to+create+the+exe+file+for+java+project.
    and got several useful links.
    Better search terms might yield even better results.
    Sheesh.

  • How to read a text file using Java

    Guys,
    Good day!
    Please help me how to read a text file using Java and create/convert that text file into XML.
    Thanks and God Bless.
    Regards,
    I-Talk

         public void fileRead(){
                 File aFile =new File("myFile.txt");
             BufferedReader input = null;
             try {
               input = new BufferedReader( new FileReader(aFile) );
               String line = null;
               while (( line = input.readLine()) != null){
             catch (FileNotFoundException ex) {
               ex.printStackTrace();
             catch (IOException ex){
               ex.printStackTrace();
         }This code is to read a text file. But there is no such thing that will convert your text file to xml file. You have to have a defined XML format. Then you can read your data from text files and insert them inside your xml text. Or you may like to read xml tags from text files and insert your own data. The file format of .txt and .xml is far too different.
    cheers
    Mohammed Jubaer Arif.

  • How to Read a CAB File from JAVA?

    Hi,
    Anyone knows how to read a CAB File from java. I need to read a property file of txt file that is packaged in CAB file & then based on that, I have to do processing. Is there anyway to do it.
    I had tried using java.util.zip.ZipFile Class, but it does work for JAR, but not for CAB.
    siva.

    Perhaps there's something in the Cabinet SDK that will help:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncabsdk/html/cabdl.asp

Maybe you are looking for