Read an avi file using "Read from binary file" vi

My question is how to read an avi file using "Read from binary file" vi .
My objective is to create a series of small avi files by using IMAQ AVI write frame with mpeg-4 codec of 2 second long (so 40 frames in each file with 20 fps ) and then send them one by one so as to create a stream of video. The image are grabbed from USB camera. If I read those frames using IMAQ AVI read frame then compression advantage would be lost so I want to read the whole file itself.
I read the avi file using "Read from binary file" with unsigned 8 bit data format and then sent to remote end and save it and then display it, however it didnt work. I later found that if I read an image file using "Read from binary file" with unsigned 8 bit data format and save it in local computer itself , the format would be changed and it would be unrecognizable. Am I doing wrong by reading the file in unsined 8 bit integer format or should I have used any other data types.
I am using Labview 8.5 and Labview vision development module and vision acquisition module 8.5
Your help would be highly appreciated.
Thank you.
Solved!
Go to Solution.
Attachments:
read avi file in other data format.JPG ‏26 KB

Hello,
Check out the (full) help message for "write to binary file"
The "prepend array or string size" input defaults to true, so in your example the data written to the file will have array size information added at the beginning and your output file will be (four bytes) longer than your input file. Wire a False constant to "prepend array or string size" to prevent this happening.
Rod.
Message Edited by Rod on 10-14-2008 02:43 PM

