cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
1,163 Views
Registered: ‎03-07-2019

How to store video on SD CARD from CSI-2 signals ?

Jump to solution

Hello everyone,

I am working on the ULTRA96 development board which has an Ultrascale+ FPGA embedded and I would like to store videos on a SD CARD from CSI-2 camera (Raspberry pi camera). I already know that I need an IP to get CSI-2 signals on my FPGA but after that I don't really know what needs to be done. I suppose I have to encode my data to be able to record it but I don't really know how to do it.

Does anyone know how to do it ?

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Mentor
Mentor
1,041 Views
Registered: ‎06-16-2013

Re: How to store video on SD CARD from CSI-2 signals ?

Jump to solution

Hi @corentin.meneau 

 

That sounds grate.

But how to encode H264 by hardware ?

It's no problem, if you already consider it as encoding software or using VCU.

 

BTW, here is my solution.

Would you refer it ?

 

Plan A)

Encode CSI signal by VCU or other encoder unit -> Deal with encoded video data by V4L2 on linux -> Store video data 

 

Plan B-1)

Covert CSI signal to AXI4Stream -> Store stream data by VDMA into frame buffer -> Read stream data from frame buffer -> Store stream data into SD Card by using sector number -> After that convert sector data to file by "dd" command on linux. => Convert raw data to H264 by ex. ffmpeg or libavcodec on linux.

 

Plan B-2)

Covert CSI signal to AXI4Stream -> Store stream data into SD Card by using sector number -> After that convert sector data to file by "dd" command on linux. => Convert raw data to H264 by ex. ffmpeg or libavcodec on linux.

 

Best regards,

View solution in original post

6 Replies
Highlighted
Teacher
Teacher
1,131 Views
Registered: ‎07-09-2009

Re: How to store video on SD CARD from CSI-2 signals ?

Jump to solution

you might want to think about the data rate of the camera data and the SD card,

 

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
Highlighted
Mentor
Mentor
1,111 Views
Registered: ‎06-16-2013

Re: How to store video on SD CARD from CSI-2 signals ?

Jump to solution

Hi @corentin.meneau 

 

How do you deal with stored data ? For file by file system or stored data as raw data by sector unit ?

You need to consider it, too.

 

Best regards,

 

Highlighted
1,072 Views
Registered: ‎03-07-2019

Re: How to store video on SD CARD from CSI-2 signals ?

Jump to solution

Thanks for your reply. Someone already told me that but it's hard to find exactly which data rate I have in all parts of my system. I suppose after the video codec the data flow will drecrease drastically.

0 Kudos
Highlighted
1,070 Views
Registered: ‎03-07-2019

Re: How to store video on SD CARD from CSI-2 signals ?

Jump to solution

File by file seems good to me. I would like to store video in h264 format. I think it will be easier to read stored videos on a computer after. What do you think ?

0 Kudos
Highlighted
Mentor
Mentor
1,042 Views
Registered: ‎06-16-2013

Re: How to store video on SD CARD from CSI-2 signals ?

Jump to solution

Hi @corentin.meneau 

 

That sounds grate.

But how to encode H264 by hardware ?

It's no problem, if you already consider it as encoding software or using VCU.

 

BTW, here is my solution.

Would you refer it ?

 

Plan A)

Encode CSI signal by VCU or other encoder unit -> Deal with encoded video data by V4L2 on linux -> Store video data 

 

Plan B-1)

Covert CSI signal to AXI4Stream -> Store stream data by VDMA into frame buffer -> Read stream data from frame buffer -> Store stream data into SD Card by using sector number -> After that convert sector data to file by "dd" command on linux. => Convert raw data to H264 by ex. ffmpeg or libavcodec on linux.

 

Plan B-2)

Covert CSI signal to AXI4Stream -> Store stream data into SD Card by using sector number -> After that convert sector data to file by "dd" command on linux. => Convert raw data to H264 by ex. ffmpeg or libavcodec on linux.

 

Best regards,

View solution in original post

Highlighted
1,022 Views
Registered: ‎03-07-2019

Re: How to store video on SD CARD from CSI-2 signals ?

Jump to solution

That's perfect ! This is exactly what I was looking for.

To encode H264 I have found some IPs which are able to do that from AXI4 signals but I will probably use your first solution because I am not sure yet but I am not sure to still use ULTRA96 board but instead the MPSoC module from Trenz Electronic with the Zynq UltraScale+ ZU4EV which already have a VCU embedded.

Thanks a lot for your help.

0 Kudos