Audio and video compression preferences for export to DVDSP

Hi,
I have a few questions here. The first is regarding the internal use of compressor by DVD Studio Pro. It is my understanding from (limited experience with) past projects that quicktime movie files are automatically compressed to an mpeg2 format when imported into DVDSP. To what extent do I have control over the level of compression, and are the default mpegs that were made optimal quality? Where can I check this?
My second question is regarding compression of audio files. Whereas my video files were automatically compressed, I am not so sure about the audio. I was forced to compress the audio down to Dolby2 separately using the external compressor program, in order not to exceed the bitrate on my last project. Was this just a question of one or the other (video/audio) needing further compression than the default amount, or is there more to this issue?
I live and work with video in Europe, where I have recently been told that optimal audio is mp3? 4? rather than Dolby 5.1? Is this correct, and how much more space does dolby 5.1 take than dolby2? How significant an issue is this when making dvd's for musicians?
Lastly, can someone recommend the best quality audio-video compression solution for a dvd containing approx 40 minutes of audio and video footage for use in europe?? or explain how I might go about finding this out for myself?
Thanks a lot, and I look forward to reading your comments.
4 x 2.5 GHz PowerPC G5   Mac OS X (10.4.6)   8 GB DDR2 SDRam
4 x 2.5 GHz PowerPC G5   Mac OS X (10.4.6)   8 GB DDR2 SDRam

It is my understanding from (limited experience with) past projects that quicktime movie files are automatically compressed to an mpeg2 format when imported into DVDSP. To what extent do I have control over the level of compression, and are the default mpegs that were made optimal quality? Where can I check this?
Settings for DVDSP's internal encoder can be adjusted in DVDSP preferences. Press Command-, - that's the Apply and the comma keys - to bring those up, then select the Encoder tab. In your case, make sure you adjust the settings for SD DVD (and not HD-DVD). You will also be able to specify whether to encode in the background (basically, as soon as you import your file) or encode on build, at the bottom of that tab.
I was forced to compress the audio down to Dolby2 separately using the external compressor program, in order not to exceed the bitrate on my last project. Was this just a question of one or the other (video/audio) needing further compression than the default amount, or is there more to this issue?
I can't confess to have read any of your previous threads, but if you exceeded bit rate, that is a common reason to need to use Dolby compression for your audio. (unless you can afford to recompress your video files)
That is, if you video files use a high bit rate (say over 6 Mbps average), then it's usually necessity to use Dolby compression to make sure that all your footage fits on a single disc. (this is a simplification, of course, but I think you get the idea)
Or was there more to this question that I'm missing?
I live and work with video in Europe, where I have recently been told that optimal audio is mp3? 4? rather than Dolby 5.1? Is this correct, and how much more space does dolby 5.1 take than dolby2? How significant an issue is this when making dvd's for musicians?
Someone was mistaken when they told you that DVDs accept - let alone are optimized for - mp3 or mp4 files. That's flat out wrong.
As for the difference between Dolby 5.1 vs 2.0, that depends on your encoding rates. Typically, most folks encoder Dolby 2.0 at 192 kbps, with some choosing to up the bit rate to 224 kbps. Beyond 224 kbps, you're not actually improving audio quality for a 2.0 mix, you're just bloating your file size. When it comes to 5.1 audio, it's typical to encode your audio at 384 or 448 kbps.
When it comes to compressed audio vs uncompressed audio, it does matter when you're making DVDs for musicians. But that means that you'll probably need to lower the bit rate on your video files.
Lastly, can someone recommend the best quality audio-video compression solution for a dvd containing approx 40 minutes of audio and video footage for use in europe??
If you want to keep you audio as AIFF files, set your encode to 2 Pass VBR Best, with an Average bit rate of 5.0 Mbps and a Max bit rate of 7.0 Mbps. If you need things to happen a bit faster, use One Pass (not One Pass VBR) and use 5.5 Mbps as your bit rate.
If you want to have a firm grasp over how all these numbers work, there is a section at the back of DVDSP manual, that explains how to calculate bit rates (what we call bit budgeting in the business). Give that a quick once-over if you can.

