LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to run a dat file @ specified data rate

i have .dat file of the udp packets which contains the recorded video. the frame size is 770 bytes . i want to play that for specified data rate. means for 1.848Mbps data rate , the interframe delay turns out to be 3.33ms or 300 frames per second. how to do that.as the delay functions usually have integer values. it is simple but i am doing some basix mistake
0 Kudos
Message 1 of 7
(1,230 Views)
can u guide me how to read the specified number of bytes from the binary file in specified time? Means i want to read 770 bytes (1 frame ) in 3.33msec time.. that is equivalent to data rate of 1.848Mbps. how to do that
0 Kudos
Message 2 of 7
(1,222 Views)

Hi farooq,

 


@farooqmardan wrote:
can u guide me how to read the specified number of bytes from the binary file in specified time? Means i want to read 770 bytes (1 frame ) in 3.33msec time.. that is equivalent to data rate of 1.848Mbps. how to do that

Why do you want to time the FileRead operation? It shouldn't matter for your algorithm as long as you can read the file fast enough!

 

The more interesting part is to output the data at the required datarate...

 

Edit:

Please don't ask the same question in several threads. Keep your discussion in one place!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 7
(1,210 Views)

Hello,

 

very long time ago I was creating this (should be easy to reproduce, thats why it's only a picture):

 

Seamless wait.png

 

This does (almost), what you are asking for, but there are some points to mention:

  • if, for some reason, the calling code doesn't have always the exact same execution time, which you would subtract from the value of the delay input, you will have to handle this changing cycle time too. You could use the "millisecond timer value" output of the "wait (ms)" - function for that.
  • the "Wait Until Next ms Multiple" doesn't help you in this case. It helps you to wait until a certain timestamp (compensating different execution time), but since you are jittering between different wait times, you get new problems. The next picture illustrates this:

 

wait until ms multiple -- Problem.png

The red cells are the ms- times the "Wait Until Next ms Multiple"- function will wait to and altering the wait time will lead to wrong cycle times.

 

Second complex:

 

  • can you really show 300 picture frames per second? What hardware do you use for that?
  • Whose eye is able to see the difference between a 25 and 300 framerate?

A good approach to program a video player is to wait in a loop to a certain point of time (e.g. multiples of 40ms), determine the real time (if you jump over one or more multiples, you get back to track) then calculate, which frame is to be shown at this time and load that frame into the frame buffer / picture control. This ensures, that your video has the right speed and will have the predicted play- time.

Greets, Dave
0 Kudos
Message 4 of 7
(1,199 Views)

hi actually that the file i am reading is the video recorded file of size 778 bytes. 8 bytes at the start are the time stamps. the file read should be synced with these time stamps for no frame loss and for constant data rate at which the file has been recorded.

0 Kudos
Message 5 of 7
(1,160 Views)

sorry for late reply

these are 300 frames of 778 bytes of data not the video frames. the first 8 bytes are the time stamps at the specific format . the first objective is to play the file according to that time stamps and see what data rate it comes out to be

0 Kudos
Message 6 of 7
(1,158 Views)

This leaves more questions than it answers.

  1. What does "play the file" mean?
  2. How do you want to control the right rate?
  3. What happens, when you don't reach the desired rate?
  4. What have you done so far? Do you have code (a VI, not a picture) and what problems do you have with your code?

 

Greets, Dave
0 Kudos
Message 7 of 7
(1,150 Views)