RTPPeer To Peer live capture

Hi I think I am doing what I have read in JMF documentation and examples but I am not able to see visual component in JFrame. I did selected Lightweight component in Manager. And I also see packets going back and forth in wireshark but I do not hear any audio.
Please see the following code and let me know if find anything wrong...Thanks in advance.
* To change this template, choose Tools | Templates
* and open the template in the editor.
package rtppeertopeer;
import java.util.Vector;
import java.net.InetAddress;
import java.awt.Component;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.media.Buffer;
import javax.media.MediaLocator;
import javax.media.CaptureDeviceInfo;
import javax.media.CaptureDeviceManager;
import javax.media.Player;
import javax.media.ControllerEvent;
import javax.media.ControllerListener;
import javax.media.Processor;
import javax.media.rtp.Participant;
import javax.media.rtp.SendStream;
import javax.media.rtp.ReceiveStreamListener;
import javax.media.rtp.SessionListener;
import javax.media.rtp.event.*;
import javax.media.rtp.ReceiveStream;
import javax.media.Manager;
import javax.media.rtp.RTPManager;
import javax.media.format.AudioFormat;
import javax.media.protocol.ContentDescriptor;
import javax.media.protocol.DataSource;
import java.io.IOException;
import javax.media.format.UnsupportedFormatException;
import javax.media.NoPlayerException;
* @author lbana
public class RTPPeerToPeer extends JPanel
implements ReceiveStreamListener, SessionListener, ControllerListener {
private Processor m_capProcessor;
private Player m_player;
private DataSource m_dataSource;
private RTPManager m_rtpManager;
private RTPSocketAdapter m_rtpSock;
private SendStream m_sendStream;
private LocalProcessor m_localProcessor;
private JPanel m_jpanel;
private JFrame m_jframe;
public RTPPeerToPeer(String ipaddr, int port)
try
m_localProcessor = new LocalProcessor();
/* Server and Client uses same address */
InetAddress iaddr = InetAddress.getByName(ipaddr);
m_rtpManager = RTPManager.newInstance();
m_rtpSock = new RTPSocketAdapter(iaddr, port);
m_rtpManager.initialize(m_rtpSock);
m_sendStream = m_rtpManager.createSendStream(m_dataSource, 0);
registerManagerSessionListeners();
m_sendStream.start();
catch (UnsupportedFormatException exe)
exe.printStackTrace();
catch (IOException exe)
exe.printStackTrace();
public void setJFrame(JFrame frm)
m_jframe = frm;
public void registerManagerSessionListeners()
m_rtpManager.addReceiveStreamListener(this);
public void start()
m_capProcessor.start();
public void stop() throws IOException
m_capProcessor.stop();
m_sendStream.stop();
public void close()
m_capProcessor.close();
m_sendStream.close();
public void controllerUpdate(ControllerEvent evt)
public void update(ReceiveStreamEvent evt)
RTPManager mgr = (RTPManager)evt.getSource();
System.out.println(evt.toString());
if (evt instanceof ActiveReceiveStreamEvent)
ActiveReceiveStreamEvent arstrm = (ActiveReceiveStreamEvent)evt;
System.out.println(arstrm.toString());
else if (evt instanceof InactiveReceiveStreamEvent)
InactiveReceiveStreamEvent irstrm = (InactiveReceiveStreamEvent)evt;
System.out.println(irstrm.toString());
else if (evt instanceof NewReceiveStreamEvent)
NewReceiveStreamEvent nstrevt = (NewReceiveStreamEvent)evt;
ReceiveStream strm = nstrevt.getReceiveStream();
Participant participant = nstrevt.getParticipant();
DataSource ds = strm.getDataSource();
System.out.println(nstrevt.toString());
if (participant != null)
System.out.println(participant.toString());
try
* Player for inbound RTP packets.
m_player = Manager.createPlayer(ds);
m_player.addControllerListener(this);
Statehelper procHelper = new Statehelper(m_player);
procHelper.configure(1000);
procHelper.realize(5000);
JComponent visComp = (JComponent)m_player.getVisualComponent();
JComponent ctrlComp = null; //(JComponent)m_player.getControlPanelComponent();
if (visComp != null)
//add(visComp);
else
System.out.println("Component is NULL");
if (ctrlComp != null)
add(ctrlComp);
repaint();
catch (NoPlayerException exe)
exe.printStackTrace();
catch (IOException exe)
exe.printStackTrace();
else if (evt instanceof RemotePayloadChangeEvent)
else if (evt instanceof StreamMappedEvent)
else if (evt instanceof TimeoutEvent)
else
public void update(SessionEvent evt)
System.out.println(evt.toString());
if (evt instanceof LocalCollisionEvent)
LocalCollisionEvent levt = (LocalCollisionEvent)evt;
System.out.println(levt.toString());
else if (evt instanceof NewParticipantEvent)
RTPManager mgr = (RTPManager)evt.getSource();
NewParticipantEvent npart = (NewParticipantEvent)evt;
Participant nusr = npart.getParticipant();
System.out.println(nusr.getCNAME());
System.out.println(nusr.toString());
else
System.out.println("Unknown SessionEvent received.");
* Constructing Processor for Microphone.
class LocalProcessor
public LocalProcessor()
m_capProcessor = createProcessor();
m_dataSource = m_capProcessor.getDataOutput();
public Processor createProcessor()
Processor processor = null;
Statehelper procHelper = null;
AudioFormat frmt = new AudioFormat(AudioFormat.LINEAR,
44100, /* Sampling */
16, /* num of bits */
1); /* mono */
Vector<CaptureDeviceInfo> devList =
CaptureDeviceManager.getDeviceList(frmt);
for (int i = 0; i < devList.size(); i++)
System.out.println(devList.get(i).toString());
if (devList.size() == 0)
System.out.println("CaptureDeviceManager could not locate devinfo");
return null;
CaptureDeviceInfo cdev = devList.get(0);
try
/* Processor for transmitting captured source from Microphone. */
processor = Manager.createProcessor(cdev.getLocator());
procHelper= new Statehelper(processor);
procHelper.configure(1000);
processor.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW_RTP));
procHelper.realize(1000);
catch (Exception exe)
exe.printStackTrace();
return processor;
}

