How to synchronize both audio & video received through AVTransmit2.java ?

hi,
I will transmit an local video file using AVTransmit2.java, but the problem is i am not able to synchronize both
audio & video streams transmitted. I have an applet which receives both the streams(audio & video) but it
plays in different players. how to synchronize both the players ?
thanks

I know that In Midlet development using MMAPI there are APIs available to synronize the players like
p1.setTimaBase(p2.getTimeBase())
But I am not using Players. Through http connection I m getting the raw image data and displaying it through ImageItem i.e no players required.
Therefore If i stream the audio like this How to synchronize that.
I relly need ur Help
Thanks

Similar Messages

  • I am new to ios & using 5C. I want to know where is all the media (Images, videos, Audio etc) received through Whatsapp are saved after downloading in Iphone. And also how to access the same.

    I am new to ios & using 5C. I want to know where is all the media (Images, videos, Audio etc) received through Whatsapp are saved after downloading  in Iphone. And also how to access the same.

    These are user to user forums.  You ARE NOT addressing Apple by posting here.
    Also, why are you YELLING at us??  Stop using ALL CAPS.
    What steps have you done to try and fix the problem?

  • Codes for audio video receiver class

    I am currently writting an audio and video receiver for my project based on AVReceive3, it works but i can only get Video only, everything seems to be normal, i dont see why i am not getting audio. My transmitter is working fine and sending both streams.
    If anyone can spot the error or mistake i a making, pleaase let me know as soon as possible.
    my email address is [email protected]
    public class AudVidReceive extends Frame implements ActionListener,ReceiveStreamListener,SessionListener,ControllerListener
    // Input MediaLocator
    // Can be a file or http or capture source
    private MediaLocator alocator;
    MediaLocator vlocator,vloct,aloct;
    private String ipAddress;
    private int portBase;
    Button transtop,transtart,recstop,recstart;
    Component controlPanel, visualComponent;
    //For Receiving Media Stream
    String sessions[] = null;
    SessionManager mgrs[] = null;
    Vector playerWindows = null;
    boolean dataReceived = false;
    Object dataSync = new Object();
    private Processor processor = null;
    Player player=null;
    Format fmt=null;
    private SessionManager rtpMgrs[];
    private DataSource dataOutput = null;
    DataSource ads=null;
    DataSource vds=null;
    DataSource source[];
    DataSource m=null;
    public AudVidReceive()
    super("Audio Video Receive");
    recstart=new Button("StartReceiving");
    //recstop=new Button("Stop Receiving");
    add(recstart);
    recstart.setBounds(80,250,100,30);
    recstart.addActionListener(this);
    setLayout(null);
    setSize(400,300);
    setVisible(true);
    //this.sessions=sessions;
    public void actionPerformed(ActionEvent e)
    Button b=(Button)e.getSource();
    String ac=e.getActionCommand();
    if(ac.equalsIgnoreCase("StartReceiving"))
    boolean flag;
    boolean st=initialize();
    if(!st)
    System.err.println("Failed to Realize the Sessions ");
    System.exit(-1);
    flag=isDone();
    try{
    while(!flag)
    Thread.sleep(1000);
    }catch(Exception e1)
    e1.printStackTrace();
    //Initialize the Session for Receiving the Incomming Stream
    protected boolean initialize() {
    try {
    InetAddress ipAddr;
    SessionAddress localAddr = new SessionAddress();
    SessionAddress destAddr;
    String sessions[]={"192.168.2.143/42060"};
    mgrs = new com.sun.media.rtp.RTPSessionMgr[sessions.length];
    playerWindows = new Vector();
    SessionLabel session;
    // Open the RTP sessions.
    for (int i = 0; i < sessions.length; i++) {
    // Parse the session addresses.
    try {
    session = new SessionLabel(sessions);
    } catch (IllegalArgumentException e) {
    System.err.println("Failed to parse the session address given: " + sessions[i]);
    return false;
    System.err.println(" - Open RTP session for: addr: " + session.addr + " port: " + session.port + " ttl: " + session.ttl);
    mgrs[i] = new com.sun.media.rtp.RTPSessionMgr();
    mgrs[i].addSessionListener(this);
    mgrs[i].addReceiveStreamListener(this);
    ipAddr = InetAddress.getByName(session.addr);
    destAddr = new SessionAddress(ipAddr, session.port,
    ipAddr, session.port+1);
    mgrs[i].initSession(localAddr, getSDES(mgrs[i]), .05, .25);
    // You can try out some other buffer size to see
    // if you can get better smoothness.
    BufferControl bc = (BufferControl)mgrs[i].getControl("javax.media.control.BufferControl");
    if (bc != null)
    bc.setBufferLength(350);
    mgrs[i].startSession(destAddr, session.ttl, null);
    } catch (Exception e){
    System.err.println("Cannot create the RTP Session: " + e.getMessage());
    return false;
    // Wait for data to arrive before moving on.
    long then = System.currentTimeMillis();
    long waitingPeriod = 120000; // wait for a maximum of 30 secs.
    try{
    synchronized (dataSync)
    while (!dataReceived && System.currentTimeMillis() - then < waitingPeriod) {
    if (!dataReceived)
    System.err.println(" - Waiting for RTP data to arrive...");
    dataSync.wait(1000);
    }catch (Exception e) {}
    if (!dataReceived) {
    System.err.println("No RTP data was received.");
    close();
    return false;
    return true;
    * Find out the host info.
    String cname = null;
    private SourceDescription[] getSDES(SessionManager mgr)
    SourceDescription[] desclist = new SourceDescription[3];
    if (cname == null)
    cname = mgr.generateCNAME();
    desclist[0] = new
    SourceDescription(SourceDescription.SOURCE_DESC_NAME,
    System.getProperty("user.name"),
    1,
    false);
    desclist[1] = new
    SourceDescription(SourceDescription.SOURCE_DESC_CNAME,
    cname,
    1,
    false);
    desclist[2] = new
    SourceDescription(SourceDescription.SOURCE_DESC_TOOL,
    "AVReceive powered by JMF",
    1,
    false);
    return desclist;
    //Check Player window sizing
    public boolean isDone() {
    return playerWindows.size() == 0;
    * Close the players and the session managers.
    protected void close()
    for (int i = 0; i < playerWindows.size(); i++)
    try {
    ((PlayerWindow)playerWindows.elementAt(i)).close();
    } catch (Exception e) {}
    playerWindows.removeAllElements();
    // close the RTP session.
    for (int i = 0; i < mgrs.length; i++) {
    if (mgrs[i] != null) {
    mgrs[i].closeSession("Closing session from AudVidReceive");
    mgrs[i] = null;
    //Find the player
    PlayerWindow find(Player p) {
    for (int i = 0; i < playerWindows.size(); i++) {
    PlayerWindow pw = (PlayerWindow)playerWindows.elementAt(i);
    if (pw.player == p)
    return pw;
    return null;
    //Find whether the Player is receiving the Stream
    PlayerWindow find(ReceiveStream strm) {
    for (int i = 0; i < playerWindows.size(); i++) {
    PlayerWindow pw = (PlayerWindow)playerWindows.elementAt(i);
    if (pw.stream == strm)
    return pw;
    return null;
    * SessionListener.
    public synchronized void update(SessionEvent evt) {
    if (evt instanceof NewParticipantEvent) {
    Participant p = ((NewParticipantEvent)evt).getParticipant();
    System.err.println(" - A new participant had just joined: " + p.getCNAME());
    * ReceiveStreamListener
    public synchronized void update( ReceiveStreamEvent evt) {
    SessionManager mgr = (SessionManager)evt.getSource();
    Participant participant = evt.getParticipant(); // could be null.
    ReceiveStream stream = evt.getReceiveStream(); // could be null.
    if (evt instanceof RemotePayloadChangeEvent) {
    System.err.println(" - Received an RTP PayloadChangeEvent.");
    System.err.println("Sorry, cannot handle payload change.");
    System.exit(0);
    else if (evt instanceof NewReceiveStreamEvent) {
    try {
    stream = ((NewReceiveStreamEvent)evt).getReceiveStream();
    DataSource ds = stream.getDataSource();
    // Find out the formats.
    RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
    if (ctl != null){
    System.err.println(" - Recevied new RTP stream: " + ctl.getFormat());
    } else
    System.err.println(" - Recevied new RTP stream");
    if (participant == null)
    System.err.println(" The sender of this stream had yet to be identified.");
    else {
    System.err.println(" The stream comes from: " + participant.getCNAME());
    // create a player by passing datasource to the Media Manager
    Player p = javax.media.Manager.createPlayer(ds);
    if (p == null)
    return;
    p.addControllerListener(this);
    p.realize();
    PlayerWindow pw = new PlayerWindow(p, stream);
    playerWindows.addElement(pw);
    // Notify intialize() that a new stream had arrived.
    synchronized (dataSync) {
    dataReceived = true;
    dataSync.notifyAll();
    } catch (Exception e) {
    System.err.println("NewReceiveStreamEvent exception " + e.getMessage());
    return;
    }//above catch closing if
    else if (evt instanceof StreamMappedEvent) {
    if (stream != null && stream.getDataSource() != null) {
    DataSource ds = stream.getDataSource();
    // Find out the formats.
    RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
    System.err.println(" - The previously unidentified stream ");
    if (ctl != null)
    System.err.println(" " + ctl.getFormat());
    System.err.println(" had now been identified as sent by: " + participant.getCNAME());
    else if (evt instanceof ByeEvent) {
    System.err.println(" - Got \"bye\" from: " + participant.getCNAME());
    PlayerWindow pw = find(stream);
    if (pw != null) {
    pw.close();
    playerWindows.removeElement(pw);
    }// end of this method
    * ControllerListener for the Players.
    public synchronized void controllerUpdate(ControllerEvent ce) {
    Player p = (Player)ce.getSourceController();
    if (p == null)
    return;
    // Get this when the internal players are realized.
    if (ce instanceof RealizeCompleteEvent) {
    PlayerWindow pw = find(p);
    if (pw == null) {
    // Some strange happened.
    System.err.println("Internal error!");
    System.exit(-1);
    pw.initialize();
    pw.setVisible(true);
    p.start();
    if (ce instanceof ControllerErrorEvent) {
    p.removeControllerListener(this);
    PlayerWindow pw = find(p);
    if (pw != null) {
    pw.close();
    playerWindows.removeElement(pw);
    System.err.println("AVReceive internal error: " + ce);
    * A utility class to parse the session addresses.
    class SessionLabel {
    public String addr = null;
    public int port;
    public int ttl = 1;
    SessionLabel(String session) throws IllegalArgumentException {
    int off;
    String portStr = null, ttlStr = null;
    if (session != null && session.length() > 0) {
    while (session.length() > 1 && session.charAt(0) == '/')
    session = session.substring(1);
    // Now see if there's a addr specified.
    off = session.indexOf('/');
    if (off == -1) {
    if (!session.equals(""))
    addr = session;
    } else {
    addr = session.substring(0, off);
    session = session.substring(off + 1);
    // Now see if there's a port specified
    off = session.indexOf('/');
    if (off == -1) {
    if (!session.equals(""))
    portStr = session;
    } else {
    portStr = session.substring(0, off);
    session = session.substring(off + 1);
    // Now see if there's a ttl specified
    off = session.indexOf('/');
    if (off == -1) {
    if (!session.equals(""))
    ttlStr = session;
    } else {
    ttlStr = session.substring(0, off);
    if (addr == null)
    throw new IllegalArgumentException();
    if (portStr != null) {
    try {
    Integer integer = Integer.valueOf(portStr);
    if (integer != null)
    port = integer.intValue();
    } catch (Throwable t) {
    throw new IllegalArgumentException();
    } else
    throw new IllegalArgumentException();
    if (ttlStr != null) {
    try {
    Integer integer = Integer.valueOf(ttlStr);
    if (integer != null)
    ttl = integer.intValue();
    } catch (Throwable t) {
    throw new IllegalArgumentException();
    * GUI classes for the Player.
    class PlayerWindow extends Frame {
    Player player;
    ReceiveStream stream;
    PlayerWindow(Player p, ReceiveStream strm) {
    player = p;
    stream = strm;
    public void initialize() {
    add(new PlayerPanel(player));
    public void close() {
    player.close();
    setVisible(false);
    dispose();
    public void addNotify() {
    super.addNotify();
    pack();
    * GUI classes for the Player.
    class PlayerPanel extends Panel {
    Component vc, cc;
    PlayerPanel(Player p) {
    setLayout(new BorderLayout());
    if ((vc = p.getVisualComponent()) != null)
    add("Center", vc);
    if ((cc = p.getControlPanelComponent()) != null)
    add("South", cc);
    public Dimension getPreferredSize() {
    int w = 0, h = 0;
    if (vc != null) {
    Dimension size = vc.getPreferredSize();
    w = size.width;
    h = size.height;
    if (cc != null) {
    Dimension size = cc.getPreferredSize();
    if (w == 0)
    w = size.width;
    h += size.height;
    if (w < 160)
    w = 160;
    return new Dimension(w, h);
    public static void main(String [] args) {
    Format fmt = null;
    int i = 0;
    AudVidReceive at1 = new AudVidReceive();
    System.err.println("Start Receiving incoming Streams ");
    try {
    Thread.currentThread().sleep(60000);
    } catch (InterruptedException ie) {
    ie.printStackTrace();

    I have to use RTP and RTSP for transferring the
    audio/video streams in real time.
    How I can sen and receive RTP packets.
    How can I make the RTP Player.
    What is the role of JMF in it.
    Please suggest me and provide me the codes if
    possible.
    Thanks alot
    shobhit vermaThere are two ways using which you can send and recieve packets using rtp. One without using the SessionManager and the other with.
    1.) Not using the SessionManager makes things easy for you but it offers very little flexibility to you. You can do this by just specifying a medialocator pointing to the specific url
    2.) Using the SessionManager is what is usually suggested. This process is more complex. First you have to instantiate a RTPSessionMgr to a SessionManager reference using which you can send and receive streams to and from the network. The process is more involved than this and is suggest you read some tutorials to get a better understanding, than me explaining to you the entire process.
    Message was edited by:
    qUesT_foR_knOwLeDge

  • Asha 302 saving audio message received through wha...

    How can I save an audio message received through whatsapp?

    Hi DineshDLI,
    Welcome to the Nokia discussions board!
    Sorry to hear that your recorded files are not playing as intended. It may be that you have hardware problem or where the device it recording the actual input. Please discuss this with the retailer you purchased the device from and let us know how you get on.
    Regards,
    haZey
    If you find this post helpful, a click upon the white star at bottom would always be appreciated.
    If it also solves your problem, clicking ACCEPT AS SOLUTION below it will benefit other users!

  • No sound connecting Qosmio G30 via HDMI to audio/video receiver

    When I connect my Qosmio G30-177 via HDMI cable to my audio/video receiver using Windows Vista Ultimate I get no sound but excellent video.
    When I connect the DVD recorder to the receiver (also via HDMI-cable) the sound is o.k.
    Do I have to use the s/pdif interface instead of HDMI to transmit the sound to the receiver or is it also possible via HDMI?
    Sound driver:
    Sigma tel high definition audio codec
    15.12.2006
    6.10.5324.0

    Hi
    Im not a audio expert but in my knowledge the HDMI transmit the audio and video signals.
    The HDMI 1.0 and 1.1 support Dolby DigitalDTS audio format
    The HDMI 1.2 supports Dolby DigitalDTS and DVD-Audio format
    The HDMI 1.3 supports Dolby DigitalDTS, DVD-Audio and SACD audio formats.
    All HDMI standards support a Typ A (19pol) jacks

  • Re: audio, video based chat in Java

    Hai,
    I am new to Java. I created text based chatting in Java using Socket. Now I need to add audio, video based chat in Java through Socket. Can you send sample coding for my project.
         Thanks in advance.
    reg
    vino

    Check out JMF

  • How do i copy AUDIO & video from slideshow to disk?

    How do I copy AUDIO and video from a slideshow to a dvd disk?  The slides copy but the soundtrack does not.  Thanks!  

    podcasts have a setting that only iTunes can access to put files into podcast folder. The only reliable way to get podcasts into podcast folder it by downloading with iTunes.

  • I have an HP 510Y. Does anyone know how to use the audio video inputs on the front panel.

    I have tried connecting a VCR a Camcorder and other devices and nothing happens. Its like they are not even connected. Has anyone else had a problem. What am I doing wrong. This is an audio video input is it not. Help please!

    I think they are video output.. not input..
    ||-Although I am working on behalf of HP, I am speaking for myself and not for HP.-||
    //Click on Kudos if my reply was helpful and answered your question//
    ||-If my answer solved the problem please mark the topic as the accepted solution-||

  • Help-how can i connect to the XE through my java application?

    Hi, i am trying to connect to the XE through my java application. I have downloaded the jdbc driver tho. but the error occured: cant find the symbol (class oracledatasource not found) . could anyone here tell me what else should i try to fix it? where should i put the jdbc packages ? anyone's prompt reply would be much appreciated! thanks a lot.

    Hi ,thank you very much for your guide.
    i am actually trying to connect to the XE server through my JSP files.
    i download the Oracle jdbc driver packages and put them in the same folder with JSP files. but i did not set the class path tho.
    do i have to set the enviroment variables for the classpath of Oracledatasource class? thanks a lot.
    another problem i got is installing the JDeveloper, it seemed my computer just got stuck there when installing JDeveloper. my laptop is with 256MB memory tho.
    the code i used to connect to the XE server in my jsp file is as below:
    <%@ page language="java" contentType="text/html"%>
    <%@ page import="java.sql.*" %>
    <%@ page import java.sql.Connection%>;
    <%@page import java.sql.SQLException%>;
    <%@page import oracle.jdbc.pool.OracleDataSource%>;
    <%@ page import="java.io.*" %>
    <% String jdbcUrl = "jdbc:oracle:thin:@localhost";
    Connection conn;
    OracleDataSource ds;
    ds = new OracleDataSource();
    ds.setURL(jdbcUrl);
    conn = ds.getConnection(jdbcUrl);
    %>
    dose it have some problems there?
    thanks a lot.
    Message was edited by:
    Novice

  • How to edit both audio tracks with video that has two tracks?

    I have video that has 2 tracks with it. Both however are marked ch. 1 on the premiere timeline. The properties say they are 48000 hz audio. Now when i hilight both tracks and right click to edit in Audition, only one comes over. I am wondering a few things here. Why are they both the same channel and how can i edit both of them at once since they ae exactly the same in Audition? Do i even need both tracks?

    Well, that's another nasty problem with multicam editing in PP. It cuts only the video but not both. The audio track is always that of the first selected clip (of that in the first video track) when I create a multicam sequence. I have manually to open it in the timeline, enable or disable certain audio tracks, go back to the sequence and cut. But when I have to switch the audio for only some camera angles it is impossible, because I can only change the audio track for the whole sequence. Or do I miss something? Maybe it is another cool "design feature"?

  • Can my iTune channel have both audio & video podcasts?

    Quick question from a newbie getting feet wet, can I upload audio and video podcasts into 1 single subscription channel?
    Thanks!

    You mean audio and video episodes p the podcast is the overall collection of episodes (sorry to be picky but if you don't get the terminology right it causes a lot of confusion).
    You can mix episodes in the feed: episode lives within an 'item' tag, and there is no technical reason why you shouldn't alternate audio and video, so that both appear. What you can't do is put two episode media files into one 'item' - the second will be ignored.
    However your subscribers won't thank you for doing this: it means that even if they only want the audio version they still have to download the video version. I would suggest having two separate feeds (which you will have to submit separately), one for audio and one for video - treat it as two separate podcasts though the basic content would otherwise be the same: you will probably have to make the titles slightly different (put 'audio' or 'video' in the title to make things clear).

  • How i can transmitt audio in LAN through the use of Java JMF

    can anynone help me to give the code for audio transmission in LAN through the use of JMF classes

    If you need help with JMF, there's a forum specificlly for JMF. Go ask your JMF question there...

  • How to retrieve the Audio/Video link (final cut pro hd 5)

    Hi there, and sorry for my misknowledgement of this soft.
    I'd like to know if it's possible once we have delete the audio part of a clip in the timeline to get back the Audio part synchronized with the video.
    Thx for help !

    Not entirely sure if I'm following you but try this:
    Select your video-only clip
    Press F on your keyboard to do a Match Frame. The (video & audio) clip should now be loaded into the Viewer with the In & Out matching your timeline clip.
    Replace the clip in the timeline with the clip from the Viewer (For most folks/scenarios, that means drag from the Viewer)
    Post back if that isn't it.

  • How to remove old audio/video

    I have recently moved most of my photos and videos to an eternal hard drive but I am not sure how to remove everything from my HD.  I deleted everything out of Iphoto and deleted the trash but if I do a search for video it still shows videos in Iphoto.  Also I am not sure how to remove all of the old video from Imovie without doing any damage.

    I deleted all of my pictures/videos from Iphoto, emptied the Iphoto trash, and got 30 gigs of storage back.  Now it was showing an empty library but if I searched for all movies there were a ton left in Thumbnails, originals, etc.  Hidden folders in the Iphoto Library.  So even though I couldn't see any photos left in Iphoto I decided to delete the enitre Library and start over.  I dragged the library to the trash and I got another 30 gigs of storage back!  All for hidden backups of files that I thought I had deleted.

  • KM4M how to enable both onboard video and video card radeon 7000

    My motherboard is KM4M and I have a radeon 7000(this card has 2 heads: one DVI and one VGA), actually I need 3 monitors at the same time. when I install the card, the onboard video disappeared. how to enable all of them?
    windows 2003
    athlon xp 2800
    Thansks

    all onboard vga turn of once a vga cards put in
    the 7000 and another pci vga card should work

Maybe you are looking for

  • Got a new computer

    I got a new computer and need to transfer my songs from the old library to my new computer. I burned the iTunes library folder to a disk. I have tried to import, add file to library and add folder to library. I do this, then take out the CD and it sa

  • Problem in EIS with "user-defined table"

    Platform : z/osrdbms : db2 v7Olap : Db2OlapMy problem :I try to make a "User-Defined table" in a meta-model whith this SQL definitionselect a.idele, a.idele0, b.lbele from u1g.fordv0 a, u1g.eledv0 b where a.iddim = 4 and a.idarb = 10 and a.idele = b.

  • Creating a Custom Laytout

    Hy, I have implemented a drag n drop operation where user can insert Buttons on a Panel for drawing flowchart.I have set Layout to be NULL so that each time a user adds a button, the latter is added to a specific place on the panel, but the problem i

  • Installing WebLogic 5.1 with Netscape Enterprise Server 3.5.1

    How can I configure Netscape Enterprise Server 3.5.1 to use WebLogic 5.1?

  • Keep receiving already read emails on Centro

    I recently bought a Palm Centro and activated my Gmail on it. However I keep receiving the same old emails over and over, even after I have already read and deleted them. Is there also a way to make it so that when you delete and email on your phone