Multiple formats and frame rates in one sequence

i have material shot on many different cameras. it includes PAL and NTSC, HD and SD, 24, 25, 30, and 60 fps, ProRes, DCVProHD, DVCam, etc etc. the final product is going to HD in both NTSC 24fps and Pal 25fps, for NatGeo domestic and international.
the roughs are already done with this hodgepodge. my job is to clean up the audio (done), and send the video out in for color, titles, and graphics. i'm trying to get at least the frame rates to match at 24, much of it is already in 24 dvcprohd or prores, so i have been doing quicktime exports of the non-dvcprohd/prores video to prores, then conforming to 24p in cinema tools, then overlaying the clips in the sequence with a fit to fill edit. sync has not been a problem, miraculously, even though the speeds end up between 100 and 125 percent.
am i doing anything right, and if not, what's a preferable way to handle this mess? i tried media manager initially but nothing would relink, so i gave up and started doing the clips individually as stated above.
all i know for sure is that whatever i end up doing, they're not paying me nearly enough.
-m

Hi Shane - Thanks for getting back to me! I figured I'd have to compress it, but
my question is - how? Initially, I used MPEG Streamclip to import the 23.98 dvd footage in as a DV/DVC Pro QT at 100% Best Quality. I then imported those files into FCP. After getting your e-mail, I went to export the files into Compressor (from FCP), and I'm only given 5 setting choices under "QT." I'm not sure which one to select . . . Uncompressed 10 bit? Any ideas? Again, thanks so much!!!

