DSPRelated.com
Forums

how to read an video file from system(pc) to ADSP-BF533

Started by kg_m...@rediffmail.com March 30, 2005

hi,

i'm working in video image processing. i finshed my code in "c" language. now i want to cross compile this code into ADSP-BF533 using visual dsp3.5++ .

my doubt is

in real time:
we can read the video sequence from camera using PPI (gave in the video input example).

in offline:(before going to real time i want to check my code in offline that means---input video is stroed in my system i want to give that file as input)

now i stored one video clip(5 minutes duration) into my system. how can i read this file for my algorithm.
what i did is first i convert video file(.avi or .mpg) into .bmp or .jpg or .pgm format (30frames/second so 9000 files) then this is converted into .dat file. then i tried with "fscanf" and "fread" it took more than 20 mins to read a single frame(one .dat file). so i don't know how to read it.
because of this problem i couldn't move forward.
please help me to solve this problem.

thank you.

regards,
meiyazhagan.



On Wed, 30 Mar 2005 kg_meiya81@kg_m... wrote:

> i'm working in video image processing. i finshed my code in "c"
>language. now i want to cross compile this code into ADSP-BF533 using
>visual dsp3.5++ .
>
> my doubt is
>
> in real time:
> we can read the video sequence from camera using PPI (gave in the video input example).
>
> in offline:(before going to real time i want to check my code in
>offline that means---input video is stroed in my system i want to give
>that file as input)
>
> now i stored one video clip(5 minutes duration) into my system. how can
>i read this file for my algorithm.
> what i did is first i convert video file(.avi or .mpg) into .bmp or
>.jpg or .pgm format (30frames/second so 9000 files) then this is
>converted into .dat file. then i tried with "fscanf" and "fread" it took
>more than 20 mins to read a single frame(one .dat file). so i don't know
>how to read it.
> because of this problem i couldn't move forward.
> please help me to solve this problem.
>
> thank you.
>
> regards,
> meiyazhagan.

You'll need to dump the data into your code. The best way to do that is
with a .var in assembler, or create a constant buffer in C with bufr[size]
= {0xVVVV, ... } and you have size values in the buffer. Then just access
the data directly as binary. It'll take a while for the debugger to load
all that data, but your test will run at 'real time' speed.

Patience, persistence, truth,
Dr. mike


Hello,

--- Mike Rosing <eresrch@eres...> wrote:
>
> You'll need to dump the data into your code. The
> best way to do that is
> with a .var in assembler, or create a constant
> buffer in C with bufr[size]
> = {0xVVVV, ... } and you have size values in the
> buffer. Then just access
> the data directly as binary. It'll take a while for
> the debugger to load
> all that data, but your test will run at 'real time'
> speed.

As a complement to what Dr. Mike writes here, try to
get an emulator (prefereably a High Performance one)
to dump your data into the DSP. That will be much
faster and reliable than the provided USB interface. I
remember that recently I had to get some 120000 32 bit
floating point values stored in SDRAM of the
ADDS-21161-EZLITE, somehow the inverse procedure of
what you are trying to do, and it just broke several
times. So I had to read my data in 4 "captures" of
30000 values each one.

Maybe in my case it was because of the values being in
SDRAM and not in internal SRAM, maybe because of the
slow processor and slow USB link (not 2.0) of the old
laptop on which I was doing this, I don't know.

But if you can do with an emulator, that is certainly
the safest way to do it.

Regards, Jaime Andr Aranguren Cardona
jaime.aranguren@jaim...
jaime.aranguren@jaim...

__________________________________



The problem occurred because I had included "filter.h" in some files and
"filters.h" in others. I think the headers ought to be compatible but it
does mention something about it in the manual.

At 06:51 AM 3/30/2005, Mike Rosing wrote:

>On Wed, 30 Mar 2005 kg_meiya81@kg_m... wrote:
>
> > i'm working in video image processing. i finshed my code in "c"
> >language. now i want to cross compile this code into ADSP-BF533 using
> >visual dsp3.5++ .
> >
> > my doubt is
> >
> > in real time:
> > we can read the video sequence from camera using PPI (gave in the
> video input example).
> >
> > in offline:(before going to real time i want to check my code in
> >offline that means---input video is stroed in my system i want to give
> >that file as input)
> >
> > now i stored one video clip(5 minutes duration) into my system. how can
> >i read this file for my algorithm.
> > what i did is first i convert video file(.avi or .mpg) into .bmp or
> >.jpg or .pgm format (30frames/second so 9000 files) then this is
> >converted into .dat file. then i tried with "fscanf" and "fread" it took
> >more than 20 mins to read a single frame(one .dat file). so i don't know
> >how to read it.
> > because of this problem i couldn't move forward.
> > please help me to solve this problem.
> >
> > thank you.
> >
> > regards,
> > meiyazhagan.
>
>You'll need to dump the data into your code. The best way to do that is
>with a .var in assembler, or create a constant buffer in C with bufr[size]
>= {0xVVVV, ... } and you have size values in the buffer. Then just access
>the data directly as binary. It'll take a while for the debugger to load
>all that data, but your test will run at 'real time' speed.
>
>Patience, persistence, truth,
>Dr. mike

Steve Holle
Link Communications, Inc.
1035 Cerise Rd.
Billings, MT 59101
sholle@shol...



Hi, I would like to help you but in fact I didn't use the video option
of the image viewer tool, I know that it exists but nothing more.
I used only the image option that however allows you to choose grayscale
and color.
However it seems that this option is not available if you want to use
video stream.
I'm not an expert but I think that the use of a JTAG emulator is the
only way to achieve the results that you need, but it is very expensive.
In fact also the approach proposed by Mike Rosing needs to allocate all
the memory space that you need at compile time.
I hope that someone can suggest you a JTAG emulator not too expensive :-) meiya zha gan wrote:

>
> hello giovanni,
>
> thank you very much. i tried your way of read a video file. it works
> for small video clips.here the whole data occupies the lots of memory
> space in SDRAM. and also even our file is gray scale it takes as a
> color. i want to read single frame at a time (that means in SDRAM one
> vriable name with size of one frame).
> can explain me the doubts
>
> 1. even my video is in grey scale it read as color how to solve this
> problem?
>
> 2.i want to read single frame at a time from HD to ADSP how to proceed
> on this?
>
> thank you.
>
> with regards,
> meiyazhagan. >
> On Thu, 31 Mar 2005 Giovanni wrote :
> >Hello, I don't know if this can solve your problem, I hope that yes.
> >Few weeks ago I was trying to fread an image from hard disk to DSP
> board, and I found it too slow.
> >However I found a tool (Image viewer) that allows you to read a file
> from your HD an to load it in DSP memory.
> >Yo simply have to create you program, load it on memory, the choose
> the plce memory where you want to place the image/video file.
> >Then you choose View-> Debug Windows -> Image viewer.
> >Then youy select Source = file, and choose your file.
> >Hope this helps. Giovanni
> >Obviously there are better way to do this, I think through JTAG
> emulator, but I don't have it
> >
> >
> >kg_meiya81@kg_m... wrote:
> >
> >>hi,
> >>
> >>i'm working in video image processing. i finshed my code in "c"
> language. now i want to cross compile this code into ADSP-BF533 using
> visual dsp3.5++ .
> >>
> >>my doubt is
> >>
> >>in real time:
> >>we can read the video sequence from camera using PPI (gave in the
> video input example).
> >>in offline:(before going to real time i want to check my code in
> offline that means---input video is stroed in my system i want to give
> that file as input)
> >>
> >>now i stored one video clip(5 minutes duration) into my system. how
> can i read this file for my algorithm.
> >>what i did is first i convert video file(.avi or .mpg) into .bmp or
> .jpg or .pgm format (30frames/second so 9000 files) then this is
> converted into .dat file. then i tried with "fscanf" and "fread" it
> took more than 20 mins to read a single frame(one .dat file). so i
> don't know how to read it.
> >>because of this problem i couldn't move forward. please help me to
> solve this problem.
> >>thank you.
> >>
> >>regards,
> >>meiyazhagan.
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> <http://clients.rediff.com/signature/track_sig.asp>