Thanks for the response...I haven't pasted my complete source code. Statehelper.java is Sunjava jmf implementation. Here is my
main.
public static void constructGUI(String ipaddr, int port)
        JFrame.setDefaultLookAndFeelDecorated(true);
        JFrame    frame = new JFrame("My Frame");
        Dimension dim   = new Dimension(300, 600);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setPreferredSize(dim);
        RTPPeerToPeer rtp = new RTPPeerToPeer(ipaddr, port);
        frame.getContentPane().add(rtp);
        //jmfc.createRecord();
        frame.pack();
        frame.setVisible(true);
        rtp.start();
    }Seems like I selected "code" but didn't look like it enabled in my previous post....pls ignore the previous.
sorry for the noise

Similar Messages

  • Live Capture with a camera via firewire and usb audio interface

    I am trying to do a live capture through Final Cut 7.
    I want the video feed through the firewire from my HVX200 and the audio feed from a 4 channel usb audio interface (Alesis iO4).
    When I have both audio and video input coming in from the HVX200, the live capture works fine.
    However, when I change the audio input so that it is coming from the usb audio interface, final cut has an error message saying "Video is not available."
    During the preview, I see the video clearly and am getting levels from the iO4.
    But when I try to capture, I get the error message.
    Is it a processor issue (I've attached my specs below) with problems handling 2 separate inputs?
    I'm not quite sure what the problem is.
    Any input is greatly appreciated.
    Thanks!
    Model Name:          MacBook Pro
      Model Identifier:          MacBookPro5,3
      Processor Name:          Intel Core 2 Duo
      Processor Speed:          2.66 GHz
      Number Of Processors:          1
      Total Number Of Cores:          2
      L2 Cache:          3 MB
      Memory:          4 GB
      Bus Speed:          1.07 GHz

    Hi MtD,
    Yes I am changing the Capture preset to iO4.  Once that happens, it lets me run both the camera and the iO4 into the laptop but then an error message pops up the moment I try to capture it.
    I was only trying to use 3 out of the 4 channels of the iO4.
    Thanks!

  • Live Capture from Video Mixer

    I'm having a problem with getting my Powerbook to communicate with my Videonics MXPro Dv digital video switcher. The switcher has firewire out which works when I connect to a camera but I can't get Final Cut 5 to connect with it. I have set up my device setting as non-controllable but with no success. I am trying to capture SD footage of school musical. Any thoughts?

    Additional thoughts...
    If you have a DV camera/deck, I'd try to use that instead of the Canopus. This way, you could record to tape what you're capturing live.
    Granted, there is timecode differences between the two, but it serves as a backup, should the live capture fail. (and trust me, it will at some point...Mr. Murphy says so)
    For our workflow, we do a couple of things...for mission critical events, we ISO record to tape in each camera and to a Deck (live to tape), as well as the live capture into FCP.
    We then capture all tapes and cut shows from that. This way, we have DV recorded quality from camera tapes, along with proper timecode, which comes in handy, should we ever have to revisit the project. (the live capture becomes our redundant backup recording, which we dump after the show is a lock)
    For non-mission critical, we just record the live cut to the deck, along with the live capture into FCP. We can cut from either, then we can dump the live captures from the drives (saving valuable disk space) and still have tape backup to re-cut if needed.
    K

  • Extracting Photos From Live Capture Mode

    Greetings,
    Is it possible to capture still frames live from my HD camcorder when I connect it to Final Cut Express and open Live Capture mode? I'm working on a stop motion animation and thought being able to capture photos from my camcorder and then have them directly transferred into my editing program would be useful.
    Thanks

    Have you looked at this:
    http://www.boinx.com/istopmotion/overview/
    MtD

  • Live Capture Plus, CatDV and FCPX Import Files

    I have tested my workflow process as set out in thread:
    Re: Is my workflow reasonable for a beginner?
    capturing Sony handycam DV using Live Capture Plus - that seems to work fine.
    Files set up in CatDV under the appropriate directory structure as mov type files - that seems to work fine.
    Tested files with QuickTime and the Inspector shows DV for the imported clips.
    Went into FCPX used Import Files - I selected the DV file in the CatDV directory and checked Create Optimizd Media.  The problem is that transcoded media was not created in the Event directory as I thought would happen.
    I do get a small alias file in the Event - Original Media directory.
    The clip does import and opens fine in FCPX - on reveal it points to the DV media in the CatDV Directory.
    Is there a reason ProRes422 optimized media was not created?
    Additionally going into the event after the import and trying to optimize the clip manually the Create Optimized Media (and Create Proxy Media) options are greyed out.
    Thanks.

    Read the help file on importing and on the page Import Preferences their are a few words that indicate:
    "If the original camera format can be edited with good performance, this option will be dimmed." as it relates to creating optimized files.
    Guess that means the DV file provide "good performance".

  • Is there a way to live capture in FCP X? I use a SONY NX 70U. It only has usb 2, HDMI and the weirdo sony protocol.

    Is there a way to live capture in FCP X? I use a SONY NX 70U. It only has usb 2, HDMI and the weirdo sony protocol. If not with THIS camera as I have described, is it possible with any other cameras?
    Thanks.

    Is there a way to live capture in FCP X? I use a SONY NX 70U. It only has usb 2, HDMI and the weirdo sony protocol. If not with THIS camera as I have described, is it possible with any other cameras?
    Thanks.

  • Fc express and live capture with non-controllable devices

    final cut pro allows live capture from non-controllable devices, by selecting this option in the capture window (as i understand). in my case that would be a sony dvc trv900e which i want to use without a tape loaded, and that means no timecode is transmitted.
    is it possible to do this in fc express? when i try to capture, i just get the window up saying waiting for timecode...

    great - thanks! i've read in numerous places that it is not possible in fc express, which i found hard to believe. i found the preset in the easy setup options. hallelujah!

  • Help!  Frames Dropped During Live Capture

    I am trying to switch over to Adobe Premiere from Final Cut Pro, but am having a serious problem with frames being dropped during capture.  When I do have frames dropped, it doesn't even save the video that it was capturing.  All that I get is a corrupt file that won't open.
    I'm using a Mac Pro with 3.0Ghz Dual Core Xeon Processor, 9GB 667MHz RAM, and a BlackMagic Decklink SDI card, and am trying to capture 720p 59.94fps video over SDI.  I am capturing to an interal 1TB 7200RPM dedicated scratch disk that is not used for ANTYHING but live capture.  The OS is 10.6.8.
    I only have 3 capture options in Premiere using the Blackmagic card: 8-bit, 10-bit or DVCHDPRO.  I want to use 8-bit, because DVCHDPRO is 960x720 instead of 1280x720.  But, I have tried DVCHDPRO and it did not work either.  I can successfully capture video for 5-10 minutes, but then I always get the Warning that frames were dropped and Premiere fails to save the video properly so that it can be opened.
    I have used BlackMagic's speed test app and determined that my internal hard drive's data rate is plenty sufficient for both 8-bit and DVCHDPRO.
    Final Cut Pro 6 has always captured perfectly fine using this exact setup.  It even gives me a lot more capture options for the BlackMagic card - I'm not sure why I'm limited to only those 3 capture settings in Premiere.
    I would really appreciate some help to point me in the right direction to get this resolve.  Thanks!

    Randal,
    It might be a bit tough on a fast computer, especially if the BIOS are not set to show POST at boot-up, a common setting nowadays. As Steve says, the exact key will differ by your BIOS brand.
    You may not actually see the particular logo screen, that Steve is talking about. I'd do a cold-boot and immediately tap the ESC key. If this does not get you into your BIOS Setup, then repeat, but tap the F1 key. When I say "immediately," I mean immediately upon hitting the Power On button.
    With older computers, you had about 5 sec. to get into Setup, but not anymore. On my laptop, I still have trouble hitting the F8 key fast enough to boot Windows into Safe Mode. I miss it, more than I get it. Could also be that I've been away from gaming for too many decades, and my gunfighter reflexes ain't what they used to be, but I'll just blame it on faster computers. I have the same problem with trying to flush my Preferences in Adobe programs, gotta' hit the Shift-Ctrl-Alt key at precisely the right time. [Exact key combo does differ with some Adobe programs]
    Also, if you can give us the name of your BIOS, say "Award," we might be able to give the exact key to hit for Setup. If you have the MoBo manual, it will be in there, plus the correct key. You still have to be quick, however.
    Good luck,
    Hunt

  • Tape or Live Capture? Quality Difference?

    I have never captured live footage direct from camera to computer. I have an opportunity to do so tomorrow on a 2-camera shoot. I have questions:
    1) Is it possible to capture 2 firewire streams simultaneously in OnLocation or with some other program?
    2) Is there a quality difference between live capture from an HDV camcorder and from a tape?
    3) I have a Matrox MX02 Mini with which I can capture a stream via component HD. How does this compare quality-wise to HDV?
    It is a long event - a bodybuilding contest (about 4 hours)  I would love to save time not having to capture from tape afterwards, but wondering if the setup is worth it. I do not have a laptop, so I would bring my editing computer to the gig.

    Hi(Bonjour)!
    If you shooted in DV format (standard resolution) monitor your footage on a Standard tv monitor, not on a HD one.
    Did you shoot with extended play activated ?
    See this post:
    http://discussions.apple.com/click.jspa?searchID=-1&messageID=3921401
    Michel Boissonneault

  • Lower thirds during live capture?

    Hi guys,
    Is it possible to drop a lower third clip during live capture?
    Our church have a Mac Pro with AJA Kona 3 and Final Cut Studio 2. A panasonic video mixer with 2 SDI cameras. Basically we capture our church services and edit the lower thirds later. Is there a way that we can do this on the fly with our setup? Someone told us that Velocity has something like that and they just drop the lower third clip on the timeline. Can FCP do this too?
    Thanks
    Message was edited by: dichiee

    Thanks for the quick response Shane.
    What CG hardware do you recommend?
    Also question about the AJA, I found this info
    Internal HD/SD Live Hardware Keyer
    Available for the first time on any QuickTime capture card is a powerful hardware keyer that can place graphic files with an alpha channel over video input, a selectable matte or the contents of the card’s framebuffer (KONA TV/Final Cut Pro). Even more than that, you can also key video that has an alpha channel over video input or a matte. For example, you can load a QuickTime clip with an alpha-channel — a flying logo perhaps — into KONA TV, then place it over live video coming into the card.
    Is this the same as the CG Hardware you are talking about?

  • TIME CODE in live capture

    I want to record live recording to Digibeta and capturing to FCP (AJA IO LD) in the same time with same TIMECODE!
    If I connect RS422 to AJA box, and begin record on VTR and FCP, FCP stops after couple of seconds...
    Any help???

    Not sure you can do this, because you have to have FCP set for 'non-controllable' device for the live capture.
    Maybe the AJA box supercedes this...others may know.
    Are you set for 'non-controllable device'? With this capture setting, FCP will generate it's own timecode.
    K

  • Live capture into PP CC 2014

    I have a Samsung NX30 mirrorless camera, which I purchased to assist me in making videos - I work alone. The camera streams video at 1080p @ 30fps over HDMI 1.4a. Older, tape-based cameras streamed video into PP via live capture over FireWire. A similar live video capture feature for HDMI capture cards would provide for a workflow as efficient as FireWire capture used to be. BTW, I tried 3 BlackMagic capture cards, which advertised such a feature and none of them worked. Does anyone have a solution for live capture with this camera?

    It's quite possible that there is nothing wrong with any of the capture cards you tried and it could be the camera. Did you try capturing any other HDMI video sources other than the NX30? Here's the thing - "camcorders" with HDMI outputs send out a very standard 1080i signal in most cases, and they "just work" whether talking about video capture to a PC or using a portable recorder such as the Atomos Ninja 2 device.
    DSLR cameras are another story entirely. When DSLRs first started offering HD video recording a few years ago, a lot of them had non-standard HDMI outputs. Some cameras had viewfinder data overlays on the HDMI output that could NOT be disabled, rendering the HDMI output useless for recording. Some cameras also put out a weird frame sizing that was cropped or otherwise non-standard. Most newer models of Canon, Panasonic, and Sony DSLRs are now putting out a standard signal that works, in part due to the efforts of Atomos working directly with the camera makers.
    Some of the DSLRs that will work with Atomos don't do so "out of the box" - the user is required to go into the DSLR setup menu and get all the settings "just so" to make it work. While it is quite common for DSLR videographers to want to connect to a portable recorder such as the Atomos units, much less likely when talking about desktop capture, so that is why I keep referencing Atomos, since I don't know anyone connecting a DSLR to a BlackMagic card for instance.
    So, while you may be able to connect the NX30 HDMI output directly to an HD screen and get a picture, that is not a guarantee that the same HDMI output is going to work with a "capture card". I checked here What cameras are supported? | Atomos and see no mention of any Samsung camera models. That does not necessarily mean it is not possible to record the output, but not a good sign that it is not mentioned. The solution might be as simple as changing a camera menu setting or record mode or something, but I'm not familiar with that camera personally.
    I see that the NX30 can record 1080p60, so please note that most capture cards do not accept 1080p60 inputs. I did see camera specs that suggest the HDMI output is 1080p30 and that *should* work.
    Just to give you an idea of the compatibility issues with recording HDMI from DSLRs, check these links: http://atomos.helponclick.com/kb/article/ninja-tests-with-popular-dslr-cameras
    F3 - What cameras work with Atomos recorders? - ATOMOS
    May I ask the intended workflow? Is there a reason that the video recorded to SD card is not going to work out for your needs, making "live capture" preferable?
    Thanks
    Jeff Pulera
    Safe Harbor Computers
    www.sharbor.com

  • Live Capture Plus

    I have notice a lot of people talking about Live Capture Plus and just purchased a copy. It seems to be working great at splitting full tapes into smaller clips.
    The problem I am having, is once the clips are imported into FCP they need to be rendered before they can be viewed. Is that normal?? I have tried capturing with every possible setting Live Capture has and everyone comes up as needing rendering in FCP
    It seems rather pointless to have a program that does not capture in a format that is compatible with FCP so I am going to assume that I am doing something wrong.
    Anyone able to lend a hand??
    Thanks

    mpeg4 is a DELIVERY format, not an editing one.
    If the material is a DV tape, use the settings for DV-ntsc or DV-pal (which ever is appropriate) in setting up your format for capture.
    In FCP use the EASY SETUP for DV-ntsc or DV-pal (which ever is appropriate) and life is good.
    cheers,
    x

  • Live capture with FCE 4 and Canon HV20 - End of Tape when capture in HD

    I have a Canon HV20 HiDef video camera that was given to me to record an event. I want to try and avoid using the tapes if possible and capture the video directly into my MacBook Pro using FCE 4.
    If I try and capture video when the camera is set to HD output, the capture screen comes up, I can see the image from the camera on the FCE4 screen for a split second, then I get a message indicating the end of tape has been encountered. (The tape isn't even being used and is no where near the end anyway).
    If I change the camera to DV output, I can change the FCE4 Easy Setup to simple DV control and it works fine to capture live, except that it is no longer in HD. I get no error message about the tape end being hit.
    I am unable to find any Easy Setup configuration that will allow me to record live. Any suggestions?
    Thanks.

    Play your tape forward to a position where there is continuous Timecode and try again.
    As Ian suggests the correct _AIC Easy Setup_ is the only way to get HDV in to your Mac via FCE.
    Note: Your camera must be set to output HDV assuming it recorded HDV.
    Al

  • HD Live Capture (aka Capture Now fcp7) into FCPX

    I imagine that if you can capture live footage from an onboard iSight camera, you should be able to plug something a little nicer in that gives you a little more control. I've been struggling with this for the past few weeks and have been to a few different stores to test cameras and haven't found anything that works yet.
    My criteria for the camera needs to be HD and I need to be able to get a lav mic plugged into it.
    Other than that, I'm pretty open to whatever (preferrably something around $2-5k).
    Any thoughts and input would be greatly appreciated.
    Thanks,
    Ian

    That make not a great difference for me.
    I only see that I cannot capture videos using my DV Firewire camera as a video converter.
    Probably timecode is not so important (for me) since FCE captures without it, FCP X by iSight captures without it, Quicktime (for only about an hour) capture without it, iMovie captures (? I have never tried) without it... but all of them capture the video!!! And do the job.
    I think that a checkmark in the prefs to choose "ignore time code" would be great.

Maybe you are looking for

  • Crystal Report 2008 / JavaScript hyperlink formula/ Issue

    Hi, We've developed the Crystal Report using the Crystal Reports 2008 software & integrated it in asp.net web page and also deployed in IIS web server. We have a requirement like opening the sub report in a new window. We have integrated the sub repo

  • Auto update to 10.6.8 and now mail is not working

    My grandfathers computer just ran an auto update to OS X version 10.6.8.  Now when I go to open mail it says it can not run with this version.   Mail version is 4.5.

  • 20inch cinema display not working via ADC?

    Heres the specs on my Mac Dual 450mhz Gigabit Ethernet Model OS X 10.3.9 1.38GB SDRAM ATI 128 video card -----> now nvidia GeForce 4 MX The Story: I have had my G4 since it was new. I bought it with the 17" Studio Display and it has worked fine. and

  • Strange Keyboard behaviour with Pressure on Body

    Any else experience this problem? Basically when I am typing and I lean with my palms on the body of the macbook (not overly hard) the keyboard starts acting really strange. Keys I press won't work, and other keys will just randly start being hit. If

  • File Save As Other Text  IS NOT WORKING.  Why?

    I have a PDF file with a table and selectable data.   I want to save it as text.   I go to File > Save As Other > Text.  The Save As dialog box opens, I name the file, click Save.  NOTHING.  Absolutely nothing.  Not in the save location.  I repeat th