Similar Messages

  • Read doc file using the Word Binary file format

    I want to be able to parse a Word file (xyz.doc).I want to be able to get to the actual text in the file and also get the "document properties" associated with this file.(This is the stuff you enter when you hit the File>>Properties button in Word)
    I have the binary file format of MS word 6.0 and I suppose these "document properties" are stored within a segment in this file format.
    Can anyone help me identify which segment in the Microsoft Binary word format this will be in???
    (Ya and ofcourse I want to achieve all the parsing purely in Java!!..)
    Thanks,
    Supriya

    IF you use MFC, yes. Don't ask how, this is the Java
    forum. As to the JAva API, no. There is no API in Java
    to deal with Microsoft docs, this is Java, not
    Micorsoft. Ya I know that!!:P
    You can write your own code, using the
    information in the doc. The info you refer to is
    locted on the header portion. As to how to read it,
    best go to a Microsoft forum. Once you understand the
    format, then post any Java related questions here,
    i.e. how do I oppen a file to read/write etc. Good
    luck, you will need patience, but you will leran a
    lot...Thanks anyway for your reply!:)..Will try with patience

  • Read From Binary File doesn´t work on MCB2400 in LV2009 Embedded ARM

    Hello,
    I try to read a Binary File from SD-Card on my MCB2400 Board with LV2009 Embedded for ARM.
    But the output is always 0, if I use my VI on the MCB2400. If use the same VI on the PC it works fine with the same binary file.
    The
    access to the SD-Card on the MCB2400 works in other cases finde, if I
    try to read from a text-file it works without any problems.
    Are thre any constraints for the "Read From Binary File"-Node in Embedded in comparison to the same node on PC ?
      I have noticed that there is also a problem
    with the reading of textfiles. If the sice of the file is about 100Byte
    it doesn´t work anymore, too. I can´t understand it, because I read
    always just one Byte. And even if the implementation in Labview is so
    bad that it allways reads the total file in the ram it sould work. The
    MCB2400 has 32MegaByte RAM, so 100Byte or even a few MegaByte should
    work.
    But this doesn´t seem to be the Problem for the Binary-Problem. Because even a 50byte Binary-File doesn´t work.
    bye & thanks
    amin
    Solved!
    Go to Solution.
    Attachments:
    SD_Card_Read-test.vi ‏12 KB

    Hello,
    thank you for your Help.
    But I just want to read a Binary File, which is build by another program. And this is coded with 8Bit (like a normal Binary File) and not just with 7Bit (ASCII). So the workaround doesn't work in my case.
    I posted the Test-VI in my first post (here once again as picture). And it works fine on the PC, but if I try it on my MCB2400 the "Read Form Binary File" Node doesn't work.
    And it is also possible to open the Bin file with the "Read Text File" Node and see the cryptic content of the Bin-File. So the Problem seems to be in the "Read Form Binary File" Node.
    bye & thanks again
    amin
    Message Edited by aminat on 09-30-2009 03:28 AM

  • "Read From Binary File" function Help ambiguity

    I must be getting tired, but for some reason a doubt crept in my mind as I was designing a new piece of code this morning:
    "is the "Read From Binary File" using the last file position or is it starting from the beginning of the file?"
    "That's a stupid question", I told myself.
    "I used this function a million times and have always assumed it is reusing the last file position. Moreover, there is no file offset input to that function, so WTH am I afraid of?"
    So, for kicks, I fired up the Help window and read the following description (*):
    Reads binary data from a file and returns it in data. How the data is read depends on the format of the specified file. This function does not work for files inside an LLB.
    (*) BTW, has anybody ever complained that you can't select and copy anything from the floating Help Window?
    Not much there. I particularly admire the phrasing of the second sentence... What about: "This function can do a lot of things, but it would much to complex to describe this is extensive details, so if you are asking, you probably can't afford using it"?
    Anyhow, I clicked on the "Detailed Help" and got this (among other things):
    Use the Set File Position function if you need to perform random access.
    WHAT? I am pretty darn sure I DO NOT USE the Set File Position when I read a file in successive and contiguous chunks. I just pass the file refnum into a shift register and back to the function and that's it.
    Now, the description of the "Refnum Out" ouput says: If file is a refnum or if you wire refnum out to another function, LabVIEW assumes that the file is still in use until you close it. Translated in plain English, is that supposed to mean that if the file is not closed it is open, or is that implying that it contains more info that just "the file is open and can be found here"?
    I started searching around and finally ended up with the entry for "refnums, file I/O". Down the bottom of the (long) article, I found this under the heading "References to Objects or Applications" (but nothing specific to files, BTW):
    ...LabVIEW creates a refnum associated with that file, device, or network connection...
    [...]  LabVIEW remembers information associated with each refnum, such as the current location for reading from or writing to the object and the degree of user access, so you can perform concurrent but independent operations on a single object. If a VI opens an object multiple times, each open operation returns a different refnum. LabVIEW automatically closes refnums for you when a VI finishes running, but it is a good programming practice to close refnums as soon as you are finished with them to most efficiently use memory and other resources.
    So it seems that my recollection was correct. I do not know what the "degree of user access" for a file is, but that's not the topic of today's post. 
    So, my point is: the Help File for this function is incomplete or ambiguous at best. Please correct it. And provide a link to the "refnum, file I/O" Help entry in its detailed Help. It would H E L P...
    Thanks for reading.

    Reading in succesive chunks is *NOT* random access. An open file always has
    a current position, which is updated with each read or write operation.
    You only need to set the file position if you want to start elsewhere.
    LabVIEW Champion . Do more with less code and in less time .

  • "Read from Binary File" and efficiency

    For the first time I have tried using Read from Binary File on sizable data files, and I'm seeing some real performance problems. To prevent possible data loss, I write data as I receive them from DAQ, 10 times per second. What I write is a 2-D array of double, 1000 data points x 2-4 channels. When reading in the file, I wish I could read it as a 3-D array, all at once. That doesn't seem supported, so I repeatedly do reads of 2-D array, and use a shift register with Build Array to assemble the 3-D array that I really need. But it's incredibly slow! It seems that I can only read a few hundred of these 2-D items per second.
    It also occurred to me that the Build Array being used in a shift register to keep adding on to the array, could be a quadratic-time operation depending on how it is implemented. Continually and repeatedly allocating bigger and bigger chunks of memory, and copying the growing array at every step.
    So I'm looking for suggestions on how to efficiently store, efficiently read, and efficiently reassemble my data into the 3-D array that I need. Perhaps I could simplify life if I had  "write raw data" and "read raw data" operations that write and read only the numbers and no metadata.then I could write the file and read it back in any size chunks I please -- and read it with other programs besides. But I don't see them in the menus.
    Suggestions?
    Ken
    Solved!
    Go to Solution.

    I quote the detailed help from Read from Binary File:
    data type sets the type of data the function uses to read from
    the binary file. The function interprets the data starting at the current file
    position to be count instances of data type.
    If the type is an array, string, or cluster containing an array or string, the
    function assumes that each instance of that data type contains size information.
    If an instance does not include size information, the function misinterprets the
    data. If LabVIEW determines that the data does not match the type, it sets data
    to the default for the specified type and returns an error.
    So I see how I could write data without any array metadata by turning off "prepend array or string size information", but I don't see any way to read it back in such bare form. If I did, I'd have to tell it how long an array to read, and I don't see where to do that. If I could overcome this, I could indeed read in much larger chunks.
    I'll try the auto-indexing tunnel anyway. I didn't tell you the whole truth, the 3-D array is actually further sliced up based on metadata that I carry, and ends up as a 4-D array of "runs". But I can do that after the fact instead of trying to do it with shift registers as I'm reading.
    Thanks,
    Ken

  • How to make iTunes read the song's name/singer from the file's name itself?

    Hi everyone,
    So I have this file with songs from everywhere. I spent quite some time now to make sure that the structure of each file's name is as such : "Singer - Song name", hoping that everything would be read by iTunes accordingly. However, either iTunes read it well, or it didn't read it at all ("Singer - Song name" appearing in Title alone), or iTunes read the "media" of the file (ie. what the guy I downloaded it from wrote for it in the Preferences, which usually is in capital letters or with a bunch of weird underscores). As I'm OCD and need everything to be neat, I'm highly tensed right now. I really want everything to be neat and clear!
    So, how do I make sure that iTunes reads the files' names such that it knows the structure is "Singer - Song name"? Thanks.

    iTunes doesn't use file names to determine how music appears in your library,  Rather, it uses metadata that is split between:
    data elements that are embedded within the media files
    data elements that are included in the entries in the iTunes database
    No amount of reorganization, renaming or other manipulation at the file level will make any difference to how songs will appear in iTunes.  Using your example:
    the value of the track number element is 1
    the value of the artist element is "Elvis Presley"
    the value of the song name element is "Blue Suede Shoes"
    Depending on how you configure iTunes then the file name is either:
    completely independent of iTunes (i.,e., the file containing this song could be xyz.mp3)
    dependent on the metadata managed by iTunes, (i.e., when you have these two options set:
    then iTunes will set the file name to be 1-01 Blue Suede Shoes.mp3 where:
    the file is in a folder called "Elvis Presley" (the name of the album)
    that folder is in one called "Elvis Presley" (the name of the artist) which is in iTunes Media\Music
    Going back to your question "How to make iTunes read the song's name/singer from the file's name" the answer is simple - you can't, as this is not how iTunes works.  There are some third-party utilities that you can use to set some metadata element values based on parsing of file names which might be a useful first step.  However, to use iTunes effectively you should really forget about / ignore file names - manage your media using appropriate metadata and allow iTunes to look after file names behind the scenes.

  • Cannot save pdf files using Reader 9.1

    I cannot save the pdf files from online journals as .pdf files using Reader 9.1  The only options it gives me are html or plain text.   Previous versions of Reader saved the pdf files easily.  Configuration issue?

    What browser are you using? Are you positive that they are PDF files? If so, do you have a link we can look at?
    Typicaly, if they really are PDF fies, that's the only option you get when you use fie>save as. If they're just web pages, you get the options that you mention.

  • Read and write excel sheet data from uploded file in sharepoint site programmatically 2013

    hi team,
    I am working on sharepoint 2013.I want to read and write data in excel sheet (micrsoft excel) from stored file in shrepoint docoumnt library .please suggest me
    vijay

    Hi
    Vijay,
    check those links
    http://www.sharepointwithattitude.com/archives/61
    https://social.technet.microsoft.com/Forums/en-US/e760051b-a92f-473c-9ec9-0f0c36c99e40/read-and-write-excel-sheet-data-from-uploded-file-in-sharepoint-site-programmatically-2013?forum=sharepointdevelopment
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation. Please remember to mark the reply as answer if it helps.

  • Unable to read TLD "META-INF/jsf_core.tld" from JAR file "file:

    Hallo everybody :-)<br /><br />i've installed Workflow-Server + ARES + FormManager. When i call localhost:8080/adminui i can log in and the browser loads the next site --> it fails and says:<br /><br />org.apache.jasper.JasperException: Unable to read TLD "META-INF/jsf_core.tld" from JAR file "file:/C:/Adobe/LiveCycle/jboss/server/all/tmp/deploy/tmp56414LiveCycle.ear-contents/admi nui.war/WEB-INF/lib/jsf-impl.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: com.sun.faces.taglib.FacesTagExtraInfo<br />     org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:5 0)<br />     org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)<br />     org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:183)<br />     org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:181)< br />     org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)<br />     org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)<br />     org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)<br />     org.apache.jasper.compiler.Parser.parse(Parser.java:126)<br />     org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)<br />     org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)<br />     org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)<br />     org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)<br />     org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)<br />     org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)<br />     org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)<br />     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)<br />     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)<br />     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)<br />     javax.servlet.http.HttpServlet.service(HttpServlet.java:810)<br />     com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)<b r />     com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)<br />     com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)<b r />     com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)<br />     com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)<br />     javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)<br />     com.adobe.framework.SecurityFilter.doFilter(SecurityFilter.java:177)<br />     com.adobe.idp.um.auth.filter.PortalSSOFilter.doFilter(PortalSSOFilter.java:106)<br />     com.adobe.framework.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter .java:161)<br /><br />Any idea what' wrong?<br /><br />Thanks,<br />Valerio

    Hi Howard,
    thank you for your post.
    I actually new about the problems with the jvm version. Still i wanted to ask, cause there are different reports on this `java problems` and even though the 1.4.2_08 seems to be the best version (by the way this version is not to be downloaded any longer *sig*), there are people getting all installed with other versions. I couldn't find any regularity in the misbehavior of the servers while installing.
    I finally achieved and got everything working ... but very slow. Loading the adminui or BAM features takes very long time (over one minute). Have you already had this delay. Any hint?
    Thanks again,
    Valerio

  • Displaying image from binary file

    I am converting a image file(jpg) into a binary file and sending it. In the receiving side i got back the binary file and want to display the image in the applet or store the image in a file. while trying to do this i am not able to read the image from the buffer. Below here i have given my code.
    File f= new File("image.jpg");
           FileInputStream fis = new FileInputStream(f);
           byte [] buffer = new byte[(int)f.length()];
           fis.read(buffer,0,buffer.length);
           fis.close();
          File f1 = new File("input.txt");
          int length = buffer.length;
          PrintWriter pw;
           pw = new PrintWriter(new BufferedWriter(new FileWriter(f1)));
          for(int i=0;i<length;i++)
              pw.println(Integer.toBinaryString(buffer));
    pw.flush();
    pw.close();
    converting back to image i get error
    File f1 = new File("inp.txt");
    FileInputStream fis = new FileInputStream(f1);
    buffer = new byte[(int)f1.length()];
    fis.read(buffer,0,buffer.length);
    Toolkit tk = Toolkit.getDefaultToolkit();
    img = tk.createImage(buffer);
    Reply me as early as possible.thanks.

    You have two glaring problems here.
    Firstly, you are writing via writers, which are intended for text and are probably corrupting your data. You want to be using a FileOutputStream.
    Secondly, when reading in you are not checking the number of bytes read and may well not be fully populating your array. You want to change your reading code to something like this,
        buffer = new byte[(int)f1.length()];
        int read = 0;
        while (f1.available() > 0)
            read += fis.read(buffer, read, buffer.length - read);
        }

  • How to Create a OLAP Cube in DEV using SSAS from Raw file system backup from Production?

    How to Create a OLAP Cube in DEV using SSAS from Raw file system backup from Production? I dont have a .abf file available. Two paritions in production are missing data. We were able to get back file system backup which contains the files for these two paritions.
    How do I create a cube in Dev using this file system backup.
    we are on SQL Server 2008R2.
    Thanks,

    How to Create a OLAP Cube in DEV using SSAS from Raw file system backup from Production? I dont have a .abf file available. Two paritions in production are missing data. We were able to get back file system backup which contains the files for these two paritions.
    How do I create a cube in Dev using this file system backup.
    we are on SQL Server 2008R2.
    Thanks,

  • How to use image from a file in signature appearance.

    Hi,
    I am creating a Plugin for acrobat 9, using PubSec using DocSign sample as basis. I have created the appearance using text objects and the logos data that came with the DocSign sample. But I want to use image from a file (like, jpg) in the signature appearance creation. So far the documentation doesnt tell how to achieve this.
    Can you please tell me in a  "How-to" kinda way to achieve this?
    Thanks in advance.

    Thanks for ur prompt reply.
    There are so many samples in the sdk. which one is the "sample for adding images."?

  • [POL-3309] trying to use datapage from different file.

    Getting this error trying to access both the ESB and BPEL datasources in SOA Suite 10.1.3 GA.
    Any ideas how to fix?

    I am also getting same error message when I am trying to establish a olite connection. Moreover I got this error when I opened BPEL console :
    Cannot fetch a datasource connection.
    The process domain was unable to establish a connection with the datasource with the connection URL "jdbc/BPELServerDataSourceWorkflow". The exception reported is: [POL-3309] trying to use datapage from different file
    Please check that the machine hosting the datasource is physically connected to the network. Otherwise, check that the datasource connection parameters (user/password) is currently valid.
    Please provide solution.....

  • Siebel 8.0.0.12 Fix Pack; Unable to get the seed from binary file.

    Hello Folks,
    Can anyone throw some light into what action is required on my scenario.
    I have applied Fix Pack Siebel 8.0.0.12 on top of 8.0.0.11 SBA. After it is appled, I am facing a documented issue within the Release Notes for the 8.0.0.12 Fix Pack
    The issue is "UNABLE TO LAUNCH URL AFTER APPLYING SIEBEL 8.0.0.12". I tried the steps given with the MR document, however, I am still having this issue.
    I am also not sure what is expected at the step of; Run the following command: seedgeneratorutil myseed.dat abcdef .
    It's asking me for a value to enter for seed at command prompt. "Enter the seed":
    what I should give here. As an assumption values,I gave SADMIN and tried to launch but still shows up the same error
    Please Assit
    Steps Details from Release Notes:
    UNABLE TO LAUNCH URL AFTER APPLYING SIEBEL 8.0.0.12
    Component: Server Infrastructure
    Subcomponent: SWSE
    Product Version: Siebel 8.0.0.12
    Base Bug ID: 11938270
    **Users are unable to launch the URL after applying the Siebel 8.0.0.12 Fix Pack.
    **Use the following workaround to address this issue:
    Navigate to the eappweb/bin directory from the command line on the SWSE installation.
    Run the following command:
    seedgeneratorutil myseed.dat abcdef
    NOTE: In the example, myseed.dat is a filename. You can give any file name you wish.
    The myseed.dat file is generated in the eappweb/bin directory.
    Edit eapps.cfg to include the following parameters under the SWE section:
    seedfile = < complete path for myseed.dat >
    Bounce the web server.
    (For Linux only) Copy libmod_swe.so from the eappweb/bin folder to the web/ohs/modules folder
    Thanks
    Kumar

    Wilson,
    Thanks for your reply.I have repeated the steps and regenerated the error messages.
    Browser
    Message:
    An error occurred while trying to process your request. This error indicates a problem with the configuration of this server and should be reported to the webmaster (along with any errors listed below). We apologize for the inconvenience
    Initialization error:
    Unable to get the seed from binary file.
    Log
    2021 2011-09-20 23:23:01 0000-00-00 00:00:00 +0530 00000000 001 003f 0001 09 ss110920_7068 7068 7852 E:\sba80\SWEApp\log\ss110920_7068.log 8.0.0.12 [20444] ENU
    ProcessPluginState     ProcessPluginStateError     1     000000024e781b9c:0     2011-09-20 23:23:01     7852: [SWSE] Unable to get the seed from binary file.
    Eapps.cfg
    [swe]
    Language = enu
    Log = errors
    LogDirectory = $(SWSERoot)\log
    ClientRootDir = $(SWSERoot)
    SessionMonitor = False
    AllowStats = true
    LogSegmentSize = 0
    LogMaxSegments = 0
    DisableNagle = False
    seedfile = E:\sba80\SWEApp\BIN\80012seed.dat
    Thanks
    Kumar

  • How to extract html file and folder from jar file

    Hi all ,
    I should to submit my project tomorrow . plz help me .
    In my project jar file I have html page that should run when I use the program, I can't extract it . Also it have folder that contain some files that My program should use it . I dont know how to use it from jar file or how to extract it . plz help me.
    If you could I need java could for that.
    Thanks alot.

    Hi all ,
    I should to submit my project tomorrow . plz help me .
    In my project jar file I have html page that should run when I use the program, I can't extract it . Also it have folder that contain some files that My program should use it . I dont know how to use it from jar file or how to extract it . plz help me.
    If you could I need java could for that.
    Thanks alot.