Similar Messages

  • Working with many different formats/codecs/frame rates within one Sequence.

    Good Afternoon,
    As an editor for an ad agency I am being tasked with cutting a demo reel together. Nothing too difficult.
    The reel is to include video footage of past projects, going back a couple years or so. The footage that I will be given will undoubtably be in a variety of formats, codecs, frame sizes, frame rates, etc (all SD, though). Delivery is SD DVD.
    My question is this:
    What is the best way to set up my timeline for a barrage of clips with differing specs?
    Do I encode all the media assets FIRST to conform to my Sequence Settings? Or do I just deal with the large amounts of timeline rendering as I work with different formats and codecs? Or do I....?
    I am running FCP 5.1.4, so I don't have the Open Timeline feature going for me.
    I appreciate any advice and tips you can offer!
    Thanks!

    Your final format is NTSC SD DVD, so you're going to have to go to 720x480 at some point. This is what I would upscale to. Make sure your "client" knows that the 320x240 wmv's may not look to good in the final production.
    Personally I use MPEG Streamclip (an excellent FREE application that's part of many a pro's arsenal) for this kind of conversion and/or upscaling. It's not particularly intuitive (especially for upscaling) so read the manual.
    You may need to get hold of Flip4Mac or Episode for the wmv conversions.
    I would tend to convert to a lossless codec like Apple Uncompressed or Animation. You could try going to NTSC-DV but you're going to lose some quality initially and again when you do the final mpeg2 compression.
    Experiment.

  • Which format and frame rate should I use?

    So I have worked here and there with final cut to make videos for live projections at music shows, but now I want to take it more seriously. Since I have done it randomly I didn't mind taking the time to render constantly and figure it out as I go. But now I want to work on larger projects, like making music videos, a little more consistently and want things to run a little faster.
    Basically I have about 200 gb of random footage. Or about 400 little videos. Very little of it is actually shot with a camera on my own. Most of it is collected video from either other people, or downloaded off the internet. Tons of things that are in the public domain that I want to use. My videos are pretty fast paced, almost seizure inducing sort of effects. I layer videos with each other and throw filters on everything. The problem is, the rendering is taking so much time out of everything. Is there a way for me to get around the rendering? Either by a certain setting within final cut, or just by converting all my video to one format? If I had to I would invest the time to convert every single video I have to some sort of format that would allow me to work faster. If so, which format should I use? Frame rate? etc.
    I would just like to get this out of the way so in the future I can convert videos to the right format. Just to allow some sort of flow within my workspace.
    I am using FCP 7
    Model Name: MacBook Pro
      Model Identifier: MacBookPro5,3
      Processor Name: Intel Core 2 Duo
      Processor Speed: 3.06 GHz
      Number Of Processors: 1
      Total Number Of Cores: 2
      L2 Cache: 6 MB
      Memory: 8 GB
      Bus Speed: 1.07 GHz

    You want to be on this forum
    Final Cut Studio

  • JMF Dimension and frame rate

    Why I'm not getting success when I try to determinate the Dimension and frame rate of the VideoFormat passing the parameters to the constructor ?
    processor.setContentDescriptor(new FileTypeDescriptor(FileTypeDescriptor.MSVIDEO));
    TrackControl tracks[] = processor.getTrackControls();
    float rate = Math.abs(Float.parseFloat(jcbQuadrosSegundo.getSelectedItem().toString()));
    VideoFormat vf = new VideoFormat(VideoFormat.H263, getTamanho(), Format.NOT_SPECIFIED, Format.byteArray, rate);
    FormatControl fc = (FormatControl) tracks[0];
    Format f = fc.setFormat(vf);
    tracks[0].setEnabled(false);
    processor.realize();
    ...getTamanho() return an Dimension that indicates de width and height.
    jcbQuadrosSegundo is an JComboBox.
    Thanks !!

    Skype is generally on autopilot.  I believe 1920x1080 (1080p) would be the max resolution as far as I can recall.  If the Internet connection isn't good enough at both ends, it will drop down to the resolution the call can handle.  The max resolution of the mobile device would be dependent on the hardware and the Skype client.  The webcam resolution compatibility is sometimes dependent on the version Skype.  Some people achieve better compatibility with the desktop version 6.1 vs the current 6.3.  If you want to monitor the resolution you can view the call technical info.  It will display the current resolution of both feeds and other call stats.
    This external site has some good info on it, though a bit dated, it should provide some insight.  I'm not sure if any of the mobile resolutions have been updated greater than 320x240.
    http://voiceontheweb.biz/referenceguide/skype/skyp​e-video-calling/

  • How do you download all chapters of a video at once?  I purchased a yoga video with multiple chapters and only the first one loaded.  It says I can't download another chapter for 90 days.

    I purchased a yoga video with multiple chapters and only the first one loaded.  It says I can't download another chapter for 90 days.  How do I get all chapters to download?

    Once a device or computer is associated with your Apple ID, you cannot associate that device or computer with another Apple ID for 90 days.
    http://support.apple.com/kb/ht4627

  • Itunes plays purchased HD videos fine, but constantly stalls while trying to play home created videos converted to the same file format and bit rate?

    Itunes plays purchased HD videos fine, but constantly stalls while trying to play home created videos converted to the same file format and bit rate.
    System specs
    Win 7pro x64
    ATI 5830
    Phenom x6 1055t
    8gigs ram
    1tb 7200rpm sata hdd
    500 gig 5400 rpm sata hdd

    Itunes plays purchased HD videos fine, but constantly stalls while trying to play home created videos converted to the same file format and bit rate.
    System specs
    Win 7pro x64
    ATI 5830
    Phenom x6 1055t
    8gigs ram
    1tb 7200rpm sata hdd
    500 gig 5400 rpm sata hdd

  • Concerning multiple frame-rates in one export file to perceive important necessary philosophies.

    consider READ QUESTION, The following 4#'d Paragraphs should be skipped and not considered to be read and don't link
    to my discussion it's question.
    4.It's a strange world we live in, yet the wonders are revealed if realised once more.
    Hello my dear friend or opposition. As this was my first post I represented my normal
    thought flow throughout as it would be me daily, reflecting as necessary, apologizing in advance
    if thrown out of balance.
    1.Rather contradicing or raising questions, I would like to consider this very moment the age
    of turn around points. As the evolution and perhaps one a day, revolution continues I would
    like to take a moment to stand by this process, I conclude we are going towards the red pitt hole.
    2. I also consider After Effect a program to allow whatever creativity could thrown at it, powered
    by our imagination creating a new breed of cinema. I consider myself a philospher, always spellinG it
    wrong but even thaT I consider mental restrictions only preventing me to reach out for your location,
    wherever or however you may consider that to be so.
    3. Proclaiming filters most out, but if I could only change one mind, I succeeded. I plan to rewrite
    or so to speak, re-introduce what could be film and where we could are going with it, possibly. Film will
    be an art that could differ as much as some painters have created unpredictably impossible differences
    between them selfs. Concludingly art style differ so does reality, I am thanking the creators of After Effects,
    and improvers, hereby with a salute for a program potentially as versatile.
    QUESTION
    Film=60:00 seconds
    first 00:10 seconds=>a 2000FRAMES/s animation,
    2nd 00:11-60:00 seconds=> 60FRAMES/s film.
    Exports results in one frame-rate, I have done insufficient research as why this is still a limit,
    or might not be because of simply not knowing enough yet. I created this story that could
    potentially explain our source and the infinite continuation of that and why.
    Thank you for your time, and I do appreciate it already if
    you read this far. Information regarding the question is fine.

    Imagine a movie theater. The projector is running happily away at 24 fps. All of a sudden you want to watch the movie at 60fps. You pick up your cell phone and call the lobby and talk to the manager. He thinks this is an interesting idea so he sends the projectionist up to the booth to look for a speed control on the projector. No luck, this one only runs at 24fps.
    That's how video containers work. You render to a container (mov, avi, flv, whatever) and you've just bought a projector with only one speed. If you want to change speeds in the middle you have to have a very special projector. No way around that.
    So the answer is that you can't render to the same container with different frame rates.
    You can, however, in a single comp, have footage that runs from 1 frame per hour to 99 frames per second. You can interpret the footage placed in a comp at any frame rate from 1 per second to 99 frames per second, which would accomplish what you are trying to do, except for the part that the first hour of the movie rendered movie would contain more than one frame.
    There are different types of containers however that can display each frame for a specific time interval. Animated Gif is the simplest movie container of this type. Flash is the most common. These are non standard video containers and you have to control the timing outside of AE.
    It would help if we had a little less escortaric posing of your question. What exactly, in an actionable question, are you trying to do and why?

  • Slow motion and frame rate and shutter speed

    I have two cameras that record 60i and three that use 30p. Neither of the 60i cameras has a 30p option (one has a pf30).  If I understand how FCPx handles this, if I drop both frame rates into a project, I get 30p out, correct?  In effect de-interlacing the 60i footage to 30p. Is it best to import the 30p footage first to set that frame rate so that the 60i gets rendered to 30p?
    We're producing a fishing DVD so good quality motion footage is important. This is an instructional DVD so I will be using some retiming to slow footage down to illustrate key points in the instruction.
    I've read a lot of stuff on 1080i 60i vs. pf30 vs.30p vs. 24fps and benefits of using 720p vs. 1080i.  Also looked at information on slow vs. fast shutter speeds.
    So, the bottom line to get the best motion results for the DVD, I should be shooting at best bit rate possible, use 1080i 60i or 30p depending on the camera and let FCPx set everything to 30p.  Correct?

    For the 1080/60i media, it is best to have FCPX conform it to 30p (29.97p). [30p is a real timing: 30 exact frames per second, but it is not broadcast compliant. 29.97 is quite often simply referred to as 30, just for simplicity and/or laziness. The final decision for which to use rests with you. Also note, like "30 fps", 60 more often refers to 59.94 fps... for the same reasons.]
    As for your target being DVD: DVD is always 480 lines whether it is anamorphic (16:9) or standard 4:3. If you would like to have "enhanced" slow motion, my recommendation would be to shoot in 720/60p (which is genuinely progressive "60" frames per second) and will give a slightly better edge on slow motion effects (retiming). That said, FCPX retiming is usually quite good no matter what the frame rate (frame blending recommended over optical flow [which tends to give a "morphing" effect when pushed too far].)  1280x720 frame size will give you plenty of downsampling resolution for DVD as well.  [I *believe* that FCPX will use all of the 60fps available from the original video in retiming, even if the frame rate of the project is slower than the original media; so, 720/60p conformed to a 30p project and retimed to 50% will use every frame of the 60p slowed down by half... (somebody correct me if I'm wrong!)]
    Best bitrate is also an important feature, but that is not due to the choice of format as much as that provided by the camera itself. Bitrates out of the camera may be relative to the frame size (they are in my consumer camcorders). A common consumer grade camcorder will top out at a bitrate (for 1080) somewhere between 17.5 and 22.5 Mbps, whereas an HD capable DSLR will usually top out at (easily) *twice* as much (45Mbps average from my Canon T4i) or more. Furthermore, the DVD standard imposes framerate restrictions (max is somewhere between 5 and  8Mbps -- the software that creates your DVDs will usually transcode for best bitrate, so not something you really need to bother with - just set the transcoder to best possible quality and provide it with the best quality video that's reasonable.) Whichever camera provides the highest bitrate should be your "main" camera.
    As you may have discovered: another factor for a quality video regardless of camera is shutter speed. If you set the shutter speed too high (faster than twice the frame rate) then you will have "stuttering" issues (there will be "gaps" from still frame to still frame). Keep the shutter speed at the same or no more than twice the frame rate: e.g., for 1080/30p (target) the shutter speed should never be more than 1/60th of a second (I'll use 1/30th, 1/40th, or 1/50th usually). I haven't shot a lot of 720/60p, but I think I would still keep the shutter speed at between 1/60th and 1/120th exclusively [that is -- I wouldn't go as high as 1/120th or greater... but that's me... you should experiment for best results for you.  If this creates exposure issues, then consider neutral density filters or circular polarizing filters to help bring scenes into exposure range (via aperture or iso or both.)
    HTH
    Good luck! Have a good shoot!

  • FCE4 and frame rate issues

    Hi All,
    I'm totally new to FCE and video editing in general, and have dived in with two feet. I'm trying to edit some screencasts I have produced. My main aim is to cut out dead sections of the screencast and add a voiceover to them. I tried various screencast-specific bits of software, but they didn't seem to allow much in terms of editing, and one (Camtasia Mac) decided to eat a day's worth of work by corrupting the saved file.
    So, I thought I'd grab a copy of FCE and give that a try. I've bought Tom Wolsky's FCE4 Editing Workshop Book (whose name lead me to this forum). I was also quite interested in the voiceover feature that FCE has, as that should come in useful as that is the main reason I'm editing these screencasts in the first place.
    The main issue's I've been having is that FCE is intended for DV editing, and I'm trying to edit a screencast, so I'm going slightly against the flow here. e.g. my screencast was captured using QT X at 1024x768. Which FCE can't deal with (I only found out after buying FCE... I head FCP can deal with non-DV standard frame sizes, but it beyond my budget). So I've been using MPEG streamclip pretty successfully to convert the H.264 source into Apple Intermediate scaled down and padded to 1280x720. I can then export from FCE back into Apple Intermediate and into MPEG Streamclip to crop off the pillarboxes and save to the final output format.
    I've come to the conclusion that as long as I can get my source material into what FCE expects from a DV cam then it seems to handle it OK.
    Some of the test clips I imported into FCE seemed to work fine, but then the longer full length source (about an hour) had trouble. The speed had gone all funny. I looks like the screencast source is at around 4.6fps and FCE decided that it should really be 46fps! One of the test clips appeared to be 5fps, and FCE seemed to be OK with that and kept it at 5fps.
    I'm currently re-converting the source with MPEG Streamclip to 29.97fps and hopefully that will import OK (even though it is taking ages to convert and I'm writing this sitting here patiently!).
    So was wondering if anyone know what the deal is with frame rates in FCE. Why does it sometimes seem happy with my low 5fps rate, and sometimes it decides it should be 10x faster. And does anyone else have any further comments or suggestions/tips about using FCE for editing screencasts?
    Thanks,
    Matt

    Tom, thanks for the help. I'm currently running it through Streamclip now as I type. Hopefully that should sort it. I guess screen capture software use a lower frame rate as they don't need to have a high frame rate usually for the stuff they are doing.
    -Matt
    PS. btw... great book! Certainly helped me get orientation around FCE. Definately needed as I had no experience of video editing and the workflows and terminology is all foreign!

  • Lookout OPC Client – Asynchronous I/O and Update Rate serious problems (Sequence of data)

    I am using the Lookout OPCClient driver to connect to AB PLCs (EtherNet/IP protocol) and power measurement equipment (Modbus TCP protocol). The OPC server is the NI OPC Servers. The data that are read out from PLCs and PMs are energy meter readings, energy counters, power, voltage, current, frequency, power factor and el. energy quality measurements (THD). That energy meter readings are being stored in SQL database.
    I am experiencing a serious problem regarding the accuracy of the meter readings. Several times per day, randomly, meter readings are losing the time sequence. For example, sequence is: 167, after few seconds 165, 166.  In other words, present value followed by two previous old values. That generates a serious problem in our application that is expecting a naturally rising sequence of counter values.
    Analyzing further, I isolated the problem to the connection between Lookout OPCClient and OPC Server. I made a simple application in Lookout 6.7 (opcproc.lkp, attached) with OPCClient parameters: NIOPCServers, OPC2, Asynchronus I/O, Update rate: 10000, Deadband: 0.0, that is reading just one tag from NI OPC Servers demo application (simdemo.opf).
    By using OPC diagnostic tool from NI OPC Servers I record the sequence of OPC requests and responses.  I found out that OPCClient sends every 2.5 sec “IOPCAsyncIO2::Refresh2()” call that is request for refreshing of all items in one OPC group. Few milliseconds later OPC Sever responds with callback function “IOPCDataCallback:: OnDataChange()(Device Refresh)” that actually refresh the data.
    This periodic sequence is intrinsic to the OPCClient and cannot be disabled or changed (by my knowledge).  This sequence is periodically interrupted by “IOPCDataCallback:: OnDataChange()” caused by update rate parameter of OPCClient (client is subscribed to server for periodic update of changed items).
    In the case of demo application on every 4 refresh callbacks caused by refresh requests (2.5 sec) there is one update subscription callback determined by Update rate (10 sec).
    QUESTION 1:
    What is the purpose of update sequence and update rate when we have every 2.5 sec fresh values?
    PROBLEM
    The problem arises when we have a large number of items in OPC group. In that case the OPC Server starts to queue refresh requests because they cannot be fulfilled in 2.5 sec time because of large number of I/O points that must be scanned. At the same time update subscription callbacks are running at the period determined by Update rate. I observed in my production system that regular update callbacks has higher priority than refresh callbacks from the queue. That causes the loosing of timed sequence of data. After the update callback with fresh data, sometimes follow one or two refresh callbacks from queue with old (invalid) data. By adjusting Update rate parameter (1 hour, 2hours …) I can postpone the collision of data refreshes but I cannot eliminate it. Furthermore, the 2.5 sec automatic refresh are large burden for systems with many I/O points.
    QUESTION 2:
    Is there a way to disable automatic refresh request every 2.5 sec and just use update requests determined by Update rate?
    QUESTION 3:
    Is there a way (or parameter) to change the period of automatic refresh (2.5 sec)?
    This problem is discovered for Lookout 6.5, 6.6 and 6.7 so I could say it is intrinsic to OPCClient. If I use synchronous I/O requests there is not an automatic refresh, but that is not an option for large systems.
    Thanks!
    Alan Vrana
    System engineer
    SCADA Projekt d.o.o.
    Picmanova 2
    10000 ZAGREB
    CROATIA
    T +385 1 6622230
    F +385 1 6683463
    e-mail [email protected]
    Alan Vrana
    SCADA Projekt d.o.o.
    ZAGREB, Croatia
    Attachments:
    opcproc.zip ‏4 KB

    The physical connection from LV to the switch is (I believe) copper crossover to fiber converter into a switch.  Then, fiber from the switch to the end device (relay).  The relay has all of the typical modbus registries and has been verified by inducing signals in to the system and measured/polled in LabVIEW and observed Variable Monitor.  I am working with LV 8.2 and 8.5. 
    An OPC server would only add an additional translation of addressing within the configuration.  The only real draw back would be the network overhead required to do this processing and not being representative of the end design configuration.
    I will reiterated my question in another way:
    I must answer the question to management that relates to data collection, test results and analysis; how often are you polling the client in relation to the outcomes measured?  At this time I can not point at any configuration in the set up and execution that directs the data framing rate.  I only measure the traffic and work with results.  This needs to be clearly identified based on the relay modbus/tcp design capability of supporting an fixed number of client requests per second. 
    For testing purposes, I would like to be able to stress the system to failure and have prove capabilities with measured data.  The present problem is that I have no basis to establish varying polling rates that effect the measured data transmission. 
    This raises another question.  What handles the Variable Monitor data requests and how is this rate determined?
    Thanks for your interest in my efforts.
    Steve

  • Problem with ATV refresh rates and frame rates

    I live in Australia and as such I am subject to PAL, so when I set my ATV up I set it to 720P 50Hz, when I purchased a TV season the episodes were running at 25fps and played back flawlessly with no dropped or added frames. My problem occurs when I download movies, all the movies I have bought are running at 24fps and suffer from quite noticeable jitter, almost like the 24th frame is duplicated and added as the 25th frame, I assume it is something like this as the pause happens every second.
    So has anyone had a problem similar to this and if so what do you do about it?
    Does the ATV playback all sources (24/25) smoothly even if it has to convert?
    Could it be caused by my TV?
    Any help to any of these questions would be great.
    Thanks.
    Tim.

    With my particular Apple TV setup and TV combination, I find that setting to 1080p (60hZ) gives my the best all-round round results.
    This does result in -slightly- jerky motion with 25fps material (especially old British TV shows), but it's bearable. It's particularly noticeable with sideways scrolling text and credits.
    The one thing that is peculiar on my setup is if I use 720p (either @60hz or 50hz) and watch an iTunes-purchased HD episode that is encoded at 24fps I get very odd motion effects indeed. Every few seconds the video appears to speed up almost like it is 'catching up' with lost frames - very hard to explain exactly how it looks. Anyway I set to 1080p and this effect is gone completely. It also goes away if I set to 1080i. I think something queer is going on with 720p on the Apple TV (at least with my TV there is). This happens with both HDMI and component outputs.
    It may be worth trying 1080i at either 50 or 60Hz if your set can't do 1080p.
    I would also suggest that 60hz in theory should give a smoother motion for 24fps playback than 50Hz.
    My basic problem with all this is that on even a cheap DVD player if a disk is 50Hz, the player switches to 50Hz output and if it is 60Hz, it will change to 60Hz. The Apple TV stays fixed. It's a shame it can't autoswitch refresh rates.

  • FCE frame rates-which ones?

    I cannot figure out which frame rates I can edit: can I do 24p; normal or advanced. I've got a promo video and the client wants 24p but can FCE support it?
    Thanks in advance.
    (FCE HD 3.5.1)

    As an alternative to upgrading to FCP, however, I believe the Nattress Film Effects plugin set works for FCE. It should allow you to convert your finished product to 24p (or any other format), and all for $100. You'll have to email Graeme about FCE compatibility.

  • System heat up and frame rate reduces to 5 fps approx. while playing FIFA 12

    The game works very well in first 2 minutes of startup but after that the fan speed increses abnormally and hard disk also heats up. this is followed by reduced frame rate about 5 fps which makes it very difficult to play the game. While this problem is not seen with earlier versions of FIFA 09 and FIFA 10.
    I am using HP-Pavilion dv4 1204tu laptop. 3GB ram. Windows Vista SP1 32-bit. and Intel(R) Graphics Media Accelator Series 4.

    Interesting, and yet the video card worked beautifully through Mac OS X 10.5.x and 10.6.x until 10.6.5 came along. And the game binary hasn't changed, so the problem must be with the OS.
    Further, if I understand the hierarchy of responsibilities in the software correctly, it's not surprising that the game worked with a video card it may not have listed as supported: Apple supplies an OpenGL library, and compatible drivers for the video cards it sells (that would include my video card, of course), and the games use the OpenGL library to do their graphics. So there's an Apple-supplied abstraction layer (or two) between the game and the video card. In principle, the game doesn't need to know what type of video card is present; just which of the many of the OpenGL features the OpenGL library supports, and whatever the OpenGL library allows it to discover about a video cards' functionality. That way, game developers don't have to create separate versions of their games, or huge amounts of their own video card abstraction code, in order to write a game that's compatible with all of the many video cards on the market at any given time, and all of the new video cards that will come along after the game is published. (I believe my ATI Radeon HD 4870 falls into the latter category.)

  • Read multiple files and save all into one output file(AGAIN)

    Hi, guys
    I need your help for reading data from multiple files and save the results into one output file. When files are selected from file chooser, my program read the data line by line , do some calculations and save the result into the output. I made an array to store input files and it seems to be working fine, but when it comes to SaveFile() function, issues NullPointException message.
    public class FileReduction1 extends JFrame implements ActionListener
       // GUI definition and layout
        /* ACTION PERFORMED */
        public void actionPerformed(ActionEvent event) {
            if (event.getActionCommand().equals("Open File")) getFileName();
        /* OPEN THE FILE */
        private void getFileName() {
            // Display file dialog so user can select file to open
         JFileChooser fileChooser = new JFileChooser();
         fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            fileChooser.setMultiSelectionEnabled(true);
         int result = fileChooser.showOpenDialog(this);
         // If cancel button selected return
         if (result == JFileChooser.CANCEL_OPTION) return;
            if (result == JFileChooser.APPROVE_OPTION)
             files = fileChooser.getSelectedFiles();
                textArea.setText("");
                if(files.length>0)
                    filelist="";
                    System.out.println("files length"+files.length);
                    for(int i=0;i<files.length;i++)
                         System.out.println(files.getName());
    filelist+=files[i].getName()+" ,";
    if (checkFileName(files[i]) )
    openButton.setEnabled(true);
    readButton.setEnabled(true);
    textArea.append("file "+files[i].getName()+"is a proper file"+"\n");
    readFile(files[i]);
    textfield.setText(filelist);
    else{JOptionPane.showMessageDialog(this,"Please select file(s)",
                    "Error 5: ",JOptionPane.ERROR_MESSAGE); }
         // Obtain selected file
    /* READ FILE */
    private void readFile(File fileName_in) {
    // Disable read button
    readButton.setEnabled(false);
    // Dimension data structure
         getNumberOfLines(fileName_in);
         data = new String[numLines][4];
         // Read file
         readTheFile(fileName_in);
         // Rnable open button
         openButton.setEnabled(true);
    /* GET NUMBER OF LINES */
    /* Get number of lines in file and prepare data structure. */
    private void getNumberOfLines(File fileName_in) {
    int counter = 0;
         // Open the file
         openFile(fileName_in);
         // Loop through file incrementing counter
         try {
         String line = fileInput.readLine();
         while (line != null) {
         counter++;
              System.out.println("(" + counter + ") " + line);
    line = fileInput.readLine();
         numLines = counter;
    closeFile(fileName_in);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile(fileName_in);
         System.exit(1);
    /* READ FILE */
    private void readTheFile(File fileName_in)
    // Open the file
    //int row=0;
    int col=0;
    openFile(fileName_in);
    System.out.println("Read the file");
    // Loop through file incrementing counter
    try
    String line = fileInput.readLine();
    while (line != null)
    boolean containsDoubles = false;
    double temp;
    String[] lineParts = line.split("\t");
    try
    for (col=0;col<lineParts.length;col++)
    temp=Double.parseDouble(lineParts[col]);
    data[row][col] = lineParts[col];
    containsDoubles = true;
    System.out.print("data["+row+"]["+col+"]="+lineParts[col]+" ");
    } catch (Exception e) {row=0; col=0; temp=0.0;}
    if (containsDoubles){ row++;}
    System.out.println();
    line = fileInput.readLine();
    catch(IOException ioException)
    JOptionPane.showMessageDialog(this,"Error reading File", "Error 5: ",JOptionPane.ERROR_MESSAGE);
    closeFile(fileName_in);
    System.exit(1);
    //System.out.println("length"+data.length);
    closeFile(fileName_in);
    process(fileName_in);
    /* CHECK FILE NAME */
    /* Return flase if selected file is a directory, access is denied or is
    not a file name. */
    private boolean checkFileName(File fileName_in) {
         if (fileName_in.exists()) {
         if (fileName_in.canRead()) {
              if (fileName_in.isFile()) return(true);
              else JOptionPane.showMessageDialog(null,
                        "ERROR 3: File is a directory");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 2: Access denied");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 1: No such file!");
         // Return
         return(false);
    /* OPEN FILE */
    private void openFile(File fileName_in) {
         try {
         // Open file
         FileReader file = new FileReader(fileName_in);
         fileInput = new BufferedReader(file);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
         textArea.append("OPEN FILE\n---------\n");
         textArea.append(fileName_in.getPath());
         textArea.append("\n");
         //System.out.println("File opened successfully");
    /* CLOSE FILE */
    private void closeFile(File fileName_in) {
    if (fileInput != null) {
         try {
              fileInput.close();
         catch (IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File closed");
    private void process(File fileName_in) {
    //getNumberOfLines();
         //data = new String[numLines][3];
         // Read file
    double temp,temp1;
         //readTheFile();
    //System.out.println("row:"+row);
    //int number=data.length;
    //System.out.println(number);
    for (int i=0; i<row; i++)
    temp=Double.parseDouble(data[i][1]);
    sumx+=temp;
    temp1=Double.parseDouble(data[i][3]);
    sumy+=temp1;
    multixy+=(temp*temp1);
    square_x_sum+=(temp*temp);
    square_y_sum+=(temp1*temp1);
    //System.out.println("Sum(x)="+sumx);
    double tempup=(row*multixy)-(sumx*sumy);
    double tempdown=(row*square_x_sum)-(sumx*sumx);
    slope=tempup/tempdown;
    double tempbup=sumy-(slope*sumx);
    intb=tempbup/row;
    double tempside=(row*square_y_sum)-(sumy*sumy);
    double cordown=Math.sqrt(tempdown*tempside);
    corr=tempup/cordown;
    r_sqrt=corr*corr;
         textArea.append("Data for file"+ fileName_in.getName()+" have been processed successfully.");
         textArea.append("\n");
         textArea.append("Please enter output file name including extension.");
    System.out.println("number"+row);
    System.out.println("slope(m)="+slope);
    System.out.println("intecept b="+intb);
    System.out.println("correlation="+corr);
    System.out.println("correlation="+r_sqrt);
    saveFile();
    private void saveFile()
    textArea.append("SAVE FILE\n---------\n");
    if (openFile1())
         try {
              outputToFile();
    catch (IOException ioException) {
              JOptionPane.showMessageDialog(this,"Error Writing to File",
                   "Error",JOptionPane.ERROR_MESSAGE);
    private boolean openFile1 ()
         // search for the file path
    StringBuffer stringpath;
    title=textfield1.getText().trim();
    int temp=fileName_in.getName().length();
    int temp_path=fileName_in.getPath().length();
    int startd=(temp_path-temp);
    stringpath=new StringBuffer(fileName_in.getPath());
    stringpath.delete(startd, temp_path+1);
    //System.out.println("file-path="+temp_path);
    //System.out.println("length-file="+temp);
    path=stringpath.toString();
    fileName_out = new File(path, title);
    //System.out.println(file_out.getName());
    if (fileName_out==null || fileName_out.getName().equals(""))
         JOptionPane.showMessageDialog(this,"Invalid File name",
                   "Invalid File name",JOptionPane.ERROR_MESSAGE);
         return(false);
         else
    try
    boolean created = fileName_out.createNewFile();
    if(created)
    fileOutput = new PrintWriter(new FileWriter(fileName_out));
    fileOutput.println("File Name"+"\t"+"Slope(m)"+"\t"+"y-intercept(b)"+"\t"+"Coefficient(r)"+"\t"+"Correlation(R-Squared)");
    return(true);
    else
    fileOutput = new PrintWriter(new FileWriter(fileName_out,true));
    return(true);
    catch (IOException exc)
    JOptionPane.showMessageDialog(this,"Please enter the file name","Error",JOptionPane.ERROR_MESSAGE);
    return(false);
    private void outputToFile() throws IOException
    // Initial output
         textArea.append("File name = " + fileName_out + "\n");
         // Test if data exists
         if (data != null)
         fileOutput.println(fileName_in.getName() +"\t"+ slope+"\t"+intb+"\t"+corr+"\t"+r_sqrt);
    textArea.append("File output complete\n\n");
         else
    textArea.append("No data\n\n");
         // End by closing file
    initialcomp();
         fileOutput.close();
    private void initialcomp()
    slope=0.0;
    intb=0.0;
    corr=0.0;
    r_sqrt=0.0;
    sumx=0.0; sumy=0.0; multixy=0.0; square_x_sum=0.0; square_y_sum=0.0;
    for(int i=0;i<data.length;i++)
    for(int j=0;j<data[i].length;j++)
    data[i][j]=null;
    /* MAIN METHOD */
    public static void main(String[] args) throws IOException
         // Create instance of class FileChooser
         FileReduction1 newFile = new FileReduction1("File Reduction Program");
         // Make window vissible
         newFile.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         newFile.setSize(500,400);
    newFile.setVisible(true);
    Sorry about the long lines.
    As you can see, all input files saved in array called files, however when OpenFile1() function is called, it take input (fileName_in) as a single file not an array. I'm assuming this causes the exception.
    When there's muptiple inputs, program should take each file from getFileName() to outputToFile() sequentially.
    Does anybody have an idea to solve this?
    Thanks a lot!!

    you naming convention is confussing. you should follows Java naming convention..you have a getXXX but decalred the return type as "void"...get usully means to return something...
    your code is doing too much..and hard to follows..
    1. get the selected files
    for each selected file
    process the file and return the result
    write out the result.
    /** close the precious resource */
    public void closeResource(Reader in){
        if (in != null){
            try{ in.close(); }
            catch (Exception e){}
    /** get the total number of line in a file */
    public int getLineCount(File file) throws IOException{
        BufferedReader in = null;
        int lineCount = 0;
        try{
            in = new BufferedReader(new FileReader(file));
            while ((in.readLine() != null)
                lineCount++;
            return lineCount;
        finally{ closeResource (in);  }
    /** read the file */
    public void processFile(File inFile, File outFile) throws IOException{
        BufferedReader in = null;
        StringBuffer result = new StringBuffer();
        try{
            in = new BufferedReader(new FileReader(inFile));
            String line = null;
            while ((in.readLine() != null){
                .. do something with the line
                result.append(....);
            writeToFile(outFile, result.toString());
        finally{ closeResource (in);  }
    public void writeToFile(File outFile, String result) throws IOException{
        PrintWriter out = null;
        try{
            out = new PrintWriter(new FileWriter(outFile, true));  // true for appending to the end of the file
            out.println(result);
        finally{  if (out != null){ try{ out.close(); } catch (Exception e){} }  }
    }

  • Wav sound and frame rate problem

    I have a wav file sound that I'm using within a movie clip in
    the movie clip's timeline. When I test the movie from within Flash
    (command-return), everything works great. When I publish and view
    online, here's what happens.
    If I click a button to move to another frame in the movie
    while the sound is playing, the frame rate speeds up and the movie
    gets a "fast forward" look to it until the sound ends. If I click a
    button when the sound is not playing, everything is fine. Am I
    missing something in the publish settings? Do I need to stop the
    sound in AS3 on the CLICK events (and if so, how)?
    Thanks,

    You will have to use Compressor...and the Advanced Conversion settings...DVCPRO HD 720p24. But you will also need to go into the FRAME controls in the INSPECTOR and make sure that you make it progressive and that you changes all the settings to better or best. This means that it will take a while, but it will look better.
    Shane

Maybe you are looking for

  • Solaris 10 and LSI MegaRaid 320 problem

    I have problem with installation of Solaris 10 on LSI MegaRaid 320 SCSI controller.... Driver which in the solaris is SUNWlsimega and has VERSION: 11.10.0,REV=2005.09.15.00.24 and contains path http://sunsolve.sun.com/search/document.do?assetkey=1-21

  • How to create a custom plugin in Oracle Access Manager to create a cookie

    How to create a custom plugin in Oracle Access Manager to create a cookie or Header Variable.. Vipin

  • Need driver for OS 10.9 for Samsung clp-365w Printer

    Trying to conect may Samsaung CLP-363W printer to me Mac Book Pro Running Maverick. Please help Need driver for OS 10.9 for Samsung clp-365w Printer

  • Time Capsule Ethernet Transfer rate very slow

    Hello, In order to transfer a 65Gb file from an iMac to TC, I decided to use the Ethernet port instead of wireless. The transfer rate is about 1-2Mbs /s instead of a regular Ethernet 100Mbs /s. It's been 4 hours so far and will probably be 7 hours wh

  • Importing java Bean Model

    hai , am new to webdynpro for java ... Am trying to import ejb bean jar to web dynpro .. Steps as follows i) copy the bean jar to wd project lib folder ii) Set classpath SampleWD - > Model Model -> create model Model name  :  Samplemodel Model packag