A/V stream out of sync with when playing audio on SourceDataLine

Hi,
I'm receiving a video and an audio stream via RTP and try to play them synchronized (audio synchron with lip movement).
I'm using a DataSourceReader in order to read from a datasource and play on a JavaSound SourceDataLine. This works pretty good but unfortunately the audio is played with a delay of approx 1 second.
else if (evt instanceof NewReceiveStreamEvent) {               
     try {
          stream = ((NewReceiveStreamEvent)evt).getReceiveStream();
          DataSource ds = stream.getDataSource();
          Format format = null;
          // Find out the formats.
          RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
          if (ctl != null) {
               format = ctl.getFormat();
               log.info("Received new RTP stream: " + format);
          else
               log.info("Received new RTP stream");
          if (format != null && format instanceof VideoFormat) {
               Player video = javax.media.Manager.createRealizedPlayer(ds);
               video.start();
               this.video_player = video;                         
          else if (format != null && format instanceof AudioFormat) {
               JavaSoundDataSourceReader dsr = new JavaSoundDataSourceReader();
               Player audio = dsr.open(ds);
               audio.start();
               this.audio_player = audio;
          }          I already tried to synchronize them with
videoPlayer.addController(audio_player);
audio_player.start();but this is throwing an Exception:
javax.media.IncompatibleTimeBaseException
     at com.sun.media.multiplexer.RawBufferMux.setTimeBase(RawBufferMux.java:377)
     at com.sun.media.BasicSinkModule.setTimeBase(BasicSinkModule.java:52)
     at com.sun.media.PlaybackEngine.setTimeBase(PlaybackEngine.java:1672)
     at com.sun.media.BasicPlayer.setTimeBase(BasicPlayer.java:272)
     at com.sun.media.BasicPlayer.addController(BasicPlayer.java:1043)
     at VideoPlayback.update(VideoPlayback.java:281)Line 281 of VidePlayback.java is the "videoPlayer.addController(audio_player);" line.
My guess is that it should rather use RawSyncBufferMux instead of RawBufferMux but I don't know how to change this. Maybe directly as a processor option?
Please help as I've no clue how to improve this.

chummer wrote:
it should also be synchronized with the video :-)The problem with getting it synchronized is that Javasound & your sound card have internal buffering, so there is some delay between writing to them and hearing the sound come out...
Normally, JMF handles this internally somehow by aligning things to a timebase, which can be syncronized, and allowing Processors to fill up their internal buffers ahead of time during the prefetching phase so that everything that needs to play together can have an instant start time. As it goes along, presumably adjustments are made as things get out of sync.
My best advise to you would be to implement your Javasound stuff inside of a Renderer class, instead of a DataSink class. DataSinks are designed to take in data and write it out as fast as they can... whereas Renderers are given data at "real-time" intervals and are designed to be played.
When implementing your Renderer class, JMF should handle the syncronization for you. IE, it'll give you data as it should be played by calling the Process function, so you'll just need to write the data to your TDL as it comes in. I believe that "Process" may be called before "Start" to allow you to prebuffer some information, but you'll need to test that as I've never actually tried it.

Similar Messages

  • When I watch tv shows in Front Row that I've bought off iTunes the audio gradually falls out of sync with the video. It does not happen with other files that I have converted into mp4s. Any ideas for fixing this? It's a huge bummer...

    When I watch tv shows in Front Row that I've bought off iTunes the audio gradually falls out of sync with the video. It does not happen with other files that I have converted into mp4s. Any ideas for fixing this? It's a huge bummer...

    I too have the same problem.  The audio drop out of sync in about 5 sec in not uncommon for the audio to be 30+ sec behind video.  Apple needs to fix this!!!!!!!!!!!!!!!!   its a joke,  my iphone is all messed up after the last update as well.  at one time not to long ago apple products and software were top rated, not so much any more, more and more problems are showing up and apple is unwilling or unalbe to fix the many issues.  Apple needs to fix the audio sync problem, it not the computer hardware or other software it ITUNES!!!!,  there is no workaround other then hitting pause and hitting pause and hitting pause to temp fix the problem. 

  • When I watch my tv shows in itunes, the people's voice is out of sync with the picture.  any suggestions???

    When I watch my tv shows on my mac computer thru itunes, the voice is out of sync with the picture.  any suggestions???

    Let's try the following user tip with that one:
    iTunes for Windows 10.7.0.21: "iTunes has stopped working" error messages when playing videos, video podcasts, movies and TV shows

  • HT2729 I bought a TV episode from iTunes (I have version 10 installed), but when I try to play it on my laptop, it keeps stopping and starting, with the voices out of sync with the action.  The action is stop/start as well.  What settings can I change to

    I bought a TV episode from iTunes (I have version 10 installed), but when I try to play it on my laptop, it keeps stopping and starting, with the voices out of sync with the action.  The action is stop/start as well., and occasionally it skips 5 or 10 seconds altogether, making it impossible to watch.  What settings can I change to fix the problem.

    Repair your QuickTime.
    Control Panel > Programs n Features > highlight QuickTime and click CHANGE then REPAIR.

  • Audio several seconds out of sync with live video stream.

    I did a live stream last week using 282,482,832,1500Kbps streams. What would cause the audio to get out of sync with the live video stream? I'm trying to determine if it was  bandwidth related, cpu/memory issue on the FMIS 4.5 server, or an issue with encoding PC exceeding it's limits?
    Thanks,
    Dave

    Which device are you using? Are audio and video coming from the same device or different devices?
    Is it a USB device? Try changing the device and see if there is any difference. Changing bitrates will not affect audio-video sync.

  • TS1424 when playing video after downloading program the speak is out of sync with the movie. How do I repair this? I'm using a new toshiba laptop with windows 7. Thanks

    when I playback movies or tv programs I've downloaded the speech is out of sync with the video. I have removed itunes as suggested and tried re installing itunes but the problem still exists. Has anyone experienced this and what can I do to fix this? Thanks

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • Audio out of sync with presentation (not using full motion)

    When I preview or publish a project using Captivate 5, the audio is out of sync with the presentation. I am not using any full motion recording, which I know has caused audio/video sync issues in previous versions of Captivate. The audio is slide specific, with a separate audio file for each slide. (In other words, I'm not trying to break a large audio file over many slides.) When each slide is viewed individually -- in the workstation, in the preview window, or in the published version -- the audio is synced just fine. The problem arises only when I try to watch the entire presentation (approx. 10 minutes in length). The audio gradually lags behind the visual.  By about half way through the project, the visual presentation is noticably ahead of the audio. By the end, the audio is nearly 4 seconds behind the video. I cannot detect a noticeable change in pitch or speed of the audio, so if the audio is being altered in any way, the alteration is slight.
    However, if I use the playback controls to advance to a single slide, the audio is fine for that slide and those immediately after, although it does gradually get off again as the project progresses. (So, for example, if I start the playback in the middle of the project, the audio will only be off by about 2 seconds by the end, rather than 4.)
    I have tried various publishing options (although I don't think publishing is the problem, since this happens when I preview the project as well). I have used 2 different computers and also tried viewing the published version locally and streaming. None of these alterations seem to make a difference. By the end of the presentation, regardless of how the project is published or viewed, the audio is several seconds behind the video.
    My specs:
    Captivate 5
    Microsoft XP OS
    2 GB RAM
    Publishing to .swf
    Suggestions?

    Hi Mukul,
    Thank you very much for your careful responses. Here are the answers to the questions.
    First of all, the "slow video" behavior does appear only after adding the slides mentioned in previous post.
    1.    I created a “software simulation” project. It IS a capture+audio recording.
    2.    Since I recorded the audio while doing screen capture, almost every slide has audio, which is not convenient to edit at all. Is there any other better way that I missed so that we can keep the audio and video at the same step while editing them? As I know so far, either insert silence or delete a little audio to one slide, the audio becomes short, but the slide duration time is still the same as before unless we change that manually which normally is not precise enough to match the audio.
    3.    I tried to add the blank slides at where there is a pause of speaking and where they are close to the problem slides. Otherwise, the speaking would sound weird.
    4.    Published SWF file size is 20.6 MB.
    5.    I do have two externalized video files for title and end.
    6.    Unfortunately, it is still slow even if it played on a different system.
    And another problem comes up these days. After publication, the screen resolution is not good (like some grey ink left on screen) wherever click or type something. It did not happen before even if worked on the same computer.
    I am very sorry that there are so many problems. I have been working on this for long time. The project totally drove me nuts. Hopefully you have more ideas about that.
    I really appreciate your help.
    Sincerely,
    Linda

  • IPhone out-of-sync with Exchange after performing inbox search?

    Hey everyone,
    I work as an IT technician for an Enterprise where the majority of end-users utilize iPhones (4 and 4s) and iPads (all versions) with varying versions of iOS. Many of these people have ActiveSync set up with our Exchange Server (2008RS, Exchange 2010). We have received a pretty consistent amount of user complaints for a while where end-users' iPhones will [seemingly randomly] become out of sync; i.e. they delete an email on their iPhone and their Outlook doesn't reflect this for hours or visa-versa.
    We have traced this down to indexed searching with the iPhone. In a nutshell, if an end-user tries to search their inbox for an email using the search feature, this is when everything becomes out-of-sync with Exchange. The workaround is restarting the phone (for some reason restarting the Mail app doesn't help).
    I am curious if anyone has more information around this or perhaps a fix so we're not having to tell people (namely Executives and VIPs with larger inboxes...thus searching is used more) to restart their iPhones all the time.
    I thank each of you in advance for any advice you may have. Thanks!
    -Ryan

    Hi mehrardt,
    It does sound like the exchange email account has to be removed from the iPhone and then added again.
    If he has another personal email account on the iPhone, you can have him delete the exchange account and then tap a configuration profile that you emailed him.
    The iPhone Configuration Utility available here: http://www.apple.com/support/iphone/enterprise/ will let you create a configuration profile with certificates, which you can email. The receiver would just tap the profile and it would configure the iPhone.
    -Jason

  • HT201317 why the last photos in photo stream are not sync with my iPad?

    why the last photos in photo stream are not sync with my iPad?

    Photostream only syncs photos over Wi-Fi, make sure you are connected to Wi-Fi to begin with.
    Photostream only syncs when the camera app is closed, ensure it is closed.
    Photostream only syncs when the battery is above 20%, try recharging the device
    Try disabling photo stream on your device (settings > iCloud), restarting your device and then re-enabling photo stream.
    If this doesn't help you may need to reset photo stream. You can do this at icloud.com by clicking on your name in the top right corner and then the advanced settings in the pop-up dialogue box that appears.
    Note: disabling photostream and re-enabling it will result in any photos that are currently in the photostream album on your device, that are older than 30 days old, not being added back.

  • Change of Video Frame One Sample Out of Sync with Correct Point on Timeline

    Change of Video Frame One Sample Out of Sync with Correct Point on Timeline.
    It has been found on the author's PC that, in Audition 3 in Multitrack View, a video file displayed in the video window will change its frame one sample later than it should do with respect to the correct point on the timeline. This has led to extra work having to be done by the author, as detailed later.
    To demonstrate this issue:
    Create a new multitrack session. Enable the Time and Video windows. Enable only 'Snap to Frames'.
    Using an external program, render a two-frame video clip at 25fps. Let the first frame contain the letter 'A', and the second frame contain the letter 'B'. Making sure that the Display Time Format is set appropriately, in this case at 'SMPTE 25 fps (EBU)', lock this clip on the multitrack timeline, ensuring that the clip starts at time 00:00:00:00.
    Create a mono audio clip of silence at 48kHz 32-bit that is two frames long. Lock it on an audio track, ensuring that the clip starts at time 00:00:00:00.
    Place the cursor at time 00:00:00:01 and create a cue marker at this point by pressing F8.
    Zoom into the timeline so that approximately twenty samples are visible, with the cursor lying on the cue marker in the middle of the screen. The Time window should display 00:00:00:01. The Video window should display the letter 'A'.
    Move the cursor back in time (leftwards) by one sample. The Time window should change its display to 00:00:00:00, whilst the Video window should still show the letter 'A'.
    Move the cursor forwards in time (rightwards) by one sample, so that it overlays the cue marker again. The Time window should change its display back to 00:00:00:01, whilst the Video window remains showing the letter 'A'.
    Move the cursor forwards in time (rightwards) by one more sample. The Time window's display should remain at 00:00:00:01, but the Video window should now display the letter 'B'.
    As can be seen from the above steps, the video's change of frame content occurs incorrectly one sample later than it should; the change of video frame content should occur simultaneously with the change of the frame number displayed in the Time window, which is at the point that the cue marker has been placed.
    The practical effect of this issue is that it has caused the author a huge amount of extra work on an 89-minute long soundtrack-for-video timeline. There were over 1100 changes of shot which the author wished to mark by placing cue markers at the beginning of every shot. This should have been a quite simple process of enabling 'Snap to Frames', stepping through the video, and laying cue markers down by pressing F8 when the shot was seen to change.
    Because currently the Video window (referencing the cursor laying over a cue marker
    i that has been placed on the timeline using the 'Snap to Frames' option
    ) will actually display the end moments of the previous frame rather than the beginning moments of the current frame, laying down a cue marker when the shot is seen to change will actually place that marker at the beginning moments of the second frame of the new shot, not at the beginning moments of the first frame of the new shot, i.e. the cue marker placed will be one frame later in time than it should be. If it is wished for the cue marker to, as best it can, represent the beginning moments of the first frame of the new shot, it has to be manually repositioned so that it is at least a sample later in time than the time at which the shot has actually changed, in order for the Video window to correctly display the content.
    The author had to manually reposition all 1100+ cue markers.
    Ideally, the Video window should display a change of video frame in synchronization with the change of the frame display in the Time window, which occurs at the position of the 'Snap to Frames' point.
    Part of the PC system's specification is detailed below:
    Windows XP Professional Version 2002 SP3;
    Adobe Audition 1.0 Build 3211.2;
    Ad

    obe Audition 2.0 Build 5306.2;
    Adobe Audition 3.0 Build 7283.0;
    ASRock 775dual-VSTA motherboard, BIOS Version P.3.00;
    2.80 GHz Intel Pentium D Processor 915 2x2MB L2 Cache;
    2GB DDRII 667 RAM;
    Matrox G550 DualHead AGPx4 VGA card for Audition's two main work screens;
    Matrox Productiva G100 MMS PCI VGA for two additional "static" information screens;
    4 x PATA HDDs for OS & programs, swapfile & temp, project file sources, and guide audio;
    Onboard Realtek ALC888 7.1 channel audio CODEC with High Definition audio;
    Lite-On DVDRW LH-18A1P;
    VIA OHCI Compliant IEEE 1394 Host Controller.
    ASIO4ALL version 2.8;
    Via Hyperion Drivers 5.16a - (VIA Chipsets INF Update Utility V3.00A, VIA PATA IDE Driver Package V1.90, VIA SATA IDE Driver Package V2.30A, AGP V4.60A);
    Matrox PowerDesk-SE 11.10.400.03;
    Matrox Millennium G550 Display Driver Version 5.99.005;
    Realtek High Definition Audio System Software Version R1.91, Audio Driver Version 5.10.0.5605;
    DirectX 9.0c March 2008;
    Microsoft .NET frameworks 1.1, 2.0 and 3.0 with all service packs.

  • Issues with finder going out of sync with file images in cover flow.

    Hi All,
    I'm having issues with files going out of sync with images in cover flow since updating to Mavericks. Typically, if I had for example 10 pictures listed as 1 to 10, if i deleted images 6&7 the images remain in coverflow but the file listings are removed, then if i click on image 7 the file listing of image 8 is highlighted, then to make matters worse, if i click on the file listing for image 9 in shows image 8 in cover flow. To stop this I have to shut down finder and restart it, then the whole thing repeats itself if i delete more images. Its a nightmare when your working with 50 plus images at a time!!! Help!!
    Thanks all.

    com.apple.systemuiserver.plist and com.apple.finder.plist
    Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J.  When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder.  Select Preferences/. Move the .plists to your desktop.
    Re-launch Finder by loggin out/in and test. If it works okay, delete the plist from the desktop.
    If the same, return the .plist to where you got it  from, overwriting the newer ones.
    Thanks to leonie for some information contained in this.
    You might need to redo the View settings after an update.
    If you look at the 'More Like This' box (top right) it seems the Cover Flow view is having problems.
    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback

  • Eclipse XQuery expression validation failed: The current configuration is out of sync with the XQuery resource in the repository.

    I created a wsdl based on a dbadapter in jdeveloper, imported into eclipse and created the biz and the proxy and uploaded to oracle service bus, it works fine,
    but happens now that i need to have a xsd and wsdl with business names and not table names, invented to create a xsd and wsdl file in jdeveloper
    and then went to eclipse and tried t xquery tranformation, but when i add the replace in the message flow in the filed in Variable : body and Expression i look for the xquery and in the binding trying to put
    $body/input parameter, get the following error [RouteNode1, Replace action] XQuery expression validation failed: The current configuration is out of sync with the XQuery resource in the repository.
    what im doing wrong or its configuration
    thanks in advance sonia

    thanks
    ok have created a table with only in column varchar2(1)
    then the type object and the procedure to insert it works the proxy in the osb if i test it inserts
    now in jdeveloper i created an xml file with
    <?xml version="1.0" encoding="windows-1252" ?>
    <vessel>
    <barco>a</barco>
    </vessel>
    then i created a xsd based on this xml, and a wsdl based on the xsd
    in eclipse created a xquery transformation and selected source as the xsd created in adf and target the xsd input parameter, dont know why in the purple ball of the input parameter it puts a ?, an a f.
    then in the proxy xpath not writing anything in variable body and in the expression select the xquery and in binding select the parameter

  • I have used Sony for the past 5 or 6 years.  They recently stopped selling books and migrated their customers to Kobo.   In uploading the Kobo site it looks like I added a new Adobe ID.  Then my reader and computers were out of sync.  When I try to downlo

    I have used Sony for the past 5 or 6 years.  They recently stopped selling books and migrated their customers to Kobo.   In uploading the Kobo site it looks like I added a new Adobe ID.  Then my reader and computers were out of sync.  When I try to download books I get that they were already downloaded by another user, but also that they are in my library.  However, I can't find them, and if I do download, it gives me an error message that the book is DRM protected.  How do I get to the point where I can download books again?

    Please authorize ADE 3 with same credentials that you used with older version of ADE

  • Export Premiere CS6 (h.264) - Audio out of sync with several players...

    I've had this problem before, but unfortunately it happened again.
    I exported an mp4 with h.264 compression. The file plays perfectly with VLC player and everything is in sync. Of course, in Premiere (CS6) everything is in sync as well.
    It is also synced correctly with Windows Media Player, as long as you don't 'scroll' or skip parts in the video. If you do that, the audio gets out of the sync...
    With QuickTime it is completely out of sync. Vimeo plays it back perfectly, with YouTube it is out of sync...
    How is this possible? What is causing this?
    I thought that it could have had something to do with the video and audio tracks not being of the same length. I have already mastered the audio tracks into 1 track (wav) and made the same length as the video tracks, before I exported... On previous projects I have have not done that, and the audio was slightly out of sync there as well on Youtube.
    What did I do wrong? Any settings I could have done wrong? Is this a bug of Premiere? What can I do to prevent this?

    Yea, that sounds plausible but from the other hand, this happens only with (my) exported clips from Premiere...
    When I download or watch clips from the internet that are mp4 files with h.264 compression, there is no problem. I just skip through a file of 4GB and it plays back fine. Also the clips from my camera (which are h.264 files) play back fine with everything in sync.
    Also, I almost never see sync problems on YouTube.
    There is something else going on here... It must be.

  • Audio out of sync with elemental plugin, and slower than my i7!!!

    Maaannn!!
    I just got a PNY nvidia quadro 1800 with elemental accellerator plugin. I just transcoded 2 hours of HDV straight from premiere 4 with Adobe Media Encoder using the Elemental codec and the audio is out of sync. It plays out of sync on the Blu Ray disk, and in Encore4. The audio is perfectly synced in Premiere. I just did another project a week ago without the Elemental, using the default Main Concept encoder and the audio is perfect. I am pretty sure I have the latest version of the Elemental Accellerator because there is a button to check for updates and it says there are no updates available. Does anybody know what is wrong here?.
    The transitions are getting messed up. I can see a small section with the audio synced, then the video repeats after a second throwing them out of sync. I also suspect that the Elemental accelerator does not process any faster than the default h.264 for Blu Ray encoder. I hope I did not waste my money on this nvidia quadro 1800..
    Whoooaa! I just woke up and checked the transcoding time.. To transcode approximately 2 hours of HDV it took 6:35 (hr:mm) with the elemental accellerator and it took 5:09 with my i7 920 chip!! Was that nvidia card a waste of money, or what?!!! Between the slower speed and the audio out of sync, I'd say I made a BIG misteak.. Does anybody want to buy a PNY nvidia quadro 1800? it'll be on ebay very soon..
    Win7 64bit, Master Collection 4, i7 2.66 Ghz, Kingston Triple Channel DDR3 1600Mhz 6Gb, ASUS P6T, PNY nvidia quadro 1800.....

    Thanks Neil,
    I don't think my audio interface has anything to do with it.. I am using Adobe Media Encoder for the export and the Audio interface's latency has nothing to do with it.. I see the source of the problem but not the solution.. The Elemental plugin is not working properly with the transitions in Premiere. The transitions are visibly botched and the sound is in sync for a partial second of each clip, then the video skips backward as the sound keeps playing. This happens on every clip after the transition.
    Whatever you were talking about might have to do with some kind of real time export, but to where? I think Premiere might have some auto plugin delay compensation for audio tracks.. I dont think you even read my post.. My MOTU 896 Mk3 audio interface has a 128 sample buffer leaving a few milliseconds of latency, and I can set it as low as 64.. This still has nothing to do with my problem.. Thanks for your input..
    I am curious to know what you thought I was capturing elemental streams and audio from my interface in real time to.. I was unaware of anything that works like that in this type of editing..
    The bottom line is that my i7 chip gets the job done much faster than the quadro 1800, and that's a shame that I spent the money on the 1800.. On top of that it doesn't even work properly!!

Maybe you are looking for

  • Getting list of PP orders that a document is attatched to

    Hi all, I'm looking for Bapi or some other tool, which will receive document characteristics (like Name, Type Etc.) and returns list of PP orders that this document is attached to.

  • When trying to install iTunes, I get the error 7 (windows error 126)

    When trying to install iTunes, I get the error 7 (windows error 126)

  • VBA in Bex Analyzer

    Dear Experts, I'm running a BI query to extract data then used VBA code to import external data from another Excel file.  After storing the external data in a variable, I'm having trouble getting back to my original worksheet using VBA command Window

  • Selection screen doubt

    can anyone help on this:- i hav tables pa0000, pa0001, pa2001. my selection screen:- parameters : S_BTRTL LIKE PA0001-BTRTL,              s_month like      ? how should i get month in the selection screen? i am callig fun module:-REAL_ESTATE_F4_MONTH

  • Manual update of SDM 'hanging'

    Hello, after having an issue with JSPM I am trying to update the SDM manually. The job is running (JVM-bin/SDM.jar), uses a lot of CPU, but doesn't seem to do anything. It was running for nearly 20 hours, then I cancelled it and restarted the update.