Maybe you are looking for

  • I Tunes and External Hard Drive

    Hi, I am wondering if it is possible to get I tunes to read my external hard drive. I currently have 140gb of tunes on my external hard drive. The plan is to turn on the pc and then i tunes loads up the external hard drive. this is possible?, if so c

  • Error in PDF & TXT output requests when using ixlib.cfg please help

    Hi Gurus, I am having a problem that The output for custom Arabic report in ghost viewer is coming garbage type characters so i added these below lines in adovars.env export IX_PRINTING=$FND_TOP/resource/ixlib.cfg export IX_RENDERING=$FND_TOP/resourc

  • Host realtime server program on DAQ-PC or on Server

    As the attached diagram, we have existing system, now need to upgrade with realtime data polling function. Should I use solution 1 or 2. Any suggestion, thanks. Attachments: Diagram.JPG ‏40 KB

  • Working with 'nibbles' in java

    Hi, Im storing values in bytes containing two nibbles (4 bits) packed into a vector of bytes. I have two values between 0 and 15 for each nibble, I create two bytes and set each value to these, I then shift the first byte 4 places and and add the res

  • How to use multiply sequences?

    HI - I always worked with just one sequence for the entire project, but this time the project I'm working on is so big that it makes sense to work with many (30+) separate sequences. Can I do this in FCE4? I mean - if I mad so many small sequences an