Unable to capture stdout, stderr from python.

I am trying to read the stdout and stderr of a python program.
When I invoke anything else apart from python my class works fine.
The python program takes ca 1 sec to start. It then prints one line of text, then it prints a promt and waits for input from user.
I tryed with another program that behaves in the same way and there I got the first line. Not the prompt, that not a python but a native C program.
I have tried using BufferedReader but without sucess.
My class looks like this.
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.OutputStream;
public class Executer extends Thread {
    //read standard out output of the external executable
    //in seperate thread to avoid I/O deadlocks
    final int BUFFER = 2048;
    Process p;
    BufferedInputStream in;
    OutputStream out;
    StringBuffer strbuf;
    String[] cmdarr = null;
    public Executer(String path) {
        this.cmdarr = new String[] { path };
    public Executer(String[] path) {
        this.cmdarr = path;
    public void run() {
        try {
            System.out.println("doing call");
            p = Runtime.getRuntime().exec(cmdarr);
            in = new BufferedInputStream(p.getInputStream());
            strbuf = new StringBuffer();
            out = p.getOutputStream();
            int i;
            byte[] buf = new byte[BUFFER];
            String str;
                        while ((i = in.read(buf, 0, BUFFER)) != -1)
                            System.out.write(buf, 0, i);
        } catch (IOException e) {
            e.printStackTrace();
    public int killProcess() throws InterruptedException {
        p.destroy();
        try {
            in.close();
            System.out.println("Closed");
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        return p.waitFor();
}Any ideas is appreciated.

When Runtime Exec Won't - a good article on running processes from a Java program...
Hope that helps;
lutha

Similar Messages

  • Unable to capture DV footage from HDV camera

    I am trying to capture from a dv tape using the Sony HVR-Z1E, but I keep getting the following message:
    Unable to initialize capture device and device control........ This might also happen if you play DV footage in an HDV device.
    I have tried changing the settings on the camera but to no avail.

    Hi James,
    This is a good workaround for curing your camera recognition problem:
    First, check that your Easy Setup / Timeline / Camera or Deck Settings are all exactly the same, then making sure your camera or deck is in VTR mode, try to capture again.
    Still not working?
    Check whether iMovie recognises your camera.
    FCP uses a different form of QT than iMovie for capturing, so if the camera works in iMovie (or if it's listed in System Profiler) but not FCP, it obviously means your Mac can see the VTR but FCP can't, so you need to do this QuickTime fix.
    http://docs.info.apple.com/article.html?artnum=301852
    Follow Apple's instructions carefully and you should have things running in no time - it's quite harmless!
    But if the Camera / Deck isn't recognised by iMovie or System Profiler, try resetting the Firewire Bus . . . Turn off the Mac and disconnect the power and all Firewire cables. Leave it for 30 mins then connect back up.
    Still not working? Try a different Firewire cable.
    Failing all this, try resetting the PMU (Power Management Unit). The method varies from machine to machine, so visit the Apple site and search for it in support.
    Don't use iMovie for capturing - it doesn't give you a timecode and that's very important.
    Let us know how you get on!
    Andy
    Quad 8GB. 250+500 HDs. G-Raid 1TB. NORTON. FCP 5.1.1. Shake 4.1. Sony HVR Z1E   Mac OS X (10.4.7)  
    "I've taught you all I know, and still you know nothing".

  • Unable to capture 480i  SD from Sony HC1

    I must be doing something wrong.
    I want to capture video from my HC1 as SD 480i but all I get is firewire control. I have tried DV NTSC and DV NTSC Anamorphic with no results. My tape footage is HDV with the camcorder set to downconvert the iLink output to SD 480i.
    I can boot into windows and capture 480i using Premiere Pro.
    HDV capture is not a problem.
    Any ideas? I am totally new to FCP and the Mac and I really want to learn to use FC Studio.
    Mac Pro   Mac OS X (10.4.7)   Dual 3 GHz w/ 2MB RAM, Final Cut Studio 5.1

    Hi James,
    This is a good workaround for curing your camera recognition problem:
    First, check that your Easy Setup / Timeline / Camera or Deck Settings are all exactly the same, then making sure your camera or deck is in VTR mode, try to capture again.
    Still not working?
    Check whether iMovie recognises your camera.
    FCP uses a different form of QT than iMovie for capturing, so if the camera works in iMovie (or if it's listed in System Profiler) but not FCP, it obviously means your Mac can see the VTR but FCP can't, so you need to do this QuickTime fix.
    http://docs.info.apple.com/article.html?artnum=301852
    Follow Apple's instructions carefully and you should have things running in no time - it's quite harmless!
    But if the Camera / Deck isn't recognised by iMovie or System Profiler, try resetting the Firewire Bus . . . Turn off the Mac and disconnect the power and all Firewire cables. Leave it for 30 mins then connect back up.
    Still not working? Try a different Firewire cable.
    Failing all this, try resetting the PMU (Power Management Unit). The method varies from machine to machine, so visit the Apple site and search for it in support.
    Don't use iMovie for capturing - it doesn't give you a timecode and that's very important.
    Let us know how you get on!
    Andy
    Quad 8GB. 250+500 HDs. G-Raid 1TB. NORTON. FCP 5.1.1. Shake 4.1. Sony HVR Z1E   Mac OS X (10.4.7)  
    "I've taught you all I know, and still you know nothing".

  • Unable to capture the String[] from a JavaCallOut

    Hi all,
    I am doing an application in which I need to do a java callout which accepts string and return a String array as output. The java class alone is working fine but when I do the Java Callout and pass the string I am getting *"<con:java-content      ref="jcid:-31630335:136f3572827:-3925" xmlns:con="http://www.bea.com/wli/sb/context"/>"* as a response. How should I access array variable in OSB?
    Kindly help me in this.
    Regards
    Phanindra.

    in Java Callouts I would avoid types which are not in THE list of supported types:
    http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/eclipsehelp/ui_ref.html#wp1290279
    java.lang.String[] is supported for INPUT ONLY
    just return some CSV in a String and you will be happy
    or return a XmlObject containing multiple elements
    A con:java-content thingie can be processed only in another Java callout, and not in a OSB message flow....

  • Unable to properly capture HD video from miniDV tape in FCE

    unable to capture HD video from miniDV tape
    When I connect my Sony HDR-HC3 miniDV HDV camcorder to my iMac via firewire cable and use Final Cut Express to capture the video from the tape, I do not get a Capture window that allows me to specify in and out points, I just get a playback window that immediately starts capturing and the only option I have in this window is hit ESC to stop capturing. If I let this capture window continue to capture the video from the camera with miniDV HD tape, then the entire tape would be captured as one massive single video clip.
    QUESTION: Is there something I change or do to make the proper capture window appear where I can specify in and out points to capture from tape for each clip?
    NOTE: using same camera and tape with iMovie with automatic capture enabled, all the clips get captured properly. I also tried to use the manual setting in iMovie and it worked too.
    More details(read only if you want more information)
    I have a several miniDV tapes containing HD video created on a Sony Sony HDR-HC5 and Sony HDR-HC7. Unfortunately, both these camera were stolen, and I have since moved to a camera that uses flash memory, not tape. However, I need to get the video footage off these tapes, so I bought a used Sony HDR-HC3, it plays the HD miniDV tapes just fine and iMovie reads the video from this camera just fine, but Final Cut Express does not.
    When I setup Final Cut Express, I used the Easy Setup and specified:
    Format: HD
    Rate: 29.97 fps
    Use: HDV-Apple Intermediate Codec 1080i60
    These setting match those of the camera and recorded tape. If I use any other settings but these, then Final Cut Express never sees the camera and never opens any capture window at all. Using Quicktime 10 movie inspector on the clips captured by iMovie from same camera, all the clips match this setting too.
    Final Cut Express version 4.0.1
    iMovie 09 Version 8.0.2 (821)
    iMac 2.93 GHz Intel Core 2 Duo with 4GB 1067 MHz DDR3 running
    Mac OS X Version 10.6.4
    My Final Cut Express scratch disk is a Seagate 2TB external USB 2.0 Hard Drive that has been formatted to be Mac OS Extended (Journaled). This external disk is also where iMovie successfully captured all the video from the same camera.

    Thanks for the answer. It makes me sad. I thought using Final Cut Express would be an upgrade to a more robust editing system from iMovie, yet iMovie does a superior job of logging and capturing video from HDV video on miniDV tape in comparison to FCE. Not only does iMovie capture each clip on the tape into it's own video file automatically, it also includes timestamp information in the filename indicating when the clip was originally recorded, which appears to be something that is missing from Final Cut Express. Now I realize that HDV miniDV cameras had a relatively short life span in the consumer marketplace and have since all been replaced by flash and hard drive based AVCHD cameras, but from circa 2004 to 2007, miniDV HDV camcorders were very popular and I am sure there are lots of consumers that must be super frustrated by Final Cut Express limited ability to log and capture clips properly from these cameras.
    Assuming I do not want to make a rough cut of video in iMovie and prefer to begin my editing project in Final Cut Express (not doing XML export of iMovie project), I need to determine the best way to get clips captured via iMovie into Final Cut Express and determine if there is anything inferior in the iMovie captured clips that I need to be aware of. So far it appears that both iMovie and Final Cut Express reduce the 5.1 surround sound captured on the HDV miniDV tapes to stereo sound, which is not a big lose given the 5.1 sound was recorded from camera's built-in microphone, but it makes me wonder if the video is reduced in any way by the iMovie import process, examining the video in quicktime's inspector window the video appears to be the same in both iMovie and FCE, but I'll research the answers to these questions elsewhere on this forum and post additional questions if I do not find the information I need.

  • Unable to Capture Video PE 3.0

    I'm using Premier Elements 3.0 and am unable to capture a video from my DV camera. I have reviewed all the instructions that might relate to the problem and have re installed the program. When I go to capture a video, in the top left of the screen indicates "Capture device off line" however I can start and stop my camera with the buttons on the capture screen. The get video button is not active. It will not download. Again if run through the start up instruction with no results.  The program use to work fine but I have not used it in a while. Any suggestions?

    A couple of questions:
    Do you have the 3.0.2 update?
    What make/model of camera?
    Does Windows give you the "bing-bong" sound, when you have the camera plugged-in via FireWire and you turn it on?
    What mode does the camera's manual tell you to set the camera in, for capture?
    Good luck,
    Hunt

  • Unable to capture from my Canon hv30

    I just tried to capture some footage from my hv30, the first time I've tried, and it say's on the capture screen that the capture device is off line. I have the camera properly connected and its in the right setting, is there some setting in premiere that's i have wrong? I have another program that came with the camera, and it can't connect to the camera either, saying that its not connected. Not sure what to do at this point, so if anyone has any ideas that would be awesome.

    This is the most weird camera I have ever seen, you have a miniDV tape camera appartently without a Firewire I/O connector.  I just looked at this Canon specification  http://www.usa.canon.com/consumer/controller?act=ModelInfoAct&fcategoryid=177&modelid=1620 6#ModelTechSpecsAct
    and there is nothing about a Firewire/IEEE-1394/etc.  Without a firewire interface Premiere is unable to capture video.  apparently there is some software supplied with the camera, maybe it can capture the video via the USB interface to your computer and then (if it is the correct format) you can import it to Premiere.

  • Unable to capture HDV in FCP 6.0.1 from Sony HVR-Z1P

    Hi I'm attempting to capture HDV footage from a Sony Z1.
    I am trying to capture some HDV footage I shot with the Z1, but FCP simply refuses to recognize the Z1
    I'm certain I've got all the settings correct:
    - Camera is set to HDV firewire out
    - capture presets is set to HDV
    - device control preset is set to Sony HDV FireWire
    - sequence preset is set to HDV 1080i50 (I'm in Australia)
    - footage IS HDV 1080i50
    But I keep getting the "Unable to Initialize Capture Device and Device Control" popup. I've tried everything
    - rebooted the camera
    - restarted FCP
    - rebooted the system
    - changed the capture/device control settings in FCP and tried out a regular DV deck to make sure it wasn't the cable
    Nothing has worked.
    I'm on a MBPro I7. No Kona card or anything like that, just trying to capture through firewire.
    Any suggestions would be greatly appreciated.
    Thank you,
    Matt
    At present it will capture HDV in IMovie but not FCP 6.0.1
    Message was edited by: Matt Blyth

    Thanks Adrian, since posting the thread I've thought of that too but unfortunately to no avail. From other forums I've read this seems to be a central theme to the solution to my capture woes. I since have sorted the problem it was in Audio/Video Settings.
    In the end I set my Audio/Video Settings to:
    Sequence Preset to: Apple Intermediate Codec 1080i50
    Capture Pre-HDV- Apple intermediate Codec
    Device Control Preset: Sony HDV 1080i50 Firewire
    And hey presto my I'm capturing HD without any problems. Thanks everyone for your suggestions.
    Message was edited by: Matt Blyth

  • Unable to capture movie from camcorder.

    I had tried to capture a movie from HDV camcorder for the first time since I updated to 10.5,
    and got a green and pink image from iMovie. It looked like signals been mixed or track is off.
    Then I tried with Quicktime and it seemed like working in the beginning but at the end of the clip
    an error occurs saying unable to save the movie. FCP HD crashes trying to do capture either.
    Anyone with similar symptoms? Any troubleshoot check list anyone?

    yes, my powerbook is too slow to capture at full resolution, so I've tried with smaller size w/
    'better' setting, i believe w/.264 encoding, but still i got an error. I don't know why this happen.
    i had no problem before upgrading to 10.5. i checked the mini DV tape for any defect playing
    it back and capture but it's not the cause. I was able to capture same tape with same camcorder
    on my new iMac D2C .1.5.1 at my office. perhaps something to do with G4 or PPC version of OS...

  • Unable to capture the value of vbrk-vbeln value from VF02

    Hi All,
    am printing form from VF02 ,,,once i execute the VF02 , and select Billing Document -> Issue Output to  option .., my printi program gets triggered ,......,
    but in my print program am unable to capture the value of VBRK-VBELN which i have entered in the VF02 tcode..
    any other table the value of  VBELN is stored???
    pls help me out with the alternatives...
    thanks
    john

    Hi Dhiraj
      One doubt how the value is populating in the NAST  in the Print Program . While debugging i'm getting the Values from NAST but i want to know from where NAST is loading with these data.
    Thanks
    Bintu

  • Unable to capture data from drop down list in custom added field in migo tcode at item level

    Hi guys,
    need bit help in resolving query related to custom added field in Tcode migo.
    i have added a field in migo at item level ,in this i have used drop down list
    to get data but unable to capture data from drop down list.gown through
    many blogs in scn but unable to resolve.
    Please help me out in this.
    Thanks,
    Umakant.

    Hi,
    U can use following code to fill the list box
    write this code in PBO
    In layout editor please select listbox in dropdown attribute of input field and put some fctcode attribute
    TYPE-POOLS vrm.
      DATA values TYPE vrm_values WITH HEADER LINE.
      TABLES: <ur custom Database table>.
      clear values, values[].
      SELECT * FROM <ur custom Database table>.
        values-text = <TABLE FIELD TO DISPLAY IN DROPDOWN> .
        values-key = <TABLE KEY FIELD TO DISPLAY IN DROPDOWN>.
        APPEND values.
      ENDSELECT.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = '<SCREEN INPUT FIELD NAME>'
          values          = values[]
        EXCEPTIONS
          id_illegal_name = 1
          OTHERS          = 2.
    Also please define the following before accessing the listbox value
    data: <listbox input field name> type <table field name>,
            <inputfield name where text to display> type string  in top include
    In PAI, select the text from the table into <inputfield name where text to display>  depending on value selected which will be called when enter key is pressed or any vale is selected

  • Unable to capture video from webcam in JMF in xlet

    hi
    I am unable to capture video from webcam in an Xlet. I am using Xletview to run Xlet. The method CaptureDeviceManager.getDeviceList(vidformat) returns empty array. Which videoformat should I use and why do I get empty array?
    Thanks
    Rajesh

    MHP and OCAP only use JMF 1.0, which does not include support for capturing video. You will not be able to do this in any current MHP/OCAP imlementation that I know of.
    Steve.

  • Unable to capture video from webcam in JMF

    hi
    I am unable to capture video from webcam in an Xlet. I am using Xletview to run Xlet. The method CaptureDeviceManager.getDeviceList(vidformat) returns empty array. Which videoformat should I use and why do I get empty array?

    MHP and OCAP only use JMF 1.0, which does not include support for capturing video. You will not be able to do this in any current MHP/OCAP imlementation that I know of.
    Steve.

  • Final Cut suddenly unable to capture from any source

    I suddenly started having an inability to capture in Final Cut. I have always used Final Cut Express and a Sony handicam and a firewire port.
    2 weeks ago when I went to capture I started getting “dropped frames” error messages. As you know, unchecking that feature in FCE or FCP simply results in video and audio that don’t match up. Anyway I tried that and it didn’t work.
    I have used two other firewire cables
    I am using OS 10.5.8
    in trying to fix this problem, I upgraded to Final Cut Express 4 (from 2.0)
    I trashed preferences.
    I used disk repair and verify permissions
    I booted up and down
    then I gave up on the sony handicam and connected my G5 to a JVC editing deck I have, the JVC SR-DVM70.
    When I connect my G5 to my JVC deck through the firewire In/Out port, I get the message, “VTR OK” so the connection is there.
    When I hit “play” in Final Cut, it does control the deck and makes it play—but I do not see the video in Final Cut; I only see it on the JVC deck monitor.
    When I hit “stop” it does not make the JVC deck stop. The only function it seems to control is simply “Play.”
    Then when I go to capture, I get the message: "unable to capture because there is no video."
    I have tried several different “Easy Setup” settings, including several firewire settings (including basic firewire) and several NTSC settings and a PAL setting.
    Weird.
    anybody out there a genius with this?

    There is a separate forum for FCE.
    Make sure you are using the correct HDV settings in FCE and that the camera is set to output HDV and not downconvert.

  • Windows Movie Maker - unable to capture from sony handycam

    I am using Sony Handycam DCR-HC2 camcoder and my laptop is sony vaio vgn-nr160e. Before upgrading to windows 7, I was able to capture home made movie with Click to DVD program via i-link cable with vista home.
    From the time I update to Windows 7, I am unable to capture home movies. Presently I am using windows movie maker 2.6. When I connect my handycam to laptop with i-link, it won't reconize.
    Please some one guide me, we are planning a 2 week vacation and I am going crazy with this issued ( I am an avg tech guy, not a expt)

    I have
    Windows 7 RC
    Sony handycam DCR-TRV19
    Sony iLink cable
    Full Windows Live package installed
    and have had similar results.
    With the Sony cable (verses a 4 pin to 4 pin cable) I do get DV IN on the camera when I connect.
    But in device manager it does not show up under IEEE or as an Image Device :-(
    That's as far as I have gotten. Hoping someone can find the little nugget to get this going.
    Hi
    Here are a couple of links that may help.
    Sony eSupport - Digital Camcorders
    Sony eSupport - DCR-TRV19 - Support
    Hope this helps.
    Thank You for testing Windows 7
    Ronnie Vernon MVP

Maybe you are looking for

  • Downloading Adobe Acrobat 9 Pro

    I upgraded to a macbook air without a cd drive. I want to install my acrobat pro 9.  I have the serial number, etc. The download file for the mac is linked to an .exe windows file (Download Acrobat products | 9, 8)). Where can I get the right downloa

  • Google Maps have large vertical Stripes.

    FF 3.6.12 Google maps have large stripes stating "We are sorry, but we don't have maps at this zoom level for this region." It has stripes of the same width regardless of zoom level. When using Satellite mode, the stripe is replaced with satellite gr

  • Specifying log file as jvm argument not working

    I've long used the java.util.logging by having a logging.properties file and specifying the "java.util.logging.FileHandler.pattern" in that file and specifying the location of the logging.properties as a jmv arg (-Djava.util.logging.config.file=loggi

  • PDF files are very faint and the search function doesn't highlight the search term when found

    I'm using Firefox 5 with Windows 7 64 bit. When I open a PDF file the file is very faint and the search function doesn't highlight the search term in the body of the PDF.

  • Gigabit to PC direct?

    Hi folks, I'm connecting my mac mini to a PC laptop running XP Home. I also run XP Home on the mini using Bootcamp. I frequently network between the two XPs but I need to be able to also transfer files from the mac side of the Mini to the PC Laptop.