Similar Messages

  • Audio and Video option missing from Export Quicktime Movie Include

    Today as I was exporting a clip, I noticed that the Audio and Video option was missing from the Include drop down. I only have the options of Left, Center, Right.
    I highlight the sequence, control E (or File>Export>Quicktime Movie) and the Save window comes up. The Settings drop down is the same, the Markers: drop down is the same, but the Include: has the options of Left, Center and Right. I thought the Video and Audio dropdowns were always there. I hate to admit it, but I have not paid attention to them in a while. Getting old I guess.
    Sequence settings is 720x480 NTSC DV (3:2)
    NTSC - CCIR 601 / DV (720x480)
    Lower (Even)
    29.97
    QT Video Settings
    DV/DVCPRO - NTSC
    100%
    Audio
    48 kHz
    16-bit
    Channel Grouped
    Did I miss something?
    Thanks

    Thanks, forgot about that.
    For what ever reason it started working correctly a couple of hours later, after I started an SD project. The video came out fine
    I had been trying out a couple new applications, so maybe one was causing it. I will see if it happens in the future.
    Jim

  • Syncing Audio and Video but wish for the Audio not to move on timeline?

    Has anyone worked out how to sync audio and video within Premiere Pro but have the Audio stay fixed on the timeline and the video move? Every way I try it Premiere Pro insists on moving the audio. Locking the track does not work as you cannot select the audio within it to Sync with.
    I have a music video shoot with 14 camera angles used on the lead singer (don't ask me why). Multi-camera editing is not an option as there are too many sources for my brand new MacbookPro to handle. I think I would need the computer from Superman II to edit that many clips together.
    What I am doing is syncing the first clip, the one Im going to use as the baseline fall back shot and then I need to sync other clips onto the timeline. However Premiere Pro insists on moving the audio to fit with the video not visa-versa.
    Any help would be appreciated.

    @slitchfield: on the mentioned page, it is stated that "Improvements in screen real estate, with slimmer top status bar and optional (in some apps) bottom toolbar, meaning that all phones will have a larger useful display area."
    But on the E6 the bottom toolbar decreases available screen size in most apps, most noticeable in Web browser where the full view has gone. The bottom toolbar is not optional, you can't configure it yourself.
    And: "Homescreen widgets will now come in up to five different sizes (1x1, 2x1, 4x1, 2x2, 4x4) and allow a greater degree of interactivity.", but on the E6 they are in only one size, always with large borders and other visual effects.
    So beware of differences between phones, perhaps some aspects of Belle work differently depending on the type of device.
    "Notes now brings up a white (and AMOLED-unfriendly...) editing screen.": that you can change by switching themes, "Dark Solid for Anna" does a good job. It is a shame that the lines of Notes have gone though.
    When switching themes, I found you have to restart the phone, otherwise the theme doesn't get properly loaded in all apps. Stopping/starting apps is not enough. So when experimenting and loading one theme after another, you may end up with disfunctional combinations of black-on-black and white-on-white, but it may not be due to the last theme. Also you may end up with a good combination that isn't around anymore the next time you restart your phone.
    Current N900 and former E6 user regretting Belle upgrade
    Devices owned: 2110, 2110i, Cellular Data Card, 8110, 7110, 6210, 6310i, 6100, 9500, 6233, 5140i, 3109c, N900, E6-00

  • Audio and Video not synching after export

    I've uploaded DV from my camera into iMovie. In iMovie, audio and video are synching perfectly, but when I export to Quicktime they are off by about a second (or two). I've tried several different "expert settings," but still no dice. I've not had this problem occur before, so I'm confused. Anyone?

    Make sure none of your clips are using custom slow motion percentages. Only use what the slow motion slider snaps to. I had the same problem and once I changed my percentages to what iMovie wanted everything exported correctly.

  • Audio and video not synchronized when exporting from Premiere Pro CS6

    Hi
    We have made a project in Adobe Premiere Pro CS6 that´s intended to be exported to DVD (it´s a weeding). We are working with NTSC DV Widescreen. The exporting is 720x480
    We have 2 audio lines activated and sounding on this project.
    The question is:
    When exporting the entire video (the entire timeline sequece) using Adobe Media Encoder to formats like H.264 (NTSC DV Widescreen)... Quick Tile Movie or AVI without compression (we tested these formats) the 2 audio channels get unsynchronized from the video. The same problem occurs if we get a direct link of the timeline from Premiere to Encore.
    And Inside Premiere Preview audio is preety correct.
    Does anyone here are getting such problem?
    Also..can I ask another question (as I´m not expert on video production)?. What´s the best format for our purpose? Export a video to be played to DVD (we record weedings, birthdays..social events). No problem the time to export. We´d like the best quality for output.
    Thank you for the help
    Gustavo.

    Hi John and techkid123
    We have 4 cameras here. 1 is Sony model HD1000 (since it works with Mini-DV cassete we need to capture the image via Firewire). 2 cameras are Sony HD2000 (it generates *.MPEG files if I remember well). And 1 camera is a Panasonic AG-DVC7 (it generates *.MTS files)
    We start a new project using the Standard NTSC Widescreen 48Khz format.  When we drag to the timeline for example the MTS file...Premiere ask us if we want to Keep and Change timeline to suit the file specification. Anyway we always have 1 or 2 camera files that has a yellow line over timeline.
    But I renders correct...no problem to edit...and we had no problem with Premiere CS5.5 :/
    We are downloading the latest update of Premiere. I´ll make some test and publish here if the problem persist.
    Thank you a lot for the help
    Gustavo.

  • Exporting audio and video together for Mpeg2 dvd

    Hi, I'm trying to export audio and video together for Mpeg2 dvd.. I changed  multiplexing to DVD but is still exporting seperately is there something im missing? thanksa

    To add, with Multiplexing set to NONE, check what the Audio format is set to. If "PCM", this is an uncompressed .wav file and will result in export of .m2v video and .wav audio (I think Mac uses .aif) and use "Import as Timeline" in Encore for both clips at once. Encore will automatically transcode the audio to Dolby AC-3, do NOT mess with settings in Encore, defaults are correct. If you have CS6, then in AME audio settings, there is an option for Dolby and you can use that to create the .ac3 audio and then Encore does NOT do any transcoding to audio or video. Note that older versions will also show "Dolby" but that is a free trial of a surround encoder, not the same. You just want the stereo option available in CS6, or use PCM option is fine
    Thanks
    Jeff Pulera
    Safe Harbor Computers

  • Connecting Macs to Samsung Smart TV #UN55F7100AFXZA for Audio and Video form the TV

    I have a all Latest, Macbook pro, Macbook Retina and Imac 21.5" i brought a samsung smarttv, and its model number is UN55F7100AFXZA and i need to connect any of my product to the Tv, i need the video and audio coming from the Tv so how can i do this?????? budget is no limit, for a costly tv like that i dont  mind so i need you mac geniuses to help me connect any of my products to the Smart tv perfectly so the Audio and Video comes out of the TV, this is my first discussion and juust got my products 3 days ago so i did not try anything i will go with your opinions so at the end i would like to say is i want my Apple Product ( listed above ) to connect to Samsung Smart tv and Get audio and vdeo from the TV.
    Thank you in Advance
    (if you can solve it)
    i will make a youtube video prasing your name

    Hi Kingofmacs,
    Thanks for visiting Apple Support Communities.
    If your MacBook Pro and TV both have HDMI ports, you can use an HDMI cable to connect the two.
    This article can help confirm that your MacBook Pro has the necessary HDMI port:
    Mac Basics: Ports and connectors
    http://support.apple.com/kb/HT2494
    Ports on a MacBook Pro with Retina display:
    You may need to use an adapter to connect your iMac to your TV. This article has more information about Apple video adapters:
    About Apple video adapters and cables
    http://support.apple.com/kb/HT3235
    Once your TV is connected to your Mac, you can configure it using the Displays section of System Preferences. See this article for more information:
    OS X: How to use multiple displays with your Mac in Mountain Lion and earlier
    http://support.apple.com/kb/ht5019
    Best Regards,
    Jeremy

  • Audio and Video out of Sync after Pro Res export

    I´m getting an audio/video sync issue when I´m exporting to Pro Res.
    I started off in a HDV1080i50 sequence. Audio sampling rate is 48khz. (16 bit depth)
    The sequence is less than 20 minutes long. It plays correctly on the timeline.
    When I export the sequence for DVD and view it on a set top it plays absolutely fine.
    When I export the video to ProRes (422 HQ - I used Export using Quicktime Conversion) and the audio to AIFF, they quickly go out of sync. This was brought to my attention first by the guys who were making the DigiBeta master, and when I view the exported material in a Pro Res sequence I can see it for myself.
    The audio and video clips are of the exact same duration.
    Possible issues...
    Some of the narration was recorded at 44.1 khz. I didn´t resample it (I´m still a learning novice..).. but if that is the issue should it not have affected the DVD as well? All the other audio in the project is 48khz.
    Most of the material is HDV1080i50..but one clip used was originally an NTSC clip and therefore a different frame rate. However I converted it to a 25fps clip and this is reflected in the vid rate column in the browser where it says 25fps.
    Final point, the exported AIFF files..when I import them back into the HDV1080i50 sequence and play back, it is perfectly in sync.
    Any help would be greatly appreciated.

    First, yes resample the narration to 48k 16 bit.  You will probably be able to reconnect to the resampled files.  Usually works for me.   That's a simple fix and will probably solve the problem.  If it doesn't, you can try to change the codec (compressor) in the sequence settings to prores 422HQ, fully render and see if that solves the problem.
    Wait, just reread your original post.  Export from fcp using file:  export:  quicktime movie NOT quicktime conversion with current settings.  If that works without synch issues, use compressor to convert to prores.

  • Audio and video out of synch on export

    Hi,
    I've searched the forum for this. I have a movie in FCE 4 in which the audio and video are in synch in the time line. The audio was recorded into Logic at 96, noodled, passed into FCE at 48 and then had to be lined up with the video. Then when I go to export, the resulting QT movie is out of synch, the audio now about one second before the video. I'm using QT conversion. My compresson is H.264, quality best, frame rate 30, multi-pass, 640 x 480, format AAC or linear PCM, various sample rates, stereo and mono etc. I've tried various other settings for export, but the problem remains.
    What am I doing wrong? Many thanks for any help,
    Ray

    Hi,
    Thanks for the reply. I think you're on the right track. I want the best sound possible, so I record into Logic, knowing I'm going into FCE I record at 96 so an even multiple down to 48. I think a .wav file though, and maybe that's the problem. Into FCE, but other audio there as well from the camera mic, and which I occasionally include in the sound track for ambience. All of this noodled a fair amount and then exported, the intent being to end up in 44, as it will be uploaded to youtube. I switch to 16 bit out of Logic, but the aiff vs wav may be the problem. Do think there might be a better way to do this?
    Ray

  • Premiere Pro CC: audio and video is out of sync after export

    Hi folks! I downloaded trial version of Adobe Premiere Pro CC. Captured gameplay with bandicam in Motion Jpeg Format (as advised) 30 fps and made a 40 minutes lenght clip. But there is an issue: in my project audio is synchronized with video, but when i export - it's lost (and i think to further we watch video, the bigger is the synch gape between audio and video, in increases gradually). I tried various formats, tried to use option "delete rendered files" prior to export, tried "match source" option, tried to choose various drives for exporting - nothing helps.
    Help, how to solve this problem?

    Handbrake is a free-download program that takes variable-frame-rate footage and converts it to constant frame-rate. VFR to CFR, if you will.
    Going back to your reply to my first post, you noted there had been some kind of "hardlimit" to 30fps that you hadn't chosen. I'm guessing that would have made this track CFR, and what you've got instead is VFR. So you might try recording another bit after selecting that setting to hardlimit the frame-rate, and see if it works better through PrPro to export.
    Next ... so, you've got a 30fps probably VFR video track, and it appears a WAV file is your audio ... was that produced by the Bandicam program while it was recording your program? Or is it from another source and you pasted it into your sequence?
    Neil

  • When exporting separate audio and video streams, the audio drifts out of sync

    So this is my first slightly larger project in Final Cut Pro X.
    When I export my finished project (around 12 minutes long) straight to quicktime, it plays back perfectly.
    When I export using compressor, the resulting audio and video streams are two different lengths. The audio comes out a full second longer. If you try to lay them down in a program like Adobe Encore, the audio starts out perfectly in sync. Two minutes in you notice the video is slightly out of sync with the audio. By the end of the video it's comically bad, over a second out of sync.
    What's even more vexing is if I try to take the quicktime file that IS in sync upon playback, and try to convert it burn that to a dvd or blu-ray using toast, the problem re-emerges.
    I triec searching around, but most of the suggestions that came up were vauge, like, "Upgrade to a real program like Final Cut." (This was in reply to people who were using free software programs.)
    I did see one idea surface where 44 and 48 kHz sampling rates don't play well together. So I combed through my project and found all the 44.1 songs that were used, and swapped them out with upsampled versions. Nothing changed. It didn't sound like it would fix it, as people usually said it was a specific amount of frames off, not something drifting out of sync.
    So the question is, does anyone have any suggestions on what could be causing this? Thanks! :-)

    Project settings can be accessed and changed by selecting the project and pressing command-J. Then, in the inspector, click on the little gear in the lower-right hand corner to access the settings.
    Why are you trying to output video/audio separately? If the content plays in-sync when exporting a quicktime movie (using current project settings), you could try separating the video/audio using MPEG Streamclip as a second step instead of using compressor. For audio, don't change the sample rate from the project settings, and use uncompressed audio (AIFF) as the output format.

  • Audio and Video not matching up after compression

    I made a video that is 3:18 minutes long and after about 2 minutes, the audio and video don't match up anymore. I have 2 clips in the video that i conformed to 24p in Cinema Tools and i think that they are causing this problem. I noticed that Audio rate of the clips that i conformed, does not match up to the clips which are not. For example, the audio rate of my 59.94 fps clips is 48.0 KHz, and the audio rate of my 24 fps clips is, 19219 KHz. Is there any solution to this problem? I read a post that said i would need to re-digitize the clips, but i don't know how to do this. Can anyone help me?

    I still can't figure out how to solve this problem. I tried to resample the audio, but still, same things happening. If you watch the video, the audio goes off about 2 minutes into it. The audio is correctly matched up with the video when i view it in FCP, but every time i compress it, audio goes off in the exact some spot. Here is a link to the video- http://vimeo.com/21619542
    Message was edited by: Gray McClamrock

  • TIMECODES are important for audio and video sync issues

    Hello, just wanted to pass on what I learned so that others can avoid the trouble that I've had to go through. Perhaps this may help someone who is stuck on the launch pad. :)
    BOTTOM LINE: Info for the beginner. Audio and video not in sync in Premiere Pro CS3 V3.2.0
    PROBLEM: Capture works great it seems. When I go to the folder that contains the captured file and view in Windows Media Player audio and video are in sync. BUT when viewing the video asset in the source and program monitors, the audio and video are not in sync.
    SOLUTION:
    Before capturing a tape make certain the following is checked:
    (1) Edit->Preferences->Capture->Use device control timecode
    (2) Edit->Preferences->Device Control->Options->Timecode Format
    (3) Project->Project Settings->General->Video->Display format
    As for the devices timecode choose something other than Auto Detect. Then match the project timecode with what was chosen during capture. The projects display format could of course be set to frames.
    I searched everywhere for audio and video sync issues in google, adobe forums, F1 help, and hv20.com and everyone was talking about:
    (1) Presets: 1080p30 vs. 1080i30 (60i).
    (2) brakes in the tape where timecode for the audio and video get misaligned during capture.
    But choosing the correct hardware settings and timecodes to solve audio and video sync issues never popped up.
    MY HARDWARE: Canon HV30, HDV

    >Audio and video not in sync in Premiere Pro CS3 V3.2.0
    Must be an HDV only issue because my synch is always perfect.

  • DO i need some extra hardware interface for receving both Audio and video

    hi i m doing e-learning project. i have to capture video from webcam and voice from headphone and send to client.
    but my code is working fine for either one at a time.
    DO i need some extra hardware interface for receving both Audio and video. im using code AVTransmit and AVReceive found from this site only
    After running TX
    i give Dsound:// & vfw://0 in Media Locater only sound is received and no vedio
    and when i give vfw://0 in Media Locater only live video is transmited.
    im using JMF1.1.2e.
    if any one know the method to run or cause of it plz reply me soon. i will be very thankfull
    transmiter/server side code .first run TX on server
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.util.*;
    import javax.media.rtp.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    public class Tx extends JFrame implements ActionListener, KeyListener,
    MouseListener, WindowListener {
    Vector targets;
    JList list;
    JButton startXmit;
    JButton rtcp;
    JButton update;
    JButton expiration;
    JButton statistics;
    JButton addTarget;
    JButton removeTarget;
    JTextField tf_remote_address;
    JTextField tf_remote_data_port;
    JTextField tf_media_file;
    JTextField tf_data_port;
    TargetListModel listModel;
    AVTransmitter avTransmitter;
    RTCPViewer rtcpViewer;
    JCheckBox cb_loop;
    Config config;
    public Tx() {
    setTitle( "JMF/RTP Transmitter");
         config= new Config();
         GridBagLayout gridBagLayout= new GridBagLayout();
         GridBagConstraints gbc;
         JPanel p= new JPanel();
         p.setLayout( gridBagLayout);
         JPanel localPanel= createLocalPanel();
         gbc= new GridBagConstraints();
         gbc.gridx= 0;
         gbc.gridy= 0;
         gbc.gridwidth= 2;
         gbc.anchor= GridBagConstraints.CENTER;
         gbc.fill= GridBagConstraints.BOTH;
         gbc.insets= new Insets( 10, 5, 0, 0);
         ((GridBagLayout)p.getLayout()).setConstraints( localPanel, gbc);
         p.add( localPanel);
         JPanel targetPanel= createTargetPanel();
         gbc= new GridBagConstraints();
         gbc.gridx= 1;
         gbc.gridy= 1;
         gbc.weightx= 1.0;
         gbc.weighty= 1.0;
         gbc.anchor= GridBagConstraints.CENTER;
         gbc.fill= GridBagConstraints.BOTH;
         gbc.insets= new Insets( 10, 5, 0, 0);
         ((GridBagLayout)p.getLayout()).setConstraints( targetPanel, gbc);
    p.add( targetPanel);
         JPanel mediaPanel= createMediaPanel();
         gbc= new GridBagConstraints();
         gbc.gridx= 1;
         gbc.gridy= 2;
         gbc.weightx= 1.0;
         gbc.weighty= 1.0;
         gbc.anchor= GridBagConstraints.CENTER;
         gbc.fill= GridBagConstraints.BOTH;
         gbc.insets= new Insets( 10, 5, 0, 0);
         ((GridBagLayout)p.getLayout()).setConstraints( mediaPanel, gbc);
    p.add( mediaPanel);
    JPanel buttonPanel= new JPanel();
    rtcp= new JButton( "RTCP Monitor");
    update= new JButton( "Transmission Status");
         update.setEnabled( false);
         rtcp.addActionListener( this);
         update.addActionListener( this);
         buttonPanel.add( rtcp);
         buttonPanel.add( update);
         gbc= new GridBagConstraints();
         gbc.gridx = 0;
         gbc.gridy = 3;
    gbc.gridwidth= 2;
         gbc.weightx = 1.0;
         gbc.weighty = 0.0;
         gbc.anchor = GridBagConstraints.CENTER;
         gbc.fill = GridBagConstraints.HORIZONTAL;
         gbc.insets = new Insets( 5,5,10,5);
         ((GridBagLayout)p.getLayout()).setConstraints( buttonPanel, gbc);
         p.add( buttonPanel);
    getContentPane().add( p);
         list.addMouseListener( this);
         addWindowListener( this);
    pack();
    setVisible( true);
    private JPanel createMediaPanel() {
    JPanel p= new JPanel();
         GridBagLayout gridBagLayout= new GridBagLayout();
    GridBagConstraints gbc;
         p.setLayout( gridBagLayout);
         JLabel label= new JLabel( "Media Locator:");
         gbc= new GridBagConstraints();
         gbc.gridx = 0;
         gbc.gridy = 0;
         gbc.weightx = 0.0;
         gbc.weighty = 0.0;
         gbc.anchor = GridBagConstraints.EAST;
         gbc.fill = GridBagConstraints.NONE;
         gbc.insets = new Insets( 5,5,10,5);
         ((GridBagLayout)p.getLayout()).setConstraints( label, gbc);
         p.add( label);
         tf_media_file= new JTextField( 35);
         gbc= new GridBagConstraints();
         gbc.gridx = 1;
         gbc.gridy = 0;
         gbc.weightx = 1.0;
         gbc.weighty = 0.0;
         gbc.anchor = GridBagConstraints.WEST;
         gbc.fill = GridBagConstraints.HORIZONTAL;
         gbc.insets = new Insets( 5,5,10,5);
         ((GridBagLayout)p.getLayout()).setConstraints( tf_media_file, gbc);
         p.add( tf_media_file);
         tf_media_file.setText( config.media_locator);
         cb_loop= new JCheckBox( "loop");
         startXmit= new JButton( "Start Transmission");
         startXmit.setEnabled( true);
         startXmit.addActionListener( this);
         gbc= new GridBagConstraints();
         gbc.gridx = 2;
         gbc.gridy = 0;
         gbc.weightx = 0.0;
         gbc.weighty = 0.0;
         gbc.anchor = GridBagConstraints.WEST;
         gbc.fill = GridBagConstraints.NONE;
         gbc.insets = new Insets( 5,5,10,5);
         ((GridBagLayout)p.getLayout()).setConstraints( cb_loop, gbc);
         p.add( cb_loop);
         cb_loop.setSelected( true);
         cb_loop.addActionListener( this);
         gbc= new GridBagConstraints();
         gbc.gridx = 1;
         gbc.gridy = 1;
         gbc.weightx = 0.0;
         gbc.weighty = 0.0;
         gbc.anchor = GridBagConstraints.CENTER;
         gbc.fill = GridBagConstraints.NONE;
         gbc.insets = new Insets( 5,5,10,5);
         ((GridBagLayout)p.getLayout()).setConstraints( startXmit, gbc);
         p.add( startXmit);
         TitledBorder titledBorder= new TitledBorder( new EtchedBorder(), "Source");
         p.setBorder( titledBorder);
         return p;
    private JPanel createTargetPanel() {
    JPanel p= new JPanel();
         GridBagLayout gridBagLayout= new GridBagLayout();
    GridBagConstraints gbc;
         p.setLayout( gridBagLayout);
         targets= new Vector();
         for( int i= 0; i < config.targets.size(); i++) {
         targets.addElement( config.targets.elementAt( i));
    listModel= new TargetListModel( targets);
    list= new JList( listModel);
         list.addKeyListener( this);
         list.setPrototypeCellValue( "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
    JScrollPane scrollPane= new JScrollPane( list,
    ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
    ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
         gbc= new GridBagConstraints();
         gbc.gridx= 0;
         gbc.gridy= 0;
         gbc.weightx= 1.0;
         gbc.weighty= 1.0;
         gbc.anchor= GridBagConstraints.CENTER;
         gbc.fill= GridBagConstraints.BOTH;
         gbc.insets= new Insets( 10, 5, 0, 0);
         ((GridBagLayout)p.getLayout()).setConstraints( scrollPane, gbc);
         p.add( scrollPane);
    JPanel p1= new JPanel();
         p1.setLayout( gridBagLayout);
         JLabel label= new JLabel( "IP Address:");
         gbc= new GridBagConstraints();
         gbc.gridx = 0;
         gbc.gridy = 0;
         gbc.weightx = 0.0;
         gbc.weighty = 0.0;
         gbc.anchor = GridBagConstraints.EAST;
         gbc.fill = GridBagConstraints.NONE;
         gbc.insets = new Insets( 5,5,0,5);
         ((GridBagLayout)p1.getLayout()).setConstraints( label, gbc);
         p1.add( label);
         tf_remote_address= new JTextField( 15);
         gbc= new GridBagConstraints();
         gbc.gridx = 1;
         gbc.gridy = 0;
         gbc.weightx = 0.0;
         gbc.weighty = 0.0;
         gbc.anchor = GridBagConstraints.WEST;
         gbc.fill = GridBagConstraints.NONE;
         gbc.insets = new Insets( 5,5,0,5);
         ((GridBagLayout)p1.getLayout()).setConstraints( tf_remote_address, gbc);
         p1.add( tf_remote_address);
         label= new JLabel( "Data Port:");
         gbc= new GridBagConstraints();
         gbc.gridx = 0;
         gbc.gridy = 1;
         gbc.weightx = 0.0;
         gbc.weighty = 0.0;
         gbc.anchor = GridBagConstraints.EAST;
         gbc.fill = GridBagConstraints.NONE;
         gbc.insets = new Insets( 5,5,0,5);
         ((GridBagLayout)p1.getLayout()).setConstraints( label, gbc);
         p1.add( label);
         tf_remote_data_port= new JTextField( 15);
         gbc= new GridBagConstraints();
         gbc.gridx = 1;
         gbc.gridy = 1;
         gbc.weightx = 0.0;
         gbc.weighty = 0.0;
         gbc.anchor = GridBagConstraints.WEST;
         gbc.fill = GridBagConstraints.NONE;
         gbc.insets = new Insets( 5,5,0,5);
         ((GridBagLayout)p1.getLayout()).setConstraints( tf_remote_data_port, gbc);
         p1.add( tf_remote_data_port);     
    JPanel p2= new JPanel();
    addTarget= new JButton( "Add Target");     
    removeTarget= new JButton( "Remove Target");
         p2.add( addTarget);
         p2.add( removeTarget);
         addTarget.addActionListener( this);
         removeTarget.addActionListener( this);
         gbc= new GridBagConstraints();
         gbc.gridx = 0;
         gbc.gridy = 2;
         gbc.weightx = 1.0;
         gbc.weighty = 0.0;
         gbc.gridwidth= 2;
         gbc.anchor = GridBagConstraints.CENTER;
         gbc.fill = GridBagConstraints.HORIZONTAL;
         gbc.insets = new Insets( 20,5,0,5);
         ((GridBagLayout)p1.getLayout()).setConstraints( p2, gbc);
         p1.add( p2);
         gbc= new GridBagConstraints();
         gbc.gridx= 1;
         gbc.gridy= 0;
         gbc.weightx= 1.0;
         gbc.weighty= 1.0;
         gbc.anchor= GridBagConstraints.CENTER;
         gbc.fill= GridBagConstraints.BOTH;
         gbc.insets= new Insets( 10, 5, 0, 0);
         ((GridBagLayout)p.getLayout()).setConstraints( p1, gbc);
         p.add( p1);
         TitledBorder titledBorder= new TitledBorder( new EtchedBorder(), "Targets");
         p.setBorder( titledBorder);
         return p;
    private JPanel createLocalPanel() {
    JPanel p= new JPanel();
         GridBagLayout gridBagLayout= new GridBagLayout();
    GridBagConstraints gbc;
         p.setLayout( gridBagLayout);
         JLabel label= new JLabel( "IP Address:");
         gbc= new GridBagConstraints();
         gbc.gridx = 0;
         gbc.gridy = 0;
         gbc.weightx = 0.0;
         gbc.weighty = 0.0;
         gbc.anchor = GridBagConstraints.EAST;
         gbc.fill = GridBagConstraints.NONE;
         gbc.insets = new Insets( 5,5,0,5);
         ((GridBagLayout)p.getLayout()).setConstraints( label, gbc);
         p.add( label);
         JTextField tf_local_host= new JTextField( 15);
         gbc= new GridBagConstraints();
         gbc.gridx = 1;
         gbc.gridy = 0;
         gbc.weightx = 0.0;
         gbc.weighty = 0.0;
         gbc.anchor = GridBagConstraints.WEST;
         gbc.fill = GridBagConstraints.NONE;
         gbc.insets = new Insets( 5,5,0,5);
         ((GridBagLayout)p.getLayout()).setConstraints( tf_local_host, gbc);
         p.add( tf_local_host);
         try {
    String host= InetAddress.getLocalHost().getHostAddress();     
         tf_local_host.setText( host);
         } catch( UnknownHostException e) {
         label= new JLabel( "Data Port:");
         gbc= new GridBagConstraints();
         gbc.gridx = 0;
         gbc.gridy = 1;
         gbc.weightx = 0.0;
         gbc.weighty = 0.0;
         gbc.anchor = GridBagConstraints.EAST;
         gbc.fill = GridBagConstraints.NONE;
         gbc.insets = new Insets( 5,5,0,5);
         ((GridBagLayout)p.getLayout()).setConstraints( label, gbc);
         p.add( label);
         tf_data_port= new JTextField( 15);
         gbc= new GridBagConstraints();
         gbc.gridx = 1;
         gbc.gridy = 1;
         gbc.weightx = 0.0;
         gbc.weighty = 0.0;
         gbc.anchor = GridBagConstraints.WEST;
         gbc.fill = GridBagConstraints.NONE;
         gbc.insets = new Insets( 5,5,10,5);
         ((GridBagLayout)p.getLayout()).setConstraints( tf_data_port, gbc);
         p.add( tf_data_port);
         tf_data_port.setText( config.local_data_port);
         TitledBorder titledBorder= new TitledBorder( new EtchedBorder(), "Local Host");
         p.setBorder( titledBorder);
         return p;
    public void actionPerformed( ActionEvent event) {
    Object source= event.getSource();
         if( source == addTarget) {
         String ip= tf_remote_address.getText().trim();
         String port= tf_remote_data_port.getText().trim();
         String localPort= tf_data_port.getText().trim();
         addTargetToList( localPort, ip, port);
         if( avTransmitter != null) {
         avTransmitter.addTarget( ip, port);
         } else if( source == removeTarget) {
         int index= list.getSelectedIndex();
         if( index != -1) {
              Target target= (Target) targets.elementAt( index);
              if( avTransmitter != null) {
         avTransmitter.removeTarget( target.ip, target.port);
              targets.removeElement( target);
              listModel.setData( targets);          
         } else if( source == startXmit) {
         if( startXmit.getLabel().equals( "Start Transmission")) {          
         int data_port= new Integer( tf_data_port.getText()).intValue();
              avTransmitter= new AVTransmitter( this, data_port);
         avTransmitter.start( tf_media_file.getText().trim(), targets);          
              avTransmitter.setLooping( cb_loop.isSelected());
         startXmit.setLabel( "Stop Transmission");
         } else if( startXmit.getLabel().equals( "Stop Transmission")) {
              avTransmitter.stop();
              avTransmitter= null;
              removeNonBaseTargets();
              listModel.setData( targets);
         startXmit.setLabel( "Start Transmission");          
         } else if( source == rtcp) {
         if( rtcpViewer == null) {
         rtcpViewer= new RTCPViewer();
         } else {
              rtcpViewer.setVisible( true);
              rtcpViewer.toFront();
         } else if( source == cb_loop) {
         if( avTransmitter != null) {
              avTransmitter.setLooping( cb_loop.isSelected());
    private void removeNonBaseTargets() {
         String localPort= tf_data_port.getText().trim();
         for( int i= targets.size(); i > 0;) {
         Target target= (Target) targets.elementAt( i - 1);
         if( !target.localPort.equals( localPort)) {
    targets.removeElement( target);
         i--;
    public void addTargetToList( String localPort,
                             String ip, String port) {     
    ListUpdater listUpdater= new ListUpdater( localPort, ip,
                                  port, listModel, targets);
    SwingUtilities.invokeLater( listUpdater);           
    public void rtcpReport( String report) {
         if( rtcpViewer != null) {
         rtcpViewer.report( report);
    public void windowClosing( WindowEvent event) {
         config.local_data_port= tf_data_port.getText().trim();
         config.targets= new Vector();
         for( int i= 0; i < targets.size(); i++) {
         Target target= (Target) targets.elementAt( i);
         if( target.localPort.equals( config.local_data_port)) {
              config.addTarget( target.ip, target.port);
         config.media_locator= tf_media_file.getText().trim();
         config.write();
    System.exit( 0);
    public void windowClosed( WindowEvent event) {
    public void windowDeiconified( WindowEvent event) {
    public void windowIconified( WindowEvent event) {
    public void windowActivated( WindowEvent event) {
    public void windowDeactivated( WindowEvent event) {
    public void windowOpened( WindowEvent event) {
    public void keyPressed( KeyEvent event) {
    public void keyReleased( KeyEvent event) {
    Object source= event.getSource();
         if( source == list) {
         int index= list.getSelectedIndex();
    public void keyTyped( KeyEvent event) {
    public void mousePressed( MouseEvent e) {
    public void mouseReleased( MouseEvent e) {
    public void mouseEntered( MouseEvent e) {
    public void mouseExited( MouseEvent e) {
    public void mouseClicked( MouseEvent e) {
    Object source= e.getSource();
         if( source == list) {
         int index= list.getSelectedIndex();
         if( index != -1) {
              Target target= (Target) targets.elementAt( index);
              tf_remote_address.setText( target.ip);
              tf_remote_data_port.setText( target.port);
         int index= list.locationToIndex( e.getPoint());
    public static void main( String[] args) {
    new Tx();
    class TargetListModel extends AbstractListModel {
    private Vector options;
    public TargetListModel( Vector options) {
         this.options= options;
    public int getSize() {
         int size;
         if( options == null) {
         size= 0;
         } else {
         size= options.size();
         return size;
    public Object getElementAt( int index) {
    String name;
    if( index < getSize()) {
         Target o= (Target)options.elementAt( index);
    name= o.localPort + " ---> " + o.ip + ":" + o.port;
         } else {
         name= null;
         return name;
    public void setData( Vector data) {
         options= data;
         fireContentsChanged( this, 0, data.size());
    class ListUpdater implements Runnable {
    String localPort, ip, port;
    TargetListModel listModel;
    Vector targets;
    public ListUpdater( String localPort, String ip, String port,
                   TargetListModel listModel, Vector targets) {
         this.localPort= localPort;
         this.ip= ip;
         this.port= port;
         this.listModel= listModel;
         this.targets= targets;
    public void run() {
    Target target= new Target( localPort, ip, port);
         if( !targetExists( localPort, ip, port)) {
         targets.addElement( target);
    listModel.setData( targets);
    public boolean targetExists( String localPort, String ip, String port) {
         boolean exists= false;
         for( int i= 0; i < targets.size(); i++) {
         Target target= (Target) targets.elementAt( i);
         if( target.localPort.equals( localPort)
         && target.ip.equals( ip)
              && target.port.equals( port)) {          
              exists= true;
         break;
         return exists;
    >>>>>>>>>>>>>>>>>
    import java.awt.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.*;
    import javax.media.*;
    import javax.media.protocol.*;
    import javax.media.format.*;
    import javax.media.control.TrackControl;
    import javax.media.control.QualityControl;
    import javax.media.rtp.*;
    import javax.media.rtp.event.*;
    import javax.media.rtp.rtcp.*;
    public class AVTransmitter implements ReceiveStreamListener, RemoteListener,
    ControllerListener {
    // Input MediaLocator
    // Can be a file or http or capture source
    private MediaLocator locator;
    private String ipAddress;
    private int portBase;
    private Processor processor = null;
    private RTPManager rtpMgrs[];
    private int localPorts[];
    private DataSource dataOutput = null;
    private int local_data_port;
    private Tx tx;
    public AVTransmitter( Tx tx, int data_port) {
         this.tx= tx;
         local_data_port= data_port;
    * Starts the transmission. Returns null if transmission started ok.
    * Otherwise it returns a string with the reason why the setup failed.
    public synchronized String start( String filename, Vector targets) {
         String result;
         locator= new MediaLocator( filename);
         // Create a processor for the specified media locator
         // and program it to output JPEG/RTP
         result = createProcessor();
         if (result != null) {
         return result;
         // Create an RTP session to transmit the output of the
         // processor to the specified IP address and port no.
         result = createTransmitter( targets);
         if (result != null) {
         processor.close();
         processor = null;
         return result;
         // Start the transmission
         processor.start();
         return null;
    * Use the RTPManager API to create sessions for each media
    * track of the processor.
    private String createTransmitter( Vector targets) {
         // Cheated. Should have checked the type.
         PushBufferDataSource pbds = (PushBufferDataSource)dataOutput;
         PushBufferStream pbss[] = pbds.getStreams();
         rtpMgrs = new RTPManager[pbss.length];
         localPorts = new int[ pbss.length];
         SessionAddress localAddr, destAddr;
         InetAddress ipAddr;
         SendStream sendStream;
         int port;
         SourceDescription srcDesList[];
         for (int i = 0; i < pbss.length; i++) {
         // for (int i = 0; i < 1; i++) {
         try {
              rtpMgrs[i] = RTPManager.newInstance();     
              port = local_data_port + 2*i;
              localPorts[ i]= port;
              localAddr = new SessionAddress( InetAddress.getLocalHost(),
                                  port);
              rtpMgrs.initialize( localAddr);          
              rtpMgrs[i].addReceiveStreamListener(this);
              rtpMgrs[i].addRemoteListener(this);
         for( int k= 0; k < targets.size(); k++) {
              Target target= (Target) targets.elementAt( k);
              int targetPort= new Integer( target.port).intValue();
              addTarget( localPorts[ i], rtpMgrs[ i], target.ip, targetPort + 2*i);
              sendStream = rtpMgrs[i].createSendStream(dataOutput, i);          
              sendStream.start();
         } catch (Exception e) {
              e.printStackTrace();
              return e.getMessage();
         return null;
    public void addTarget( String ip, String port) {
         for (int i= 0; i < rtpMgrs.length; i++) {
         int targetPort= new Integer( port).intValue();
         addTarget( localPorts[ i], rtpMgrs[ i], ip, targetPort + 2*i);
    public void addTarget( int localPort, RTPManager mgr, String ip, int port) {
         try {
         SessionAddress addr= new SessionAddress( InetAddress.getByName( ip),
                                  new Integer( port).intValue());
         mgr.addTarget( addr);
         tx.addTargetToList( localPort + "", ip, port + "");
         } catch( Exception e) {
         e.printStackTrace();
    public void removeTarget( String ip, String port) {
         try {     
         SessionAddress addr= new SessionAddress( InetAddress.getByName( ip),
                                  new Integer( port).intValue());
         for (int i= 0; i < rtpMgrs.length; i++) {
         rtpMgrs[ i].removeTarget( addr, "target removed from transmitter.");
         } catch( Exception e) {
         e.printStackTrace();
    boolean looping= true;
    public void controllerUpdate( ControllerEvent ce) {
         System.out.println( ce);
         if( ce instanceof DurationUpdateEvent) {
         Time duration= ((DurationUpdateEvent) ce).getDuration();
         System.out.println( "duration: " + duration.getSeconds());
         } else if( ce instanceof EndOfMediaEvent) {
         System.out.println( "END OF MEDIA - looping=" + looping);
         if( looping) {
         processor.setMediaTime( new Time( 0));
              processor.start();
    public void setLooping( boolean flag) {
         looping= flag;
    public void update( ReceiveStreamEvent event) {
         String timestamp= getTimestamp();
         StringBuffer sb= new StringBuffer();
         if( event instanceof InactiveReceiveStreamEvent) {
         sb.append( timestamp + " Inactive Receive Stream");
         } else if( event instanceof ByeEvent) {
         sb.append( timestamp + " Bye");
         } else {
         System.out.println( "ReceiveStreamEvent: "+ event);
         tx.rtcpReport( sb.toString());     
    public void update( RemoteEvent event) {     
         String timestamp= getTimestamp();
         if( event instanceof ReceiverReportEvent) {
         ReceiverReport rr= ((ReceiverReportEvent) event).getReport();
         StringBuffer sb= new StringBuffer();
         sb.append( timestamp + " RR");
         if( rr != null) {
              Participant participant= rr.getParticipant();
              if( participant != null) {
              sb.append( " from " + participant.getCNAME());
              sb.append( " ssrc=" + rr.getSSRC());
              } else {
              sb.append( " ssrc=" + rr.getSSRC());
              tx.rtcpReport( sb.toString());
         } else {
         System.out.println( "RemoteEvent: " + event);
    private String getTimestamp() {
         String timestamp;
         Calendar calendar= Calendar.getInstance();
         int hour= calendar.get( Calendar.HOUR_OF_DAY);
         String hourStr= formatTime( hour);
         int minute= calendar.get( Calendar.MINUTE);
         String minuteStr= formatTime( minute);
         int second= calendar.get( Calendar.SECOND);
         String secondStr= formatTime( second);
         timestamp= hourStr + ":" + minuteStr + ":" + secondStr;     
         return timestamp;
    private String formatTime( int time) {     
         String timeStr;
         if( time < 10) {
         timeStr= "0" + time;
         } else {
         timeStr= "" + time;
         return timeStr;
    * Stops the transmission if already started
    public void stop() {
         synchronized (this) {
         if (processor != null) {
              processor.stop();
              processor.close();
              processor = null;
         for (int i= 0; i < rtpMgrs.length; i++) {
         rtpMgrs[ i].removeTargets( "Session ended.");
              rtpMgrs[ i].dispose();
    public String createProcessor() {
         if (locator == null) {
         return "Locator is null";
         DataSource ds;
         DataSource clone;
         try {
         ds = javax.media.Manager.createDataSource(locator);
         } catch (Exception e) {
         return "Couldn't create DataSource";
         // Try to create a processor to handle the input media locator
         try {
         processor = javax.media.Manager.createProcessor(ds);
         processor.addControllerListener( this);     
         } catch (NoProcessorException npe) {
         return "Couldn't create processor";
         } catch (IOException ioe) {
         return "IOException creating processor";
         // Wait for it to configure
         boolean result = waitForState(processor, Processor.Configured);
         if (result == false)
         return "Couldn't configure processor";
         // Get the tracks from the processor
         TrackControl [] tracks = processor.getTrackControls();
         // Do we have atleast one track?
         if (tracks == null || tracks.length < 1)
         return "Couldn't find tracks in processor";
         // Set the output content descriptor to RAW_RTP
         // This will limit the supported formats reported from
         // Track.getSupportedFormats to only valid RTP formats.
         ContentDescriptor cd = new ContentDescriptor(ContentDescriptor.RAW_RTP);
         processor.setContentDescriptor(cd);
         Format supported[];
         Format chosen;
         boolean atLeastOneTrack = false;
         // Program the tracks.
         for (int i = 0; i < tracks.length; i++) {
         Format format = tracks[i].getFormat();
         if (tracks[i].isEnabled()) {
              supported = tracks[i].getSupportedFormats();
              // We've set the output content to the RAW_RTP.
              // So all the supported formats should work with RTP.
              // We'll just pick the first one.
              if (supported.length > 0) {
              if (supported[0] instanceof VideoFormat) {
                   // For video formats, we should double check the
                   // sizes since not all formats work in all sizes.
                   chosen = checkForVideoSizes(tracks[i].getFormat(),
                                       supported[0]);
              } else
                   chosen = supported[0];
              tracks[i].setFormat(chosen);
              System.err.println("Track " + i + " is set to transmit as:");
              System.err.println(" " + chosen);
              atLeastOneTrack = true;
              } else
              tracks[i].setEnabled(false);
         } else
              tracks[i].setEnabled(false);
         if (!atLeastOneTrack)
         return "Couldn't set any of the tracks to a valid RTP format";
         // Realize the processor. This will internally create a flow
         // graph and attempt to create an output datasource for JPEG/RTP
         // audio frames.
         result = waitForState(processor, Controller.Realized);
         if (result == false)
         return "Couldn't realize processor";
         // Set the JPEG quality to .5.
         setJPEGQuality(processor, 0.5f);
         // Get the output data source of the processor
         dataOutput = processor.getDataOutput();
         return null;
    static SessionAddress destAddr1, destAddr2;
    * For JPEG and H263, we know that they only work for particular
    * sizes. So we'll perform extra checking here to make sure they
    * are of the right sizes.
    Format checkForVideoSizes(Format original, Format supported) {
         int width, height;
         Dimension size = ((VideoFormat)original).getSize();
         Format jpegFmt = new Format(VideoFormat.JPEG_RTP);
         Format h263Fmt = new Format(VideoFormat.H263_RTP);
         if (supported.matches(jpegFmt)) {
         // For JPEG, make sure width and height are divisible by 8.
         width = (size.width % 8 == 0 ? size.width :
                        (int)(size.width / 8) * 8);
         height = (size.height % 8 == 0 ? size.height :
                        (int)(size.height / 8) * 8);
         } else if (supported.matches(h263Fmt)) {
         // For H.263, we only support some specific sizes.
         if (size.width < 128) {
              width = 128;
              height = 96;
         } else if (size.width < 176) {
              width = 176;
              height = 144;
         } else {
              width = 352;
              height = 288;
         } else {
         // We don't know this particular format. We'll just
         // leave it alone then.
         return supported;
         return (new VideoFormat(null,
                        new Dimension(width, height),
                        Format.NOT_SPECIFIED,
                        null,
                        Format.NOT_SPECIFIED)).intersects(supported);
    * 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("- Setting quality to " +
                             val + " on " + qc);
                   break;
              if (qc != null)
              break;
    * Convenience methods to handle processor's state changes.
    private Integer stateLock = new Integer(0);
    private boolean failed = false;
    Integer getStateLock() {
         return stateLock;
    void setFailed() {
         failed = true;
    private synchronized boolean waitForState(Processor p, int state) {
         p.addControllerListener(new StateListener());
         failed = false;
         // Call the required method on the processor
         if (state == Processor.Configured) {
         p.configure();
         } else if (state == Processor.Realized) {
         p.realize();
         // Wait until we get an event that confirms the
         // success of the method, or a failure event.
         // See StateListener inner class
         while (p.getState() < state && !failed) {
         synchronized (getStateLock()) {
              try {
              getStateLock().wait();
              } catch (InterruptedException ie) {
              return false;
         if (failed)
         return false;
         else
         return true;
    * Inner Classes
    class StateListener implements ControllerListener {
         public void controllerUpdate(ControllerEvent ce) {
         // If there was an error during configure or
         // realiz

    I do this all the time, I put my MBP to a 60 inch Sharp. If you have the video working do the simple thing first. Check to make sure your sound is on your TV and Mac. Then if that doesn't work go to System Prefrences and under sound go to a tab called Output and see if your TV is listed and if it is change it to that setting
    Hope It Works

  • HOW DO I FIND THE DRIVERS FOR WINDOWS 8 AUDIO AND VIDEO TO UNINSTALL?

    I NEED TO INSTALL AND UNINSTALL WINDOWS 8 DRIVERS FOR AUDIO AND VIDEO SO THAT I MAY REINSTALL THEM, BUT I DON'T KNOW WHERE TO GO TO FIND THEM IN THE FIRST PLACE.
    ALSO, IF I PURCHASE THE PROGRAM FOR UPDATING DRIVERS, WILL THAT PROGRAM ALSO INSTALL THE NEW AUDIO/VIDEO DRIVERS AND UNINSTALL THE FORMER ONES SO THAT I DON'T HAVE TO GO THROUGH SO MANY STEPS BY MYSELF. I FIND THE DIRECTIONS TO DO THIS FOR MYSELF VERY COMPLICATED.

    Hi, I would like to assist you on this matter, however I would need some information from you first.  I see that you are running windows 8. What is the make and model number of the computer that you are using?  The windows 8 that you are using, is it a 32 bit or a 64 bit operating system?  Please write back and I will be happy to do research on this issue.
    Thank you
    Waterboy71
    Click the “Kudos Thumbs Up" at the bottom of this post to say “Thanks” for helping!
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    W a t e r b o y 71
    I work on behalf of HP

Maybe you are looking for