Stream from and to a programs STDIO

I think the topic already says what I'm looking for.
How do I 'connect' to a different program already running?!
Its a program that gives out information line by line every so often (normal console application).
I'd like to react to certain lines by feeding it stuff through the standard-in (just like typing into the console).
All I know is that you do it using streams. Can anyone help?
Thanks!

Runtime rt = Runtime.getRuntime();
Process p = rt.exec("otherprogram.exe");
PrintWriter pw = new PrintWriter(p.getOutputStream());
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));

Similar Messages

  • Minimum requirements to stream from and sync to?

    I am considering purchasing an AppleTV and was hoping to use my old 533MHz G4 PowerMac as the "host" for my media. I'm running Tiger Server on it with a wire connection to my AirPort Extreme (802.11n). I know the PowerMac itself can't play the HD video based on iTunes 9 requirements but I am hoping I can plug my 1TB drive into it and still stream from and sync back to it.
    Any thoughts on the possibility this will work?

    as long as you can get the latest and greatest iTunes running on it, it should work fine...
    Min Rec for iTunes..
    Macintosh Software
    Mac OS X version 10.4.11 or later; Mac OS X version 10.5 or later is required to play an iTunes LP or iTunes Extras
    QuickTime 7.6 or later
    Support for HE-AAC requires QuickTime 7.6.4 and Mac OS X version 10.5 or later
    Safari 4 or later
    200MB of available disk space
    Message was edited by: tmartine

  • Can two programs recive the same stream from the same port?

    I am sending a video from a server to my client on port 23456.
    On my client I am running a videoreciver that shows the video, and I also want to run a program that receives the strem with datagramSocket and writes out statistics.. Is this possible? or wil I get: can't open local dataport..
    do I have to runn it one by one.. and maybe send the vide two times?

    What you should do is just layer the functionalities, so that you have one class that reads the stream from the port and buffers it. You can then have multiple clients that read this buffered stream.

  • Is it possible to use an AirPort Time Capsule as both a Time Machine and an external hard drive from which to stream from?

    I recently purchased a new 2TB Time Capsule. I purchased it in hopes that I can set it up in 2 ways.
    1. Empty my almost completely full MacBook harddrive onto it (mostly movies, music, and photos) that I can stream directly from via iTunes and my Apple TV (this will allow me to free up much needed space on my MacBook)
    2. Use it as a wireless Time Capsule to back up what is left on my harddrive
    I currently use another external harddrive as a time machine but it is a cumbersome process. I know that Time Capsule's weren't built to be partined for needs such as this, but I've been told by Apple that it is possible. Does anyone know how? Any advice would be greatly appreciated.
    Thanks!

    1. Empty my almost completely full MacBook harddrive onto it (mostly movies, music, and photos) that I can stream directly from via iTunes and my Apple TV
    Yes, you can use the Time Capsule to provide both a wired and wireless network AND media storage to stream from an iTunes host device to an Apple TV. As an example, you can place your iTunes Library on either the TC's internal HDD or an external USB HDD attached to the TC. You can then access this library from iTunes located on a Mac or PC, and then, stream it to the Apple TV.
    2. Use it as a wireless Time Capsule to back up what is left on my harddrive
    Yes, you can use the TC as a backup destination for either Time Machine or any other network-ready backup program. Again you can either use its internal HDD or an attached USB HDD for this purpose.

  • Can I stream video and audio from Game Center Live to my HDTV using Apple TV?

    I am trying to stream hockey games from Game Center Live to my HDTV through a cabled ethernet connect to my Macbook Air and then wirelessly to my Apple TV.  Apparently my Apple TV cannot find my Macbook Air because I cannot make the connection.  Alternatively, I have heard that I might be able to access Game Center Live directly with my Apple TV but I'm not sure how to do that.  Any advice is most appreciated.

    You can only access content directly through a native app on Apple TV. To stream from your MBA you would need to use airplay mirroring, which will require a model from 2011 or later running OS X 10.8 or later. The alternative would be to use a 3rd party program like Airparrot, results vary to use the trial first.

  • Capturing, timestamping and saving a video stream from a webcam ?

    Hello everybody,
    Glad to be in this forum.
    I got to do a program in java doing :
    - a capture of a video stream from a webcam
    - adding time and date on it
    - saving the video stream in a video format compatible with linux and windows
    Is it possible to do that in java (using JMF I guess) ?
    Could anyone help me to progress on my project ?
    thx a lot
    agussi

    Hi agussi, yes, it's possible to do that in Java using JMF.
    I'm not a JMF expert, but I've found this code very useful: http://forum.java.sun.com/thread.jspa?threadID=570463&tstart=50
    This piece of code shows the webcam stream and you can take snapshots with it. With a little tweak you can do what you are expecting.
    I hope this helps.
    Ivan

  • How to stream audio and video captured from mic and webcam in sync.

    I am working on a video chat project. I need to capture audio and video from mic and webcam and create rtp stream for them. How can I proceed for this. Any source code help will be highly appreciated. Otherwise just guide me how to do this and point to any good resource which is directly related to my need.
    Thanx.

    t.b.m
    As mentioned by you, i am doing exactly like that . I have coded transmitter class. But at the receiver side it is unable to play the stream. I am posting my code . Can you please help with me with any mistake i m making in my code ?? Or with way I should receive stream at receiver side. Plz see my code. I am streaming to ip address 172.31.80.67.
    package heyram;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import javax.media.format.*;
    import java.io.IOException;
    import java.util.Vector;
    import java.net.InetAddress;
    import java.awt.*;
    import java.io.*;
    import java.net.InetAddress;
    import javax.media.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import javax.media.format.*;
    import javax.media.control.TrackControl;
    import javax.media.control.QualityControl;
    import javax.media.rtp.*;
    import javax.media.rtp.rtcp.*;
    import com.sun.media.rtp.*;
    import java.lang.Thread.*;
    public class HEYRAM{
    Format[] format=new Format[2];
    Vector[] devices=new Vector[2];
    CaptureDeviceInfo[] di=new CaptureDeviceInfo[2];
       SessionManager rtpsm = new com.sun.media.rtp.RTPSessionMgr();
    Processor p=null;
    Processor p1=null;
    boolean result;
    public HEYRAM(String address,int port,int ttl){
        try{
                InetAddress destaddr = InetAddress.getByName(address);
                SessionAddress sessaddr = new SessionAddress(destaddr,
                                                             port,
                                                             destaddr,
                                                             port + 1);
                String cname = rtpsm.generateCNAME();
                    String username = null;
                try {
                username = System.getProperty("user.name");
            } catch (SecurityException e){
                username = "jmf-user";
            // create our local Session Address
            SessionAddress localaddr = new SessionAddress();
                SourceDescription[] userdesclist= new SourceDescription[]
                    new SourceDescription(SourceDescription
                                          .SOURCE_DESC_EMAIL,
                                          "[email protected]",
                                                                     1,
                                          false),
                    new SourceDescription(SourceDescription
                                          .SOURCE_DESC_CNAME,
                                          cname,
                                          1,
                                          false),
                    new SourceDescription(SourceDescription
                                          .SOURCE_DESC_TOOL,
                                          "JMF RTP Player v2.0",
                                          1,
                                          false)
                rtpsm.initSession(localaddr,
                                userdesclist,
                                0.05,
                                0.25);
                rtpsm.startSession(sessaddr,ttl,null);
            } catch (Exception e) {
                System.err.println(e.getMessage());
                //return null;
        // rtpsm.initSession(localAddress, defaultUserDesc, rtcp_bw_fraction, rtcp_sender_bw_fraction);
            // rtpsm.startSession(...);
    public void createVideoSession()
        format[1] = new VideoFormat(VideoFormat.YUV);
        devices[1]= CaptureDeviceManager.getDeviceList( format[1]);
         di[1]= null;
            if (devices[1].size() > 0) {
                 di[1] = (CaptureDeviceInfo)devices[1].elementAt(0);
                  System.out.println(di[1].toString());
            else {
                // exit if we could not find the relevant capture device.
             System.out.println("1234jjfjsajfjasf1");
                System.exit(-1);
            // Create a processor for this capture device & exit if we
            // cannot create it
            try {
                p1 = Manager.createProcessor(di[1].getLocator());
            } catch (IOException e) {
                System.out.println("1234jjfjsajfjasf2");
                System.exit(-1);
            } catch (NoProcessorException e) {
                System.out.println("1234jjfjsajfjasf3");
                System.exit(-1);
            // at this point, we have succesfully created the processor.
            // Realize it and block until it is configured.
           // p1.configure();
         result = waitForState(p1, Processor.Configured);
         if (result == false)
         System.out.println("Couldn't realize processor");
            p1.setContentDescriptor(new ContentDescriptor( ContentDescriptor.RAW_RTP));
            // block until it has been configured
            TrackControl track[] = p1.getTrackControls();
            boolean encodingOk = false;
            // Go through the tracks and try to program one of them to
            // output ULAW_RTP data.
            for (int i = 0; i < track.length; i++) {
                if (!encodingOk && track[i] instanceof FormatControl) {
                    if (((FormatControl)track).
    setFormat( new VideoFormat(VideoFormat.YUV)) == null) {
    track[i].setEnabled(false);
    else {
    encodingOk = true;
    else {
    // we could not set this track to gsm, so disable it
    track[i].setEnabled(false);
    // Realize it and block until it is realized.
    p1.realize();
    result = waitForState(p1, Processor.Realized);
         if (result == false)
         System.out.println("Couldn't realize processor");
    // block until realized.
    // get the output datasource of the processor and exit
    // if we fail
    DataSource ds = null;
    try {
    ds = p1.getDataOutput();
    } catch (NotRealizedError e){
    //System.exit(-1);
    System.out.println("1234jjfjsajfjasf4");
    // Create a SessionManager and hand over the
    // datasource for SendStream creation.
    // The session manager then needs to be initialized and started:
    // rtpsm.initSession(...);
    // rtpsm.startSession(...);
    try {
    (rtpsm.createSendStream(ds, 0)).start();
    } catch (IOException e){
    System.out.println("1234jjfjsajfjasf6");
    e.printStackTrace();
    } catch( UnsupportedFormatException e) {
    System.out.println("1234jjfjsajfjasf7");
    e.printStackTrace();
    public void createAudioSession(){
    format[0] = new AudioFormat("linear",8000,8,1);
    devices[0]= CaptureDeviceManager.getDeviceList( format[0]);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • HT4437 Is it possible to stream audio from a non-Itunes program on a computer (say, a website, Youtube, etc...) to Airplay speakers?

    Is it possible to stream audio from a non-Itunes program on a computer (say, a website, Youtube, etc...) to Airplay speakers?

    When you set up the new Mac, you can use Migration Assistant to transfer both from your iMac and your external drives.  You can also use Target Disk Mode to drag over the things you want.

  • Programs to stream movie and mp3

    Hi
    I need a programs on linux arch so can stream movie and mp3 formats over my network  to my ps3.
    somone now how i can do that ? some script or  some hacks ?

    nono ...
    i have Arch on my computer now and i want to have audios file in :
    /home/user/Audio
    i mean that i can lissing on audio frome computer on my PS3.
    like share tha map but only stream thing over on my network.

  • How can i stream video and audio from macbook air to my tv?

    how can i stream video and audio from macbook air to my tv?

    Wirelessly: you need an AirPlay - enabled device such as an AppleTV.
    Wired: if your TV has an HDMI port, you need a Thunderbolt to HDMI adapter such as this one:
    Mini DisplayPort to HDMI® Adapter w/ Audio Support
    If your TV does not have an HDMI port you will need a converter that will convert HDMI input to whatever input your TV requires.

  • I want to hook up a mac mini and us my tv as a monitor. how can I use airplay from my phone on the mac mini like i can with an apple tv (without having to buy an apple tv!). the airplay capabilities i want to use are mirroring and streaming from my iphone

    i want to hook up a mac mini and us my tv as a monitor. how can I use airplay from my phone on the mac mini like i can with an apple tv (without having to buy an apple tv!). the airplay capabilities i want to use are mirroring and streaming from my iphone!

    Download AirPlayer for Mac - Transforms your Mac into an AirPlay-compatible display. MacUpdate.com

  • My wife and I both have the new iPhones.  Is there a way to set up two separate iCloud accounts but have photo stream from both phones sync with one family mac?  So we don't want to share contacts or anything else, just photos... Thanks in advance

    My wife and I both have the new iPhones.  Is there a way to set up two separate iCloud accounts but have photo stream from both phones sync with one family mac?  So, we don't want to share contacts or anything else, just photos... Thanks in advance

    If you turned off Contacts wouldnt that mean that the Contacts would no longer be backed up to iCloud as well? That would make it a pain when upgrading a phone to not easily pull contacts back down.

  • Is it possible to sync AND stream from the same iTunes library?

    Hi,
    I am having trouble in setting up sync AND stream from the same iTunes library.
    Config :
    Mac OS - Latest update 5/6/09
    iTunes - Latest update 5/6/09
    Apple TV - Latest update 5/6/09
    I am able to either sync OR Stream from my iTunes library but not sync AND stream from the same iTunes library
    Let's say i want to sync :
    Go to Apple TV > Settings > computer
    Add Library (Not shared for Syncing)
    Enter passcode in iTunes and select the items to sync
    After sync is complete
    You can see photo, music & video in My Photos, My Music & My Videos.
    Let's say now my Apple TV is full
    So like to stream some other content
    Now
    Go to Apple TV > Settings > computer
    Add SHARED Library
    Passcode is shown in apple TV but not able to Enter it in iTunes (click to set link is not there next to Apple TV item under devices)
    To get that you have to right click the apple tv from the devices and select don't sync.
    You will get a message saying that all content in apple TV will get deleted.
    If you say yes then only the passcode screen for streaming is presented.
    So i am not able to sync AND stream from the same iTunes library.
    Any idea?

    macanandapple wrote:
    1. The checkbox for "show only synced content" should be unchecked
    yes
    2. No need to Add Shared Library
    correct
    3. After syncing is complete as per the steps said before, if i have to see a synced content i go to My Movies for streamed content i have to go to Shared Movies?
    no... both synced and streamed content show up all together. there is no way to tell what content is synced or streamed when looking at it on the appletv. it is seemless as in there is no difference in how it is presented.
    you also need to make sure you are using "custom sync" rather than "automatic sync", as you can't select the "show only synced content" box when using "automatic sync".

  • [Request] Move Windows Control Panel applet from "System and Security" to "Programs"

    The "Flash Player (32-bit)" Windows Control Panel applet should be  moved from "System and Security" to "Programs" where the Java applet is.
    Vote: https://bugbase.adobe.com/index.cfm?event=bug&id=2953107
    Thanks

    njb,
    Why not just run the ThinkVantage System Update and let it install as usual. You can also "un-check" those drivers that you don't want to install.
    *Non Lenovo employee*
    I have a Y2P (i5) ... Feel free to ping me if you want me to test some applications with your Y2P if you have the same model. I don't mind keep doing recovery on it if needed .... =)

  • Opening and manipulating another program from an application or script

    Hello all,
    I'm trying to create a prototype of a portable input device for a computer. The idea is that the input device allows the same input as a normal wireless pen tablet, but augmented with special features, which could (for example) open programs and switch between them.
    Now our current idea is to use a second monitor to run our mockup interface on. So basically an application of some sort that has a rectangular part to serve as the pen input area and some buttons alongside it for the extra functionality.
    Now for the questions: is it possible to open and interact with programs on the mac through another application? Would Applescript or a Cocoa application be able to this?

    Hi Spacy, and welcome to the Dev Forums!
    SpacyRicochet wrote:
    is it possible to open and interact with programs on the mac through another application?
    Yes.
    Would Applescript or a Cocoa application be able to this?
    Both.
    However, opening another app and interacting with it are two different topics. In general, you'll always be able to open another app. But except for privileged programs such as debuggers, you can't expect to do much else with another app unless it wants you to. In other words, if you programmed the other app, you'll be able to control and interact with it anyway you want from either Applescript or a Cocoa app. But if the app doesn't support Apple Events or any other kind of interprocess communication (IPC), you may not be able to do much except open and close it.
    Here are some links that might be useful to you:
    [Introduction to AppleScript Overview|http://developer.apple.com/mac/library/documentation/AppleScript/Conce ptual/AppleScriptX/AppleScriptX.html#//apple_ref/doc/uid/10000156-BCICHGIE]
    [Introduction to Cocoa Scripting Guide|http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Scr iptableCocoaApplications/SAppsintro/SAppsIntro.html#//appleref/doc/uid/TP40001982-BCICHGIE]
    [NSWorkspace Class Reference|http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ ApplicationKit/Classes/NSWorkspaceClass/Reference/Reference.html#//appleref/doc/uid/TP40004153]
    [Getting the main window of an app via an NSRunningApplication instance|http://stackoverflow.com/questions/1981453/getting-the-main-window-of- an-app-via-an-nsrunningapplication-instance]
    Hope that helps!
    \- Ray

Maybe you are looking for

  • Creative suite 4 web premium and vista 64

    Hi.  I just purchases a new laptop and it has vista 64. I need to know if there have been any problems running the programs on creative suite web 4 with vista 64; or is this a better combo than vista 32?  Thanks for any info.

  • How to stop BAPI_USER_ACTGROUPS_ASSIGN from overwriting the roles

    Hello, I m currently working on a program where I have to modify certain roles for users. What I am doing is using the FM BAPI_USER_ACTGROUPS_ASSIGN to collect all of the roles for  the user, looping thru the table to get the role that needs to be mo

  • Has anybody experienced the iPhone off switch not working all the time.

    I have an iPhone 5, it's about 16 months old and it has experienced an annoying issue.  The off button does not work all the time, sometimes I have to press it multiple times and other times it just works.  The worst case is when it does not work at

  • Docky Issue

    Hey. So I have just installed Docky (sudo pacman -S docky) and it installed fine, but when I try to run it via my DE, it loads but does not open and eventually stops loads. Loading it via terminal outputs the following: [anthony@ArchBox ~]$ docky [In

  • Skype email

    Hey Skype support team, currently I have an issue with my subscription.  My order reference is [removed for privacy], & the details are as below.  However, I can't use my subscription plan to make any calls as it shown "0" & it said that I had used a