Merging audio in JMF.

I am developing a voice conferencing server using JMF. For this i have to take audio from various datasources and merge them. i started with two audio streams from files and used the Manager.createMergingDataSource to create a merger. Then i play this merged datasource using a player. This works fine. but when i check the output bitrate using the BitRateControl for the player, it doubles when the second datasource arrives. However doesn't merging/mixing mean that the output bandwidth should remain constant.
I am not clear with this concept so could someone please help me with this.
Thanks in advance.
Tabrez

excuse me, could you share merging code?
My program mixes two DataSources into one, but it contains both of them, so is being transmitted through two connections. Does your program mix DataSources into one exactly stream, not just one DataSource?

Similar Messages

  • How can I join/merge audio in 1 step?

    How can I join/merge audio in 1 step? Or... 2 in Logic X.
    I want join all the audio in this track(image)

    I see only three steps, and one of 'm (3.) should not be necessary unless you've created a take folder or folder track somehow?
    In step 2. you are not joining tracks, but regions (on the track).
    I do understand why Apple does not "fix" this: nothing's broken, that's why. If the Logic dev team would listen to all these "it's too complicated" complaints, Logic Pro would eventually end up being iTunes with a record button.
    Two tips: learn the terminology (knowing the difference between tracks and regions, for starters) and use the search function in the manual. If that still doesn't get you anywhere, ask us.
    Have a nice day!

  • How merge audio/video for easy cropping and editing

    I'm trying to build a movie by importing my audio and video clips separately from Cinematize. (This is the only solution because Imovie has a bug and shows the movie file as distorted widescreen - and transitions don't work with a .dv file) I have about 5 different extracted imports - or 5 clips. That means 5 video.mov files and 5 .aiff files
    The problem is this - I want to lock/merge the audio to the video FOR EACH CLIP - not to the play head. I want to end up with several merged audio/video clips for easy cropping. Is this possible? Otherwise how do I crop the video clips and keep the audio clips exactly in sync?

    Hi:
    You can make your movie and export back to tape and then reimport to imovie, Then the audio will be on the actual video clips.
    Sue

  • IT's possibile capture audio with JMF on Pocket Pc

    It's possibile capture audio with JMF cross-platform version on Pocket Pc?? Or how can it possibile on Pocket pc?????

    This article say about MMAPI and MIDP, I need a solution about JMF because, my application must capture audio on Pocket Pc with Jeode VM, and Jeode VM is compliant with JDK1.1.8(it's subset).

  • How to demultiplex the merged audio and video streams

    Hi. I'm currently working on a video conferencing program. I successfully implemented the program using threads to run the audio and the video clients and servers. The problem with this is that the delay for the transmission of both media is a little too great. So now, I'm trying to merge both media into on DataSource, so then I don't have to worry about sending audio and video into 2 different ports and RTP sessions. I know how to merge the audio and video streams, but I was wondering how to extract each media back after receiving the merged audio and video streams. Any ideas? I used the createMergingDataSource(the_DataSource_array) method to merge both streams. Thanks.
    J.L.

    I am working on the same problem. Is there any solution yet?
    Regards
    C.Eckert

  • Merge audio to video clips, end of clip loses audio

    This is driving me nuts. After merging audio and video clips, sync to slate using the in points, everything is in sync.
    The audio is longer than the video itself. But WAY before the scene ends, the audio mutes. The waveforms are visable but no audio plays. It drop out. It happens to every merged clip I create. I don't use the out points either.
    Anyone else have this issue??
    If I take an alternate method to sync them in the timeline and create a clip from there, it makes a new sequence clip losing the scene and take metadata. That's not good. Is there a workaround?

    It happens on every project and different formats. I do use FCP Rescue and that doesn't solve it. I did figure out a work around which involves a few more steps and is more time consuming. Maybe this can help find the problem. Here is the ridiculous workaround steps. We should send this to Apple.
    The "--" are the extra steps.
    To get a good merged subclip.
    Open the audio file and add the 'in point' to the slate.
    --Drag audio clip to the timeline.
    --Drag the audio clip from the timeline to the browser window.
    Merge with video.
    Viola. Audio won't drop out. But the waveforms are completely off with the sound.
    Next step is to open the merged clips and Make Subclip so you don't have that extra media in the beginning and end. And the waveform seem normal.

  • Graphic control  of audio using JMF

    hi all
    I want to know that when we capture audio using JMF then can we show some
    visual control of it like any graphics sort of thing .
    Is it possible in JMF ?
    thanx in advance
    take care
    bye

    hi
    how r u??
    Yeah i am looking for volume meter as well as a graphic control on my panel
    to show that recording is goin on
    can u help me out i ma also facing a prob in audio capturing
    I am trying to save file as .wav .well I got the file and when i open it in notepad i
    can see the WAV tag as well as some encrypted characters ..but when I try to play it nothing is there
    What could be the problem??
    Plz help me out
    thanx in advance
    Bye

  • Merged Audio clip gets shortened

    Hello,
    When I use the "merge clips" function some of my newly created clips have shorter attached audio files when dropped into the timeline.
    I merged clips for hundreds of shots for a feature film with the "in point" for the merge. I have not set an end point for audio files when merging to accidentally make them shorter for merging. All appears good when I look at the merged clip in the "viewer". However, when I put some of the merged clips into the "timeline" the newly attached 'merged' audio clips are shorter than the video clips by a significant amount. I double click the merged clips and still see the audio is as long as necessary in the "viewer".
    Why are my merged audio clips getting shortened in the timeline?
    I tried to unlink the audio in the timeline, but the newly created merged audio file will not stretch out to the full capacity.
    Thanks for the help.
    Jason

    Hi.
    I have a bunch of audio & video files that last minutes in length that I am trying to link up for each shot. Some times it will be a 3 or 4 minute long take. When the audio is merged it only appears to be about 30 seconds long or less on the timeline. Yet, the entire original audio is minutes long.
    When I look at the merged clip the audio stream is as long as it should be. (minutes instead of seconds) But, when it is put onto the timeline the merged audio is significantly shorter and I can't stretch out the merged clip to the appropriate length.
    Thanks for reading and asking good questions.
    Jason

  • Getting error while merging Audio & Video

    Hi,
    I am trying to merge an audio file (.mp3) and video file(.mov) using Merge.java program. I am getting following error
    Error:-
    Failed to build a graph for the given custom options.
    Failed to realize: com.sun.media.ProcessEngine@1503a3
    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: LINEAR, 44100.0 Hz, 16-bit, Stereo, BigEndian, Signed
    outputting to: RAW
    Error: Unable to realize com.sun.media.ProcessEngine@1503a3
    Failed to create a processor: javax.media.CannotRealizeException
    I m novice to JMF, unable to understand the error. Let me know how to resolve it.
    Thanks,
    Sanjay Ujjainkar

    That error means JMF can't decode the audio input format, in this case MP3. Because MP3 isn't supported by default.
    You need to install the MP3 plugin in order to decode MP3 files.
    [http://java.sun.com/javase/technologies/desktop/media/jmf/mp3/download.html]

  • Merge Audio And Video [Help]

    Dear, Guys ...
    I need some help..... my problems, when i m trying merge the video and audio, just the audio can show out......
    this is the code :
    private boolean mergeAudioVideo() {
         try {
    String tempTotal = myGrabber.tempFile + myGrabber.cntMovies + myGrabber.extension;
    String audioFile = "";
    System.out.println(myGrabber.movPath + tempTotal);
    audioFile = mySampler.audioFile.toURL().toString();
    String mergeArguments[] = {"-o", myGrabber.movFile,     myGrabber.movPath + tempTotal, audioFile};
    if (!myProgressBar.cancelled) {
    new Merge(mergeArguments, myProgressBar);
    return true;
    } else {
    return false;
         } catch (Exception e) {
    outWindow.out("Gagal menggabungkan file - file");
    outWindow.out("" + e);
    } catch (OutOfMemoryError o) {
    outWindow.out("Gagal menggabungkan file - file");
    outWindow.out("" + o);
    return true;
    merge.java
    package camcap.Recording;
    * @author Shinlei
    import java.io.File;
    import javax.media.*;
    import javax.media.format.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import javax.media.datasink.*;
    import java.util.Vector;
    * Menggabungkan jalur - jalur dari input yang berbeda dan menghasilkan sebuah file QuickTime
    * dengan jalur - jalur yang sudah digabung
    public class Merge implements ControllerListener, DataSinkListener {
    Vector sourcesURLs = new Vector(1);
    Processor [] processors = null;
    String outputFile = null;
    String videoEncoding = "JPEG";
    String audioEncoding = "LINEAR";
    String outputType = FileTypeDescriptor.QUICKTIME;
    DataSource [] dataOutputs = null;
    DataSource merger = null;
    DataSource outputDataSource;
    Processor outputProcessor;
    ProcessorModel outputPM;
    DataSink outputDataSink;
    MediaLocator outputLocator;
    boolean done = false;
    VideoFormat videoFormat = null;
    AudioFormat audioFormat = null;
    public camcap.UserInterface.EncodingProgressBar myProgressBar;
    public Merge(String [] args) {
         parseArgs(args);
         if (sourcesURLs.size() < 2) {
         System.err.println("Need at least two source URLs");
         showUsage();
         } else {
         doMerge();
    public Merge(String [] args, camcap.UserInterface.EncodingProgressBar p) {
    myProgressBar = p;
         parseArgs(args);
         if (sourcesURLs.size() < 2) {
         System.err.println("Need at least two source URLs");
         showUsage();
         } else {
         doMerge();
    private void doMerge() {
         int i = 0;
         processors = new Processor[sourcesURLs.size()];
         dataOutputs = new DataSource[sourcesURLs.size()];
         for (i = 0; i < sourcesURLs.size(); i++) {
         String source = (String) sourcesURLs.elementAt(i);
         MediaLocator ml = new MediaLocator(source);
         ProcessorModel pm = new MyPM(ml);
         try {
              processors[i] = Manager.createRealizedProcessor(pm);
              dataOutputs[i] = processors.getDataOutput();
              processors[i].start();
         } catch (Exception e) {
              System.err.println("Failed to create a processor: " + e);
              System.exit(-1);
         try {
         merger = Manager.createMergingDataSource(dataOutputs);
         merger.connect();
         merger.start();
         } catch (Exception ex) {
         System.err.println("Failed to merge data sources: " + ex);
         System.exit(-1);
         if (merger == null) {
         System.err.println("Failed to merge data sources");
         System.exit(-1);
         try {
         Player p = Manager.createPlayer(merger);
         new com.sun.media.ui.PlayerWindow(p);
         } catch (Exception e) {
         System.err.println("Failed to create player " + e);
         // Membuat output dari processor
         ProcessorModel outputPM = new MyPMOut(merger);
         try {
         outputProcessor = Manager.createRealizedProcessor(outputPM);
         outputDataSource = outputProcessor.getDataOutput();
         } catch (Exception exc) {
         System.err.println("Failed to create output processor: " + exc);
         System.exit(-1);
         try {
         outputLocator = new MediaLocator(outputFile);
         outputDataSink = Manager.createDataSink(outputDataSource, outputLocator);
         outputDataSink.open();
         } catch (Exception exce) {
         System.err.println("Failed to create output DataSink: " + exce);
         System.exit(-1);
         outputProcessor.addControllerListener(this);
         outputDataSink.addDataSinkListener(this);
         System.err.println("Merging...");
         try {
         outputDataSink.start();
         outputProcessor.start();
         } catch (Exception excep) {
         System.err.println("Failed to start file writing: " + excep);
         System.exit(-1);
         int count = 0;
         while (!done) {
         try {
              Thread.currentThread().sleep(100);
         } catch (InterruptedException ie) {
    try {
    if (myProgressBar.cancelled) {
    try {
    outputDataSink.stop();
    outputProcessor.stop();
    done = true;
    System.out.println("Stopped merge datasink");
    } catch (Exception e) {
    System.out.println("Couldn't stop merge datasink");
    System.out.println(e);
    } catch (Exception e) {}
         if (outputProcessor != null &&
              (int)(outputProcessor.getMediaTime().getSeconds()) > count) {
              System.err.print(".");
              count = (int)(outputProcessor.getMediaTime().getSeconds());
         if (outputDataSink != null) {
         outputDataSink.close();
         synchronized (this) {
         if (outputProcessor != null) {
              outputProcessor.close();
         System.err.println("Done!");
    public void controllerUpdate(ControllerEvent ce) {
         if (ce instanceof EndOfMediaEvent) {
         synchronized (this) {
              outputProcessor.close();
              outputProcessor = null;
    public void dataSinkUpdate(DataSinkEvent dse) {
         if (dse instanceof EndOfStreamEvent) {
         done = true;
         } else if (dse instanceof DataSinkErrorEvent) {
         done = true;
    class MyPM extends ProcessorModel {
         MediaLocator inputLocator;
         public MyPM(MediaLocator inputLocator) {
         this.inputLocator = inputLocator;
         public ContentDescriptor getContentDescriptor() {
         return new ContentDescriptor(ContentDescriptor.RAW);
         public DataSource getInputDataSource() {
         return null;
         public MediaLocator getInputLocator() {
         return inputLocator;
         public Format getOutputTrackFormat(int index) {
         return null;
         public int getTrackCount(int n) {
         return n;
         public boolean isFormatAcceptable(int index, Format format) {
         if (videoFormat == null) {
              videoFormat = new VideoFormat(videoEncoding);
         if (audioFormat == null) {
              audioFormat = new AudioFormat(audioEncoding);
         if (format.matches(videoFormat) || format.matches(audioFormat))
              return true;
         else
              return false;
    class MyPMOut extends ProcessorModel {
         DataSource inputDataSource;
         public MyPMOut(DataSource inputDataSource) {
         this.inputDataSource = inputDataSource;
         public ContentDescriptor getContentDescriptor() {
         return new FileTypeDescriptor(outputType);
         public DataSource getInputDataSource() {
         return inputDataSource;
         public MediaLocator getInputLocator() {
         return null;
         public Format getOutputTrackFormat(int index) {
         return null;
         public int getTrackCount(int n) {
         return n;
         public boolean isFormatAcceptable(int index, Format format) {
         if (videoFormat == null) {
              videoFormat = new VideoFormat(videoEncoding);
         if (audioFormat == null) {
              audioFormat = new AudioFormat(audioEncoding);
         if (format.matches(videoFormat) || format.matches(audioFormat))
              return true;
         else
              return false;
    private void showUsage() {
         System.err.println("Usage: Merge <url1> <url2> [<url3> ... ] [-o <out URL>] [-v <video_encoding>] [-a <audio_encoding>] [-t <content_type>]");
    private void parseArgs(String [] args) {
         int i = 0;
         while (i < args.length) {
         if (args[i].equals("-h")) {
              showUsage();
         } else if (args[i].equals("-o")) {
              i++;
              outputFile = args[i];
         } else if (args[i].equals("-t")) {
              i++;
              outputType = args[i];
         } else if (args[i].equals("-v")) {
              i++;
              videoEncoding = args[i];
         } else if (args[i].equals("-a")) {
              i++;
              audioEncoding = args[i];
         } else {
              sourcesURLs.addElement(args[i]);
         i++;
         if (outputFile == null) {
         outputFile = "file:" + System.getProperty("user.dir") + File.separator + "merged.avi";
    public static void main(String [] args) {
         new Merge(args);
         System.exit(0);
    ii can't find the problems, can anyone help me?
    Thanks,
    Shin

    Even manually I configured & realized the processors for input files.
    My application is getting blocked in following mentioned snippet of code.
    while (!done)
             if (outputProcessor != null
                  && (int) (outputProcessor.getMediaTime().getSeconds()) > count)
              count = (int) (outputProcessor.getMediaTime().getSeconds());
              logger.debug("Merging is in progress...");
         }This is happening when I try merge large video , audio files only. Is this limitation of JMF or any mistake in app.
    Please suggest any idea or link by which I get some solution.

  • No Audio with JMF

    I encoded some video using virtualdub. I haven't been able to find any audio settings that result in audio playing back properly. I've looking at the supported formats, and I've tried plenty of different settings. Does anyone have any information about how to encode an avi file to work in jmf?
    Thanks

    Ok, fixed mine. Go to Library/QuickTime: Remove obsolete QuickTime Components: FFusion, Xvid Delegate, 3ivX, DivX, DivX Decoder, XviD, msmpeg4v1, msmpeg4v2, AviImporter, EX_M4S2, Casio AVI Importer, AC3 Codec, Sorenson and MatroskaQT.
    Maybe try one at a time starting with 3ivX
    I'm using Perian 1.2.3
    All working now.

  • Audio in jmf

    hi
    i create a video file and try to insert an audio in certain time. i use a processor for this, so far i only sucseed to insert it in time 0.
    i tried to use syncStart() method and wrote inner class for it :
    class MySync implements ControllerListener
    private int index;
    public MySync(int i)
    this.index = i;
    public synchronized void controllerUpdate(ControllerEvent event)
    if (event instanceof PrefetchCompleteEvent)
    processors[index].syncStart(new javax.media.Time((double)5.0));
    but it doen't work. the sound still is in time 0.
    is anyone have any idea why it doen't work , or has example of code how to do it correctly (maybe in a different way)?

    excuse me, could you share merging code?
    My program mixes two DataSources into one, but it contains both of them, so is being transmitted through two connections. Does your program mix DataSources into one exactly stream, not just one DataSource?

  • Trouble merging audio and video

    Hi everybody. I'm using 'merge clips' to combine audio recorded separately from video. We also had a mic on the camera, so we can hear how it syncs up. The clip is an hour long. The audio starts out in sync, but gradually and steadily lags behind the video. The audio ends up being 1-2 frames behind every 30 seconds or so. Very annoying. Any idea why this would happen and how to fix?

    wing hunter wrote: unknown audio recording device. I got them as wav files.
    I would be hunting down the guy who recorded them, finding out what the unknown device is, and what its settings are/were at the time, as well as what they did before delivering the files. Were they imported from the device into some sort of software? File conversions? I know ProTools projects have selectable frame rates, and that needs to match your footage frame rate or you will have sync issues.
    Lots of variables that need to be determined before we can help.

  • How to merge audio in a clip during video editing in iMovie?

    How and tnxs for reading.
    Here the question:
    I have a video file which has a bad audio R track and a good audio L one. I would like to edit the video, standard operations like cut, merge, etc...
    However I would like to take the audio R track out. Since I do not see any available feature for this I exported the audio track to another audio software and did the operation there. After that I imported the audio L track only in my iMovie (v 10) project, aligned to the clip, I deleted the original audio from the clip, and now I have a perfect project with the original clip with a good audio track.
    However, since I would like to work now on the project itself, it'd be great to merge the audio (which is now separated) to the clip, in order to maintain the proper audio with the clip during my cut/paste/etc operations. Is there any special feature I can use for this?
    If not, I know I can export the project to a new video file and then open a new iMovie project where I can import the new video file and start again from it, but I am wondering if there is an easier way since in my opinion I had to do already to much work for an easy op like this which would have been fixed easily with the old versions of iMovie.
    Tnxs.

    Thanks for your reply!
    While your answer is helpful, it's not a desired solution for me because the comp track is one channel of a multi-channel recording (two different mics).  I don't want to drag a new take into the comp track because the comp track is grouped with other comp tracks for editing purposes, and I don't want to disturb the editing I've already done.
    It seems like I "should" be able to select a region in the arrange window and "re-link" the file to any other file in the audio bin (thereby replacing the file with the other).  After years of working in graphic layout programs, such as Adobe InDesign, I'm expecting this sort of feature to exist already.  I'm pretty sure I've seen it before... but I've used Cubase, Digital Performer, Studio One and Pro Tools, and I'm not sure where I saw it.
    Have I described what I'm looking for clearly?  I'm not sure it's coming across in what I've written.  Can Logic do this?

  • FCP7; "unmerge" merged audio and video clips in the timeline?

    Our TC was way off in some areas due to a bad timecode lemo on set. My editor synched by slate then merged the video with an audio mixdown track using the in points. Now when I export an EDL the original TC from the audio clip is gone, so he has no reference for matching up the audio. Does anybody know of a way to un-merge these clips and restore the original filename (audio takes the name of merged video but reveals correctly in finder) and timecode? Thanks.

    what happens if you match frame the audio?  I would think it would match back to the source audio clip which you could then use to replace the audio in the timeline.

Maybe you are looking for

  • Publishing issue with BOE XI 3.1 and SAP IK

    Hi There, this issue has been posted a few times before and I see other people are running into it as well. Nonetheless I have not found a satisfying answer in the Forum. I have the problem that I can only publish a Crystal Report based on SAP BI if

  • I can't log in with my ID

    I can't log in with my ID

  • Configuring a printer through a wired printer server over a wireless network.

    Hi,  I have a home wireless networks setup via a netgear wireless router. I have an old HP Laserjet 4 that is connected via a parallel printer port to a Netgear PS110 printer server. The printer server is connected via Ethernet to the wireless router

  • ITunes always crashes on close Vista SP1

    I'm running Vista SP1 with the latest version of iTunes. Everytime I close iTunes I get an error message that iTunes has stopped working. I've tried reinstalling itunes and I've reinstalled Vista, but this only briefly fixes the problem. After the fi

  • Transparent design with router on both sides?

    I am looking to solve a design which has to work in two scenarios. Preferably with an in-line solution. 1. Transparent design with VRF on both sides: FW-VRF (Subnet A)       |       | (VLAN 11)      | ACE (Subnet A)       |       | (VLAN 12)       |