Media Format Conversion using JMF

Hi All,
Does anyone have idea how to convert one media format to another media format using JMF For eg .avi to .wav etc
I want some basic demo code for it.
Thanks,
~Ketan.B.Parekh
Edited by: ketanbparekh on Nov 28, 2007 6:12 AM

Hi All,
Does anyone have idea how to convert one media format to another media format using JMF For eg .avi to .wav etc
I want some basic demo code for it.
Thanks,
~Ketan.B.Parekh
Edited by: ketanbparekh on Nov 28, 2007 6:12 AM

Similar Messages

  • Advanced Format Conversion - PAL - NTSC question

    I need to convert from DV PAL (@ 25fps) to DV NTSC (@ 23.98fps).
    My first test conversion resulted in a DV file running at 29.97 fps.
    Also, I seem unable to modify the speed settings in order to re-time from PAL to NTSC, which should run approximately 4% longer.
    Can somebody guide me through how to achieve this?
    G5, dual 2.7   Mac OS X (10.4.9)   Final Cut Studio 2.0

    Marc:
    AFAIK standard DV NTSC is 23.97 fps, why do you need 23.98?
    The best free way I found is with Compressor Advanced format conversion, using the settings you'll find in this thread posted by Andynick:
    http://discussions.apple.com/thread.jspa?messageID=3055477&#3055477
    Export your timeline as Quicktime Movie, same settings (self contained if you have space) and use that in Compressor.
    Hope that helps !
      Alberto

  • Converting from VHS to Digital Media - best digital encoding format to use

    Looking for a little insight into the VHS to digital media world.
    I have several VHS tapes (~30) which I would like to convert to digital media for further editing. From what I can find online most “Home Movie” conversion companies encode to mpeg2 on a DVD.
    I have done some of my own VHS to DV format conversions but has many of you know this is very time consuming and I would like to locate a company that can convert my VHS to DV and return back to me on a hard drive. In addition I have taken these conversion edited them in FCE and made DVDs in iDVD. Now I am looking to outsource the conversion process.
    I am looking to have delivered the raw DV converted file from the VHS conversion. Does anyone know of a reputable / reliable Conversion Company that can supply this service?
    If you think I am going down the wrong road in asking for the raw DV files please let me know and explain what you feel the best alternative is so I can edit in FCE and why this or that method is better, just as good, or is done as raw DV files from VHS tapes are just not required for some reason.
    If this is the case what is the best digital file to be working / editing with in FCE? The file format I should be asking for from a video conversion company.
    Thank you,
    Keith

    Some thoughts, all of which you may have already considered:
    Each hour of video will produce around 13GB of QuickTime files, so thirty two-hour VHS tapes would consume almost 400GB.
    Thirty DVDs will be a lot less expensive than a 500GB hard drive.
    Given the native resolutions of the different formats, my guess is that, if you had your VHS tapes converted to DVD, then converted those files to QuickTime for use in FCE, you'd have a hard time distinguishing that footage from what you'd get by capturing directly to QuickTime from those same VHS tapes. It might be interesting to do a comparison.

  • Problem with Transmitting media using JMF

    Hello Everyone !!
    I am working on an application called SIPSpeaker which listens for incoming calls, answer the call and plays a message. I am done with the first two parts of the application, i.e. it can successfully answers the call. I am now facing problem with transmitting audio to the SIP Phone (the caller). I am using JMF and I am trying to send the audio over RTP.
    My code looks something like this....
    locator = new MediaLocator("rtp://130.237.214.124:" + port + "/audio");
            f = new File("C:/1.wav");
            try {
                ds = Manager.createDataSource(f.toURL());         
            } catch (NoDataSourceException ex) {
                ex.printStackTrace();
            } catch (MalformedURLException ex) {
                ex.printStackTrace();
            } catch (IOException ex) {
                ex.printStackTrace();
            format = new Format[]{new AudioFormat(AudioFormat.GSM_RTP,8000,8,1)};
            contentDesc = new ContentDescriptor(ContentDescriptor.RAW_RTP);
                    processor = Manager.createProcessor(ds);
                    waitForState(processor,Processor.Configured);
                    processor.setContentDescriptor(contentDesc);
                    processor.getTrackControls()[0].setFormat(format[0]);
                    waitForState(processor,Processor.Realized);
    try {
                sink = Manager.createDataSink(processor.getDataOutput(),locator);
                System.out.println("6");
            } catch (NotRealizedError ex) {
                ex.printStackTrace();
            } catch (NoDataSinkException ex) {
                ex.printStackTrace();
    processor.start();
            try {
                sink.open();
                sink.start();
            } catch (SecurityException ex) {
                ex.printStackTrace();
            } catch (IOException ex) {
                ex.printStackTrace();
               we are required to work with a .wav file as input ....
    i am new to java and to JMF and i have absolutely no idea whats going wrong...
    please help me
    Regards,
    Sanjay !!

    Hello
    following is the error i get
    Failed to realize: com.sun.media.ProcessEngine@618d26
    Cannot build a flow graph with the customized options:
    Unable to transcode format: mpeglayer3, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed, 16000.0 frame rate, FrameSize=32768 bits
    to: mpegaudio/rtp, 8000.0 Hz, 8-bit, Mono
    outputting to: RAW/RTP
    Error: Unable to realize com.sun.media.ProcessEngine@618d26
    what could be the problem ???

  • How do I do this to use OVerdrive media on deviceThe Apple device must be formatted for use with Microsoft Windows.  The iTunes setting 'Manually manage music-' must be enabled for the device before you can complete the transfer.

    I cannot make these directions work
    I downloaded media on Overdrive MEdia on my PC
    I have the overdrive media ap on my I pod touch 4g
    this media is suppossed to be compatible w/I pd touch
    Notes on Transferring OverDrive MP3 Audiobooks…
    Most MP3 capable devices should play OverDrive MP3 Audiobooks.
    If you intend to transfer OverDrive MP3 Audiobooks to an Apple® device, note the following…
    iTunes® v9.0.2 (or newer) is required.
    The Apple device must be formatted for use with Microsoft® Windows®.
    The iTunes setting 'Manually manage music…' must be enabled for the device before you can complete the transfer. Adjust this setting in iTunes as follows…
    Connect the iPod® to your computer.
    If it does not launch automatically, open iTunes v9.0.2 (or newer).
    In iTunes, locate the device in the left vertical navigation panel (under heading 'DEVICES'), and click the device.
    The 'Summary' screen is displayed. 
    Place a checkmark next to 'Manually manage music…'.
    Click the 'Apply' button.
    The iTunes 'Summary' screen refreshes, and the changes are saved.
    If desired, close iTunes.
    Note that if an Apple device is connected to your computer, you can choose to simultaneously transfer a title to the iTunes Library and the Apple device. If you wish to only transfer a title to the iTunes Library, you must first disconnect the Apple device

    Recovering your iTunes library from your iPod or iOS device: Apple Support Communities
    Also you said " I want to add them to my iCloud, and also back to my computer.   " Note that unless  subscribe to iTunes match, only iTunes purchases are stored in iCloud.
    Also,
    You can redownload most iTunes purchases by:
      Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • HT3775 Can someone direct me as to how I check whether I have the media formats and codecs that QuickTime Player can play back using my Mac Pro?

    I'm trying to use quicktime on my macbook pro but I receive the message below when I make an attemp to use it.  Any suggestions?
    Media formats supported by QuickTime Player
    QuickTime Player natively supports the following media formats and codec components. You can also extend QuickTime to support additional codecs and components.
    Below are the media formats and codecs that QuickTime Player can play back in Mac OS X v10.6.x or later:

    More alternatives to Quicktime. VLC is recommended a lot.
    Video Player - Divx
    Video Player – Flip4Mac
    Video Player - VLC

  • Some questions while using JMF play mpeg-1 stream media?

    I use Helix server to provide unicast, and use JMF to play the stream media. But the JMF only play the audio stream transferred by rtp. I have used video palyer�s getVisualComponent() method to get Visual component and added it into the frame. But I get a pink screen. So I think some thing wrong with the video player.
    Who can give me an answer?
    1.     Whether JMF can play mpeg-1 video stream media?( Audio can be heard. Video stream comes to my computer but can�t be displayed.)
    2.     Which method it should use to synchronize video stream and audio stream?
    BTW: In JMF, when the RTSP player�s start() method is invoked, the player creates players by the stream�s track numbers. Video stream and audio stream have different players.

    Try posting your question under the Java Media Framework forum instead.
    You'll get much better responses if you ask the right people !
    regards,
    Owen

  • HT3775 how to extend QuickTime to import or play other popular and specialized media formats using codec components

    how to extend QuickTime to import or play other popular and specialized media formats using codec components for my MacBook Air?

    plamenok1 wrote:
    how to extend QuickTime to import or play other popular and specialized media formats using codec components for my MacBook Air?
    You can install Perian, 
    http://www.perian.org/
    although this will be the last version, and Flip4Mac.
    http://download.cnet.com/Flip4Mac-WMV-Player/3000-13632_4-87679.html
    Otherwise you may have to look at a different and more extensive player such as VLC
    http://www.videolan.org/vlc/index.html
    or MPEGStremclip
    http://www.squared5.com/svideo/mpeg-streamclip-mac.html
    Good Luck
    Pete

  • Black screen on Media Player using jmf

    I am using code to tranmit video using RTP using JMF and i am able to successfully get the video on client side
    Code to send the video over rtp
    http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/AVTransmit2.java
    code to recieve video over rtp
    http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/AVReceive.html#source
    My problem is i am not able to play video in AVTransmit2.java.
    If i create a player using datasouce, eigther i get player already occupied or a black screen.
    please help me running the video on Transmit side as well.

    i have same problem. works fine booting back up to Snow Leopard, but it's a drag to get windows to work. you can also chose to boot to last known working configuration in lieu of system restore, but it's still cumbersome.

  • Format Conversion : Transcoding

    Hi,
    I am working on an application for format conversion of files, be it audio or video files. I tried the code Transcode.java (attached below) given in JMF, but I could only succeed in converting .wav files to .mp3 files. I have till date been unable to convert any video files from one format to another. I might be missing out on certain assumptions as to which files can be converted to the required format or not. Kindly give some sample code if anyody has any and also any suggestions please so that I can fulfill the requirement.
    Also kindly suggest a possible algorithm for the problem.
    Thanks,
    Amit
    import java.awt.*;
    import java.util.Vector;
    import java.io.File;
    import javax.media.*;
    import javax.media.control.TrackControl;
    import javax.media.control.QualityControl;
    import javax.media.Format;
    import javax.media.format.*;
    import javax.media.datasink.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import java.io.IOException;
    import com.sun.media.format.WavAudioFormat;
    * A sample program to transcode an input source to an output location
    * with different data formats.
    public class Transcode implements ControllerListener, DataSinkListener {
          * Given a source media locator, destination media locator and
          * an array of formats, this method will transcode the source to
          * the dest into the specified formats.
         public boolean doIt(MediaLocator inML, MediaLocator outML, Format fmts[],
                   int start, int end) {
              Processor p;
              try {
                   System.err.println("- create processor for: " + inML);
                   p = Manager.createProcessor(inML);
              } catch (Exception e) {
                   System.err.println("Yikes!  Cannot create a processor from the given url: " + e);
                   return false;
              p.addControllerListener(this);
               *     Put the Processor into configured state.
              p.configure();
              if (!waitForState(p, p.Configured)) {
                   System.err.println("Failed to configure the processor.");
                   return false;
               *     Set the output content descriptor based on the media locator.
              setContentDescriptor(p, outML);
               *     Program the tracks to the given output formats.
              if (!setTrackFormats(p, fmts))
                   return false;
               * We are done with programming the processor.  Let's just
               * realize the it.
              p.realize();
              if (!waitForState(p, p.Realized)) {
                   System.err.println("Failed to realize the processor.");
                   return false;
               *  Set the JPEG quality to .5.
              setJPEGQuality(p, 0.5f);
               *  Now, we'll need to create a DataSink.
              DataSink dsink;
              if ((dsink = createDataSink(p, outML)) == null) {
                   System.err.println("Failed to create a DataSink for the given output MediaLocator: " + outML);
                   return false;
              dsink.addDataSinkListener(this);
              fileDone = false;
               *   Set the start time if there's one set.
              if (start > 0)
                   p.setMediaTime(new Time((double)start));
               *  Set the stop time if there's one set.
              if (end > 0)
                   p.setStopTime(new Time((double)end));
              System.err.println("start transcoding...");
               *   OK, we can now start the actual transcoding.
              try {
                   p.start();
                   dsink.start();
              } catch (IOException e) {
                   System.err.println("IO error during transcoding");
                   return false;
               *  Wait for EndOfStream event.
              waitForFileDone();
               * Cleanup.
              try {
                   dsink.close();
              } catch (Exception e) {}
              p.removeControllerListener(this);
              System.err.println("...done transcoding.");
              return true;
          * Set the content descriptor based on the given output MediaLocator.
         void setContentDescriptor(Processor p, MediaLocator outML) {
              ContentDescriptor cd;
               *  If the output file maps to a content type, we'll try to set it on the processor.
              if ((cd = fileExtToCD(outML.getRemainder())) != null) {
                   System.err.println("- set content descriptor to: " + cd);
                   if ((p.setContentDescriptor(cd)) == null) {
                         * The processor does not support the output content type.  But we can set the content type to RAW and
                         * see if any DataSink supports it.
                        p.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW));
          * Set the target transcode format on the processor.
         boolean setTrackFormats(Processor p, Format fmts[]) {
              if (fmts.length == 0)
                   return true;
              TrackControl tcs[];
              if ((tcs = p.getTrackControls()) == null) {
                    *      The processor does not support any track control.
                   System.err.println("The Processor cannot transcode the tracks to the given formats");
                   return false;
              for (int i = 0; i < fmts.length; i++) {     
                   System.err.println("- set track format to: " + fmts);
                   if (!setEachTrackFormat(p, tcs, fmts[i])) {
                        System.err.println("Cannot transcode any track to: " + fmts[i]);
                        return false;
              return true;
         * We'll loop through the tracks and try to find a track
         * that can be converted to the given format.
         boolean setEachTrackFormat(Processor p, TrackControl tcs[], Format fmt) {
              Format supported[];
              Format f;
              for (int i = 0; i < tcs.length; i++) {
                   supported = tcs[i].getSupportedFormats();
                   if (supported == null)
                        continue;
                   for (int j = 0; j < supported.length; j++) {
                        if (fmt.matches(supported[j]) &&
                                  (f = fmt.intersects(supported[j])) != null &&
                                  tcs[i].setFormat(f) != null) {
                             * Success.
                             return true;
              return false;
         * Setting the encoding quality to the specified value on the JPEG encoder.
         * 0.5 is a good default.
         void setJPEGQuality(Player p, float val) {
              Control cs[] = p.getControls();
              QualityControl qc = null;
              VideoFormat jpegFmt = new VideoFormat(VideoFormat.JPEG);
              * Loop through the controls to find the Quality control for the JPEG encoder.
              for (int i = 0; i < cs.length; i++) {
                   if (cs[i] instanceof QualityControl &&
                             cs[i] instanceof Owned) {
                        Object owner = ((Owned)cs[i]).getOwner();
                        * Check to see if the owner is a Codec. Then check for the output format.     
                        if (owner instanceof Codec) {
                             Format fmts[] = ((Codec)owner).getSupportedOutputFormats(null);
                             for (int j = 0; j < fmts.length; j++) {
                                  if (fmts[j].matches(jpegFmt)) {
                                       qc = (QualityControl)cs[i];
                                       qc.setQuality(val);
                                       System.err.println("- Set quality to " +
                                                 val + " on " + qc);
                                       break;
                        if (qc != null)
                             break;
         * Create the DataSink.
         DataSink createDataSink(Processor p, MediaLocator outML) {
              DataSource ds;
              if ((ds = p.getDataOutput()) == null) {
                   System.err.println("Something is really wrong: the processor does not have an output DataSource");
                   return null;
              DataSink dsink;
              try {
                   System.err.println("- create DataSink for: " + outML);
                   dsink = Manager.createDataSink(ds, outML);
                   dsink.open();
              } catch (Exception e) {
                   System.err.println("Cannot create the DataSink: " + e);
                   return null;
              return dsink;
         Object waitSync = new Object();
         boolean stateTransitionOK = true;
         * Block until the processor has transitioned to the given state.
         * Return false if the transition failed.
         boolean waitForState(Processor p, int state) {
              synchronized (waitSync) {
                   try {
                        while (p.getState() < state && stateTransitionOK)
                             waitSync.wait();
                   } catch (Exception e) {
                        System.out.println("Exception 1 : " + e.getMessage());
              return stateTransitionOK;
         * Controller Listener.
         public void controllerUpdate(ControllerEvent evt) {
              if (evt instanceof ConfigureCompleteEvent ||
                        evt instanceof RealizeCompleteEvent ||
                        evt instanceof PrefetchCompleteEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = true;
                        waitSync.notifyAll();
              } else if (evt instanceof ResourceUnavailableEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = false;
                        waitSync.notifyAll();
              } else if (evt instanceof EndOfMediaEvent) {
                   evt.getSourceController().close();
              } else if (evt instanceof MediaTimeSetEvent) {
                   System.err.println("- mediaTime set: " +
                             ((MediaTimeSetEvent)evt).getMediaTime().getSeconds());
              } else if (evt instanceof StopAtTimeEvent) {
                   System.err.println("- stop at time: " +
                             ((StopAtTimeEvent)evt).getMediaTime().getSeconds());
                   evt.getSourceController().close();
         Object waitFileSync = new Object();
         boolean fileDone = false;
         boolean fileSuccess = true;
         * Block until file writing is done.
         boolean waitForFileDone() {
              System.err.print(" ");
              synchronized (waitFileSync) {
                   try {
                        while (!fileDone) {
                             waitFileSync.wait(1000);
                             System.err.print(".");
                   } catch (Exception e) {
                        System.out.println("Exception 2 : " + e.getMessage());
              System.err.println("");
              return fileSuccess;
         * Event handler for the file writer.
         public void dataSinkUpdate(DataSinkEvent evt) {
              if (evt instanceof EndOfStreamEvent) {
                   synchronized (waitFileSync) {
                        fileDone = true;
                        waitFileSync.notifyAll();
              } else if (evt instanceof DataSinkErrorEvent) {
                   synchronized (waitFileSync) {
                        fileDone = true;
                        fileSuccess = false;
                        waitFileSync.notifyAll();
         * Convert a file name to a content type. The extension is parsed
         * to determine the content type.
         ContentDescriptor fileExtToCD(String name) {
              String ext;
              int p;
              * Extract the file extension.
              if ((p = name.lastIndexOf('.')) < 0)
                   return null;
              ext = (name.substring(p + 1)).toLowerCase();
              String type;
              * Use the MimeManager to get the mime type from the file extension.
              if ( ext.equals("mp3")) {
                   type = FileTypeDescriptor.MPEG_AUDIO;
              } else {
                   if ((type = com.sun.media.MimeManager.getMimeType(ext)) == null)
                        return null;
                   type = ContentDescriptor.mimeTypeToPackageName(type);
              return new FileTypeDescriptor(type);
         * Main program
         public static void main(String [] args) {
              String inputURL = null, outputURL = null;
              int mediaStart = -1, mediaEnd = -1;
              Vector audFmt = new Vector(), vidFmt = new Vector();
              if (args.length == 0)
                   prUsage();
              * Parse the arguments.
              int i = 0;
              while (i < args.length) {
                   if (args[i].equals("-v")) {
                        i++;
                        if (i >= args.length)
                             prUsage();
                        vidFmt.addElement(args[i]);
                   } else if (args[i].equals("-a")) {
                        i++;
                        if (i >= args.length)
                             prUsage();
                        audFmt.addElement(args[i]);
                   } else if (args[i].equals("-o")) {
                        i++;
                        if (i >= args.length)
                             prUsage();
                        outputURL = args[i];
                   } else if (args[i].equals("-s")) {
                        i++;
                        if (i >= args.length)
                             prUsage();
                        Integer integer = Integer.valueOf(args[i]);
                        if (integer != null)
                             mediaStart = integer.intValue();
                   } else if (args[i].equals("-e")) {
                        i++;
                        if (i >= args.length)
                             prUsage();
                        Integer integer = Integer.valueOf(args[i]);
                        if (integer != null)
                             mediaEnd = integer.intValue();
                   } else {
                        inputURL = args[i];
                   i++;
              if (inputURL == null) {
                   System.err.println("No input url is specified");
                   prUsage();
              if (outputURL == null) {
                   System.err.println("No output url is specified");
                   prUsage();
              int j = 0;
              Format fmts[] = new Format[audFmt.size() + vidFmt.size()];
              Format fmt;
              * Parse the audio format spec. into real AudioFormat's.
              for (i = 0; i < audFmt.size(); i++) {
                   if ((fmt = parseAudioFormat((String)audFmt.elementAt(i))) == null) {
                        System.err.println("Invalid audio format specification: " +
                                  (String)audFmt.elementAt(i));
                        prUsage();
                   fmts[j++] = fmt;
              * Parse the video format spec. into real VideoFormat's.
              for (i = 0; i < vidFmt.size(); i++) {
                   if ((fmt = parseVideoFormat((String)vidFmt.elementAt(i))) == null) {
                        System.err.println("Invalid video format specification: " +
                                  (String)vidFmt.elementAt(i));
                        prUsage();
                   fmts[j++] = fmt;
              * Generate the input and output media locators.
              MediaLocator iml, oml;
              if ((iml = createMediaLocator(inputURL)) == null) {
                   System.err.println("Cannot build media locator from: " + inputURL);
                   System.exit(0);
              if ((oml = createMediaLocator(outputURL)) == null) {
                   System.err.println("Cannot build media locator from: " + outputURL);
                   System.exit(0);
              * Transcode with the specified parameters.
              Transcode transcode = new Transcode();
              if (!transcode.doIt(iml, oml, fmts, mediaStart, mediaEnd)) {
                   System.err.println("Transcoding failed");
              System.exit(0);
         * Create a media locator from the given string.
         static MediaLocator createMediaLocator(String url) {
              MediaLocator ml;
              if (url.indexOf(":") > 0 && (ml = new MediaLocator(url)) != null)
                   return ml;
              if (url.startsWith(File.separator)) {
                   if ((ml = new MediaLocator("file:" + url)) != null)
                        return ml;
              } else {
                   String file = "file:" + System.getProperty("user.dir") + File.separator + url;
                   if ((ml = new MediaLocator(file)) != null)
                        return ml;
              return null;
         * Parse the audio format specifier and generate an AudioFormat.
         * A valid audio format specifier is of the form:
         * [encoding]:[rate]:[sizeInBits]:[channels]:big:signed
         static Format parseAudioFormat(String fmtStr) {
              int rate, bits, channels, endian, signed;
              String encodeStr = null, rateStr = null,
              bitsStr = null, channelsStr = null,
              endianStr = null, signedStr = null;
              * Parser the media locator to extract the requested format.
              if (fmtStr != null && fmtStr.length() > 0) {
                   while (fmtStr.length() > 1 && fmtStr.charAt(0) == ':')
                        fmtStr = fmtStr.substring(1);
                   * Now see if there's a encode rate specified.
                   int off = fmtStr.indexOf(':');
                   if (off == -1) {
                        if (!fmtStr.equals(""))
                             encodeStr = fmtStr;
                   } else {
                        encodeStr = fmtStr.substring(0, off);
                        fmtStr = fmtStr.substring(off + 1);
                        * Now see if there's a sample rate specified
                        off = fmtStr.indexOf(':');
                        if (off == -1) {
                             if (!fmtStr.equals(""))
                                  rateStr = fmtStr;
                        } else {
                             rateStr = fmtStr.substring(0, off);
                             fmtStr = fmtStr.substring(off + 1);
                             * Now see if there's a size specified
                             off = fmtStr.indexOf(':');
                             if (off == -1) {
                                  if (!fmtStr.equals(""))
                                       bitsStr = fmtStr;
                             } else {
                                  bitsStr = fmtStr.substring(0, off);
                                  fmtStr = fmtStr.substring(off + 1);
                                  * Now see if there's channels specified.
                                  off = fmtStr.indexOf(':');
                                  if (off == -1) {
                                       if (!fmtStr.equals(""))
                                            channelsStr = fmtStr;
                                  } else {
                                       channelsStr = fmtStr.substring(0, off);
                                       fmtStr = fmtStr.substring(off + 1);
                                       * Now see if there's endian specified.
                                       off = fmtStr.indexOf(':');
                                       if (off == -1) {
                                            if (!fmtStr.equals(""))
                                                 endianStr = fmtStr.substring(off + 1);
                                       } else {
                                            endianStr = fmtStr.substring(0, off);
                                            if (!fmtStr.equals(""))
                                                 signedStr = fmtStr.substring(off + 1);
              * Sample Rate
              rate = AudioFormat.NOT_SPECIFIED;
              if (rateStr != null) {
                   try {
                        Integer integer = Integer.valueOf(rateStr);
                        if (integer != null)
                             rate = integer.intValue();
                   } catch (Throwable t) {
                        System.out.println("Exception 3 ");
              * Sample Size
              bits = AudioFormat.NOT_SPECIFIED;
              if (bitsStr != null) {
                   try {
                        Integer integer = Integer.valueOf(bitsStr);
                        if (integer != null)
                             bits = integer.intValue();
                   } catch (Throwable t) {
                        System.out.println("Exception :4 " );
              * # of channels
              channels = AudioFormat.NOT_SPECIFIED;
              if (channelsStr != null) {
                   try {
                        Integer integer = Integer.valueOf(channelsStr);
                        if (integer != null)
                             channels = integer.intValue();
                   } catch (Throwable t) {
                        System.out.println("Exception : 5 ");
              * Endian
              endian = AudioFormat.NOT_SPECIFIED;
              if (endianStr != null) {
                   if (endianStr.equalsIgnoreCase("big"))
                        endian = AudioFormat.BIG_ENDIAN;
                   else if (endianStr.equalsIgnoreCase("little"))
                        endian = AudioFormat.LITTLE_ENDIAN;
              * Signed
              signed = AudioFormat.NOT_SPECIFIED;
              if (signedStr != null) {
                   if (signedStr.equalsIgnoreCase("signed"))
                        signed = AudioFormat.SIGNED;
                   else if (signedStr.equalsIgnoreCase("unsigned"))
                        signed = AudioFormat.UNSIGNED;
              return new AudioFormat(encodeStr, rate, bits, channels, endian, signed);
         * Parse the video format specifier and generate an VideoFormat.
         * A valid video format specifier is of the form:
         * [encoding]:[widthXheight]
         static Format parseVideoFormat(String fmtStr) {
              String encodeStr = null, sizeStr = null;
              * Parser the media locator to extract the requested format.
              if (fmtStr != null && fmtStr.length() > 0) {
                   while (fmtStr.length() > 1 && fmtStr.charAt(0) == ':')     
                        fmtStr = fmtStr.substring(1);
                   * Now see if there's a encode rate specified.
                   int off = fmtStr.indexOf(':');
                   if (off == -1) {
                        if (!fmtStr.equals(""))
                             encodeStr = fmtStr;
                   } else {
                        encodeStr = fmtStr.substring(0, off);
                        sizeStr = fmtStr.substring(off + 1);
              if (encodeStr == null || encodeStr.equals(""))
                   prUsage();
              if (sizeStr == null)
                   return new VideoFormat(encodeStr);
              int width = 320, height = 240;
              int off = sizeStr.indexOf('X');
              if (off == -1)
                   off = sizeStr.indexOf('x');
              if (off == -1) {
                   System.err.println("Video dimension is not correctly specified: " + sizeStr);
                   prUsage();
              } else {
                   String widthStr = sizeStr.substring(0, off);
                   String heightStr = sizeStr.substring(off + 1);
                   try {
                        Integer integer = Integer.valueOf(widthStr);
                        if (integer != null)
                             width = integer.intValue();
                        integer = Integer.valueOf(heightStr);
                        if (integer != null)
                             height = integer.intValue();
                   } catch (Throwable t) {
                        System.out.println("Exception : 6");
                        prUsage();
                   return new VideoFormat(encodeStr,
                             new Dimension(width, height),
                             VideoFormat.NOT_SPECIFIED, // maxDataLen
                             null,                // data class
                             VideoFormat.NOT_SPECIFIED // FrameRate
              return null;
         static void prUsage() {
              System.err.println("Usage: java Transcode -o <output> -a <audio format> -v <video format> -s <start time> -e <end time> <input>");
              System.err.println(" <output>: input URL or file name");
              System.err.println(" <input>: output URL or file name");
              System.err.println(" <audio format>: [encoding]:[rate]:[sizeInBits]:[channels]:big:signed");
              System.err.println(" <video format>: [encoding]:[widthXheight]");
              System.err.println(" <start time>: start time in seconds");
              System.err.println(" <end time>: end time in seconds");
              System.exit(0);

    Actually, it's XDcam Ex in a .mov wrapper.
    +An out-of-the-box GY-HM700 can record to inexpensive SDHC cards (class 6 or faster) as Quicktime .MOV using the XDCAM EX codec at selectable bitrates of 19, 25 or 35Mbps. The Mpeg-2 encoder is JVC’s, the XDCAM EX codec is licensed from Sony, and the Quicktime wrapper is licensed from Apple.+
    http://www.dvinfo.net/articles/jvcprohd/hm700firstlook.php

  • Problem with using JMF audio over a network

    Hiya, I'm using IBM JMF code but I'm having problems trying to get it transmit data from the MediaTransmitter to the MediaPlayerFrame.
    I'm kinda new to JMF so I assume I'm missing something basis for why this doesn't work.
    Any help would be greatly appreciated.
    MediaPlayerFrame
    import javax.media.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    * An instance of the MediaPlayerFrame may be used to display any media
    * recognized * by JMF.  This is intended to be a very simple GUI example,
    * displaying all possible controls for the given media type.
    public class MediaPlayerFrame extends JFrame {
         * The frame title.
        private static final String FRAME_TITLE = "developerWorks JMF Tutorial " +
            "Media Player";
         * The panel title of the main control panel.
        private static final String CONTROL_PANEL_TITLE = "Control Panel";
        // location and size variables for the frame.
        private static final int LOC_X = 100;
        private static final int LOC_Y = 100;
        private static final int HEIGHT = 500;
        private static final int WIDTH = 500;
         private final static long serialVersionUID = 1;
         * The current player.
        private Player player = null;
         * The tabbed pane for displaying controls.
        private JTabbedPane tabPane = null;
         * Create an instance of the media frame.  No data will be displayed in the
         * frame until a player is set.
        public MediaPlayerFrame() {         
            super(FRAME_TITLE);
            System.out.println("MediaPlayerFrame");
            setLocation(LOC_X, LOC_Y);
            setSize(WIDTH, HEIGHT);
            tabPane = new JTabbedPane();
            getContentPane().add(tabPane);
            /* adds a window listener so that the player may be cleaned up before
               the frame actually closes.
            addWindowListener(new WindowAdapter() {
                                   * Invoked when the frame is being closed.
                                  public void windowClosing(WindowEvent e) {
                                      closeCurrentPlayer(); 
                                      /* Closing this frame will cause the entire
                                         application to exit.  When running this
                                         example as its own application, this is
                                         fine - but in general, a closing frame
                                         would not close the entire application. 
                                         If this behavior is not desired, comment
                                         out the following line:
                                      System.exit(0);
         * Creates the main panel.  This panel will contain the following if they
         * exist:
         * - The visual component: where any visual data is displayed, i.e. a
         * movie uses this control to display the video.
         * - The gain component:   where the gain/volume may be changed.  This
         * is often * contained in the control panel component (below.)
         * - The control panel component: time and some extra info regarding
         * the media.
        private JPanel createMainPanel() {
            System.out.println("createMainPanel");
            JPanel mainPanel = new JPanel();
            GridBagLayout gbl = new GridBagLayout();
            GridBagConstraints gbc = new GridBagConstraints();
            mainPanel.setLayout(gbl);
            boolean visualComponentExists = false;
            // if the visual component exists, add it to the newly created panel.
            if (player.getVisualComponent() != null) {
                visualComponentExists = true;
                gbc.gridx = 0;
                gbc.gridy = 0;
                gbc.weightx = 1;
                gbc.weighty = 1;
                gbc.fill = GridBagConstraints.BOTH;
                mainPanel.add(player.getVisualComponent(), gbc);
            // if the gain control component exists, add it to the new panel.
            if ((player.getGainControl() != null) &&
                (player.getGainControl().getControlComponent() != null)) {
                gbc.gridx = 1;
                gbc.gridy = 0;
                gbc.weightx = 0;
                gbc.weighty = 1;
                gbc.gridheight = 2;
                gbc.fill = GridBagConstraints.VERTICAL;
                mainPanel.add(player.getGainControl().getControlComponent(), gbc);
            // Add the control panel component if it exists (it should exists in
            // all cases.)
            if (player.getControlPanelComponent() != null) {
                gbc.gridx = 0;
                gbc.gridy = 1;
                gbc.weightx = 1;
                gbc.gridheight = 1;
                if (visualComponentExists) {
                    gbc.fill = GridBagConstraints.HORIZONTAL;
                    gbc.weighty = 0;
                } else {
                    gbc.fill = GridBagConstraints.BOTH;
                    gbc.weighty = 1;
                mainPanel.add(player.getControlPanelComponent(), gbc);
            return mainPanel;
         * Sets the media locator.  Setting this to a new value effectively
         * discards any Player which may have already existed.
         * @param locator the new MediaLocator object.
         * @throws IOException indicates an IO error in opening the media.
         * @throws NoPlayerException indicates no player was found for the
         * media type.
         * @throws CannotRealizeException indicates an error in realizing the
         * media file or stream.
        public void setMediaLocator(MediaLocator locator) throws IOException,
            NoPlayerException, CannotRealizeException {
              System.out.println("setMediaLocator: " +locator);
            // create a new player with the new locator.  This will effectively
            // stop and discard any current player.
            setPlayer(Manager.createRealizedPlayer(locator));       
         * Sets the player reference.  Setting this to a new value will discard
         * any Player which already exists.  It will also refresh the contents
         * of the pane with the components for the new player.  A null value will
         * stop the discard the current player and clear the contents of the
         * frame.
        public void setPlayer(Player newPlayer) {      
            System.out.println("setPlayer");
            // close the current player
            closeCurrentPlayer();          
            player = newPlayer;
            // refresh the tabbed pane.
            tabPane.removeAll();
            if (player == null) return;
            // add the new main panel
            tabPane.add(CONTROL_PANEL_TITLE, createMainPanel());
            // add any other controls which may exist in the player.  These
            // controls should already contain a name which is used in the
            // tabbed pane.
            Control[] controls = player.getControls();
            for (int i = 0; i < controls.length; i++) {
                if (controls.getControlComponent() != null) {
    tabPane.add(controls[i].getControlComponent());
    * Stops and closes the current player if one exists.
    private void closeCurrentPlayer() {
    if (player != null) {
    player.stop();
    player.close();
    * Prints a usage message to System.out for how to use this class
    * through the command line.
    public static void printUsage() {
    System.out.println("Usage: java MediaPlayerFrame mediaLocator");
    * Allows the user to run the class through the command line.
    * Only one argument is allowed, which is the media locator.
    public static void main(String[] args) {
    try {
    if (args.length == 1) {
    MediaPlayerFrame mpf = new MediaPlayerFrame();
    /* The following line creates a media locator using the String
    passed in through the command line. This version should
    be used when receiving media streamed over a network.
    mpf.setMediaLocator(new MediaLocator(args[0]));
    /* the following line may be used to create and set the media
    locator from a simple file name. This works fine when
    playing local media. To play media streamed over a
    network, you should use the previous setMediaLocator()
    line and comment this one out.
    //mpf.setMediaLocator(new MediaLocator(
    // new File(args[0]).toURL()));
    mpf.setVisible(true);
    } else {
    printUsage();
    } catch (Throwable t) {
    t.printStackTrace();
    MediaTransmitter
    import javax.media.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import javax.media.format.*;
    import java.io.IOException;
    import java.io.File;
    * Creates a new media transmitter.  The media transmitter may be used to
    * transmit a data source over a network.
    public class MediaTransmitter {
         * Output locator - this is the broadcast address for the media.
        private MediaLocator mediaLocator = null;
         * The data sink object used to broadcast the results from the processor
         * to the network.
        private DataSink dataSink = null;
         * The processor used to read the media from a local file, and produce an
         * output stream which will be handed to the data sink object for
         * broadcast.
        private Processor mediaProcessor = null;
         * The track formats used for all data sources in this transmitter.  It is
         * assumed that this transmitter will always be associated with the same
         * RTP stream format, so this is made static.
        private static final Format[] FORMATS = new Format[] {
            new AudioFormat(AudioFormat.MPEG_RTP)};
         * The content descriptor for this transmitter.  It is assumed that this
         * transmitter always handles the same type of RTP content, so this is
         * made static.
        private static final ContentDescriptor CONTENT_DESCRIPTOR =
            new ContentDescriptor(ContentDescriptor.RAW_RTP);
         * Creates a new transmitter with the given outbound locator.
        public MediaTransmitter(MediaLocator locator) {
            mediaLocator = locator;
         * Starts transmitting the media.
        public void startTransmitting() throws IOException {
            // start the processor
            mediaProcessor.start();
            // open and start the data sink
            dataSink.open();
            dataSink.start();
         * Stops transmitting the media.
        public void stopTransmitting() throws IOException {
            // stop and close the data sink
            dataSink.stop();
            dataSink.close();
            // stop and close the processor
            mediaProcessor.stop();
            mediaProcessor.close();
         * Sets the data source.  This is where the transmitter will get the media
         * to transmit.
        public void setDataSource(DataSource ds) throws IOException,
            NoProcessorException, CannotRealizeException, NoDataSinkException {
            /* Create the realized processor.  By calling the
               createRealizedProcessor() method on the manager, we are guaranteed
               that the processor is both configured and realized already. 
               For this reason, this method will block until both of these
               conditions are true.  In general, the processor is responsible
               for reading the file from a file and converting it to
               an RTP stream.
            mediaProcessor = Manager.createRealizedProcessor(
                new ProcessorModel(ds, FORMATS, CONTENT_DESCRIPTOR));
            /* Create the data sink.  The data sink is used to do the actual work
               of broadcasting the RTP data over a network.
            dataSink = Manager.createDataSink(mediaProcessor.getDataOutput(),
                                              mediaLocator);
         * Prints a usage message to System.out for how to use this class
         * through the command line.
        public static void printUsage() {
            System.out.println("Usage: java MediaTransmitter mediaLocator " +
                               "mediaFile");
            System.out.println("  example: java MediaTransmitter " +
                "rtp://192.168.1.72:49150/audio mysong.mp3");
            System.out.println("  example: java MediaTransmitter " +
                "rtp://192.168.1.255:49150/audio mysong.mp3");
         * Allows the user to run the class through the command line.
         * Only two arguments are allowed; these are the output media
         * locator and the mp3 audio file which will be broadcast
         * in the order.
        public static void main(String[] args) {
            try {
                if (args.length == 2) {
                    MediaLocator locator = new MediaLocator(args[0]);
                    MediaTransmitter transmitter = new MediaTransmitter(locator);
                    System.out.println("-> Created media locator: '" +
                                       locator + "'");
                    /* Creates and uses a file reference for the audio file,
                       if a url or any other reference is desired, then this
                       line needs to change.
                    File mediaFile = new File(args[1]);
                    DataSource source = Manager.createDataSource(
                        new MediaLocator(mediaFile.toURL()));
                    System.out.println("-> Created data source: '" +
                                       mediaFile.getAbsolutePath() + "'");
                    // set the data source.
                    transmitter.setDataSource(source);
                    System.out.println("-> Set the data source on the transmitter");
                    // start transmitting the file over the network.
                    transmitter.startTransmitting();
                    System.out.println("-> Transmitting...");
                    System.out.println("   Press the Enter key to exit");
                    // wait for the user to press Enter to proceed and exit.
                    System.in.read();
                    System.out.println("-> Exiting");
                    transmitter.stopTransmitting();
                } else {
                    printUsage();
            } catch (Throwable t) {
                t.printStackTrace();
            System.exit(0);

    Okay, here's the it copied out.
    Media Transmitter
    C:\John\Masters Project\Java\jmf1\MediaPlayer>java MediaTransmitter rtp://127.0.
    0.1:2000/audio it-came-upon.mp3
    -> Created media locator: 'rtp://127.0.0.1:2000/audio'
    -> Created data source: 'C:\John\Masters Project\Java\jmf1\MediaPlayer\it-came-u
    pon.mp3'
    streams is [Lcom.sun.media.multiplexer.RawBufferMux$RawBufferSourceStream;@1decd
    ec : 1
    sink: setOutputLocator rtp://127.0.0.1:2000/audio
    -> Set the data source on the transmitter
    -> Transmitting...
       Press the Enter key to exit
    MediaPlayerFrame
    C:\John\Masters Project\Java\jmf1\MediaPlayer>java MediaPlayerFrame rtp://127.0.
    0.1:2000/audio
    MediaPlayerFrame
    setMediaLocator: rtp://127.0.0.1:2000/audioAs I said, it just kinda stops there, what it should be doing is opening the MediaPlayer.
    "MediaPlayerFrame" and "setMediaLocator: rtp://127.0.0.1:2000/audio" are just print outs I used to track here the code is getting to.

  • How to convert FLV and F4V files to other media formats

    How to convert FLV and F4V files to other media formats
    Nowadays, every one can download their favorite videos from video sharing websites like YouTube, Hulu, MySpace, Google Video, metacafe, Yahoo! Video, Reuters.com and so on at will. However, these video files we got are usually in the format of FLV, or F4V, which are not workable by most portable devices, or some video players and video editors on our PC. With the intention of solving these problems, this guide will show you how to convert FLV and F4V files to other video and audio formats in detail.
    1. Download, install and run Pavtube FLV Converter
    As soon as you run this program, the following wine red interface will show up:
    2. Add files, set output format and destination folder
    Input FLV and F4V files to this program by clicking on “Add” button, and select a format as the output format in the drop-down list of “Format”, meanwhile, you can press the output folder to specify the destination folder or just use the path set by default. Moreover, “merge into one file” enables you to combine multiple FLV and F4V files to be as a single file, if you have this needs, just tick it.
    3. Set advanced settings
    Click “Settings” button, the following interface will pop up. You can change the parameters like screen size, bit rate, frame rate, sample rate, etc. on it to optimize the output quality or compress file size.
    4. Convert
    After all settings are done, you can press “Convert” button to start transferring, and then the following window will show you the conversion info in detail. According to the info you can manage your time and disk space properly.
    Pavtube FLV Converter can definitely complete the conversion at a swift speed with excellent quality; also it adopts an advanced audio-video sync technology, so that audio and video match very well in the resulted files. Therefore you need not worry about these issues.
    Useful tips:
    Free online FLV downloader:
    www.convertdirect.com
    http://vixy.net/
    http://www.videoconverterdownload.com/online-free-flv-converter.html
    http://www.flv2mp3.com/
    http://www.mediaconverter.org/
    http://2conv.com/
    http://online.movavi.com/
    http://www.youconvertit.com/
    http://www.playtube.com/
    http://www.convert.net/

    Flip4Mac

  • Playing a wav file (byte array) using JMF

    Hi,
    I want to play a wav file in form of a byte array using JMF. I have 2 classes, MyDataSource and MyPullBufferStream. MyDataSource class is inherited from PullStreamDataSource, and MyPullBufferStream is derived from PullBufferStream. When I run the following piece of code, I got an error saying "EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c9108b2, pid=3800, tid=1111". Any idea what might be the problem? Thanks.
    File file = new File(filename);
    byte[] data = FileUtils.readFileToByteArray(file);
    MyDataSource ds = new MyDataSource(data);
    ds.connect();
    try
        player = Manager.createPlayer(ds);
    catch (NoPlayerException e)
        e.printStackTrace();
    if (player != null)
         this.filename = filename;
         JMFrame jmframe = new JMFrame(player, filename);
        desktop.add(jmframe);
    import java.io.IOException;
    import javax.media.Time;
    import javax.media.protocol.PullBufferDataSource;
    import javax.media.protocol.PullBufferStream;
    public class MyDataSource extends PullBufferDataSource
        protected Object[] controls = new Object[0];
        protected boolean started = false;
        protected String contentType = "raw";
        protected boolean connected = false;
        protected Time duration = DURATION_UNKNOWN;
        protected PullBufferStream[] streams = null;
        protected PullBufferStream stream = null;
        protected final byte[] data;
        public MyDataSource(final byte[] data)
            this.data = data;
        public String getContentType()
            if (!connected)
                System.err.println("Error: DataSource not connected");
                return null;
            return contentType;
        public void connect() throws IOException
            if (connected)
                return;
            stream = new MyPullBufferStream(data);
            streams = new MyPullBufferStream[1];
            streams[0] = this.stream;
            connected = true;
        public void disconnect()
            try
                if (started)
                    stop();
            catch (IOException e)
            connected = false;
        public void start() throws IOException
            // we need to throw error if connect() has not been called
            if (!connected)
                throw new java.lang.Error(
                        "DataSource must be connected before it can be started");
            if (started)
                return;
            started = true;
        public void stop() throws IOException
            if (!connected || !started)
                return;
            started = false;
        public Object[] getControls()
            return controls;
        public Object getControl(String controlType)
            try
                Class cls = Class.forName(controlType);
                Object cs[] = getControls();
                for (int i = 0; i < cs.length; i++)
                    if (cls.isInstance(cs))
    return cs[i];
    return null;
    catch (Exception e)
    // no such controlType or such control
    return null;
    public Time getDuration()
    return duration;
    public PullBufferStream[] getStreams()
    if (streams == null)
    streams = new MyPullBufferStream[1];
    stream = streams[0] = new MyPullBufferStream(data);
    return streams;
    import java.io.ByteArrayInputStream;
    import java.io.IOException;
    import javax.media.Buffer;
    import javax.media.Control;
    import javax.media.Format;
    import javax.media.format.AudioFormat;
    import javax.media.protocol.ContentDescriptor;
    import javax.media.protocol.PullBufferStream;
    public class MyPullBufferStream implements PullBufferStream
    private static final int BLOCK_SIZE = 500;
    protected final ContentDescriptor cd = new ContentDescriptor(ContentDescriptor.RAW);
    protected AudioFormat audioFormat = new AudioFormat(AudioFormat.GSM_MS, 8000.0, 8, 1,
    Format.NOT_SPECIFIED, AudioFormat.SIGNED, 8, Format.NOT_SPECIFIED,
    Format.byteArray);
    private int seqNo = 0;
    private final byte[] data;
    private final ByteArrayInputStream bais;
    protected Control[] controls = new Control[0];
    public MyPullBufferStream(final byte[] data)
    this.data = data;
    bais = new ByteArrayInputStream(data);
    public Format getFormat()
    return audioFormat;
    public void read(Buffer buffer) throws IOException
    synchronized (this)
    Object outdata = buffer.getData();
    if (outdata == null || !(outdata.getClass() == Format.byteArray)
    || ((byte[]) outdata).length < BLOCK_SIZE)
    outdata = new byte[BLOCK_SIZE];
    buffer.setData(outdata);
    byte[] data = (byte[])buffer.getData();
    int bytes = bais.read(data);
    buffer.setData(data);
    buffer.setFormat(audioFormat);
    buffer.setTimeStamp(System.currentTimeMillis());
    buffer.setSequenceNumber(seqNo);
    buffer.setLength(BLOCK_SIZE);
    buffer.setFlags(0);
    buffer.setHeader(null);
    seqNo++;
    public boolean willReadBlock()
    return bais.available() > 0;
    public boolean endOfStream()
    return willReadBlock();
    public ContentDescriptor getContentDescriptor()
    return cd;
    public long getContentLength()
    return (long)data.length;
    public Object getControl(String controlType)
    try
    Class cls = Class.forName(controlType);
    Object cs[] = getControls();
    for (int i = 0; i < cs.length; i++)
    if (cls.isInstance(cs[i]))
    return cs[i];
    return null;
    catch (Exception e)
    // no such controlType or such control
    return null;
    public Object[] getControls()
    return controls;

    Here's some additional information. After making the following changes to MyPullBufferStream class, I can play a wav file with gsm-ms encoding with one issue: the wav file is played many times faster.
    protected AudioFormat audioFormat = new AudioFormat(AudioFormat.GSM, 8000.0, 8, 1,
                Format.NOT_SPECIFIED, AudioFormat.SIGNED, 8, Format.NOT_SPECIFIED,
                Format.byteArray);
    // put the entire byte array into the buffer in one shot instead of
    // giving a portion of it multiple times
    public void read(Buffer buffer) throws IOException
            synchronized (this)
                Object outdata = buffer.getData();
                if (outdata == null || !(outdata.getClass() == Format.byteArray)
                        || ((byte[]) outdata).length < BLOCK_SIZE)
                    outdata = new byte[BLOCK_SIZE];
                    buffer.setData(outdata);
                buffer.setLength(this.data.length);
                buffer.setOffset(0);
                buffer.setFormat(audioFormat);
                buffer.setData(this.data);
                seqNo++;
        }

  • How to use jmf convert the rtp packet (captured by jpcap) in to wav file?

    I use the jpcap capture the rtp packets(payload: ITU-T G.711 PCMU ,from voip)
    and now I want to use JMF read those data and convert in to wav file
    How to do this? please help me

    pedrorp wrote:
    Hi Captfoss!
    I fixed it but now I have another problem. My application send me this message:
    Cannot initialize audio renderer with format: LINEAR, Unknown Sample Rate, 16-bit, Mono, LittleEndian, Signed
    Unable to handle format: ALAW/rtp, Unknown Sample Rate, 8-bit, Mono, FrameSize=8 bits
    Failed to prefetch: com.sun.media.PlaybackEngine@1b45ddc
    Error: Unable to prefetch com.sun.media.PlaybackEngine@1b45ddc
    This time the fail is prefetching. I have no idea why this problem is. Could you help me?The system cant play an audio file / stream if it doesn't know the sample rate...somewhere along the way, in your code, the sample rate got lost. Sample rates are highly important, because they tell the system how fast to play the file.
    You need to go look through your code and find where the sample rate information is getting lost...

  • Error Playing .wav file on RHEL 4 using JMF

    Hi,
    We are using jmf api to play wav files on our application deployed on rhel version 4. But we are receiving the following error
    **"Cannot find a Processor for: myfolder/myAudio.wav" --->
    this exception is comming from javax.media.Manager
    throw new NoProcessorException("Cannot find a Processor for: " + source);"**.
    Any ideas what could be issue with this, am I missing some drivers/processor for wav files? I did a default jmf studio installation.
    Thanks and Regards
    Vikram Pancholi
    Edited by: vpancholi on Sep 8, 2009 8:51 AM

    If we take a look at the supported formats page...
    [http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/formats.html]
    And the WAV file is supported by the cross-platform pack, AKA, jmf.jar.
    If you're unable to open a WAV file, I'd say it's most likely because you don't have JMF.jar on your library path. You can fix that at runtime with the switch -djava.library.path=<whatever>
    That's what I would say the issue is.

Maybe you are looking for

  • I can not send email from my iPhone or iPad its goes out from the iMac ok. I get SMTP is incorrect. any suggestions?

    Having problems sending email from my iphone and ipad. Im getting a SMTP is incorrect error. Has anyone had this problem? Spent 3 hours with internet carrier still not resolved. Everything is fine on the imac.

  • Flash CS4 won't load properly

    Hi Weirdest thing is happening now. I boot up Flash CS4 and all I see in the upper left corner are the three dots for Apple's Snow Leopard interface. Flash was working fine yesterday, then last evening, all I got were the three dots. The menus are th

  • Autoplaying issue on hidden frames

    Hi All, Another interesting question that I want to rise up here is related to the video/audio autoplaying issue in hidden frames. We're working on desktop application based on JavaScript/HTML/CSS and run within the Adobe AIR environment.One of the m

  • Trouble with Nokia 6680 and iSync

    I have a Nokia 6680 and an iMac. Recently I wanted to clean up my contact list but I'm having problems in this. Contacts created in the phone get transfered to my computer with iSync easy, but I can't transfer all my contacts created in my iMac to th

  • Large white dot next to one of my accts

    What is this dot and what does it mean? It appeared when I did a rebuild for the acct because I was not receiving email from on certain emai address! I did a test email to myself and the acct is working! Just has a large dot and does not show the "ne