cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
yasin.kagan
Contributor
Contributor
962 Views
Registered: ‎02-06-2019

Accessing VCU encoded data from PL

Jump to solution

Hi every one, 

I'm kinda new on Vivado but I want to use VCU encoded data on PL side of the zcu104 board. [ V4L2 camera --> VCU encode --> Some HW functions ]

I scan pg 252 ch13. "Application Software Development" but it just has information about how to use VCU. I couldn't found how to access VCU encoded data form PL? 

1- Am I have to write a custom Gstreamer element to grab and store in a known memory location and then sent it via AXI? If so how can I do that, are there any explanatory documents or web pages?

2- Or is there any Gstreamer elements which writes data to a known DDR address with additional flags like, write done, data available. 

I just create a VCU HW block design end export to Petalinux 2018.3. Then I build an image that has allegro drivers and Gstreamer. So I could use VCU to stream encoded video over ethernet with "vcu_demo_camera_encode_stream_out.sh"

Thanks in advance.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
mksafavi
Contributor
Contributor
833 Views
Registered: ‎10-13-2019

Hi.
data in gstreamer is moved around through "gst_buffer"s
to access VCU encoder data you need to get that buffer.
as far as I know, there isn't any GST-element that can transfer data through axi.
so you have two options :
1- write a GST plugin
2- write a GST app and get the encoder buffer with the appsink element.

developing with appsink/appsrc elements is easier and much faster than learning to develop a plugin. but I run into a copy issue with appsink that is bugging me for two months
If you got the time go for the plugin.

for both of these methods to be zero-copy, you need to develop a driver to handle axi transfers ( in my case a driver for axi-DMA). right now I'm just doing a mmap and sending my data to the PL side. which works perfectly fine but costs me a copy.


In my project, I get the omxh264 decoder buffer so I'm not sure how the frame data is stored in encoder buffers but you can check that.

 

 

_____________________________________
mksafavi [at] avanco.tech

View solution in original post

0 Kudos
6 Replies
kvasantr
Moderator
Moderator
884 Views
Registered: ‎04-12-2017

Hello @yasin.kagan 

I will recommend you start using the BSP design of ZCU104 EVB. You can download it from following link:

https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-platforms.html

And Moving ahead you can look at the PG252 VCU Out of the Box Examples from page number 181.

https://www.xilinx.com/support/documentation/ip_documentation/vcu/v1_2/pg252-vcu.pdf

Basically we have given examples to all the use cases that you try. 

Also for camera input(v4l2) capture->encode->file you can do with following pipeline:

gst-launch-1.0 v4l2src io-mode=4 device=/dev/video0 ! video/x-raw, width=1920,
height=1080, framerate=60/1, format=NV12 ! omxh264enc ! video/x-h264, alignment=au ! filesink location=file.264

Please note you should edit the pipeline for your input resolution and video format it gives. This pipeline will usually select the mmc area for storing the recorded file but you can select alternate location as SATA as well as USB by mounting them on the console.

Regards

Kunal

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
yasin.kagan
Contributor
Contributor
870 Views
Registered: ‎02-06-2019

Hello @kvasantr 

I already have a platform that has VCU in it, and I can run VCU pipelines which Xilinx offered on the pg252-vcu.pdf

But, I don't want to store the encoded video, I just want to process on the PL side of zcu104. If I store encoded data on the MMC memory and then grab from there, it just a waste of time to write and read data to MMC, or SATA. I just want to access the encoded data from PL. 

Also, zcu104 BSP prebuild image has NO VCU in it. They just implemented in the PL.

0 Kudos
mksafavi
Contributor
Contributor
834 Views
Registered: ‎10-13-2019

Hi.
data in gstreamer is moved around through "gst_buffer"s
to access VCU encoder data you need to get that buffer.
as far as I know, there isn't any GST-element that can transfer data through axi.
so you have two options :
1- write a GST plugin
2- write a GST app and get the encoder buffer with the appsink element.

developing with appsink/appsrc elements is easier and much faster than learning to develop a plugin. but I run into a copy issue with appsink that is bugging me for two months
If you got the time go for the plugin.

for both of these methods to be zero-copy, you need to develop a driver to handle axi transfers ( in my case a driver for axi-DMA). right now I'm just doing a mmap and sending my data to the PL side. which works perfectly fine but costs me a copy.


In my project, I get the omxh264 decoder buffer so I'm not sure how the frame data is stored in encoder buffers but you can check that.

 

 

_____________________________________
mksafavi [at] avanco.tech

View solution in original post

0 Kudos
mksafavi
Contributor
Contributor
832 Views
Registered: ‎10-13-2019
Oh. I forgot to mention these websites.

gstreamer is quite well documented if you know where to look at.
I really recommend reading basic doc and application dev guides. then check appsink examples.

https://gstreamer.freedesktop.org/documentation/tutorials/index.html?gi-language=c
https://gstreamer.freedesktop.org/documentation/application-development/index.html

you can ask your gstreamer related questions here too:
http://gstreamer-devel.966125.n4.nabble.com/
_____________________________________
mksafavi [at] avanco.tech
0 Kudos
kvikramaxlnx
Contributor
Contributor
758 Views
Registered: ‎05-25-2018

Hi @yasin.kagan 

   If you want to parse the encoded bitstream and use it in PL, you need to grab the AXI transactions and sink them into your PL element. Should be doable. 

    

In Service,
Kamalesh Vikramasimhan
www.yantravision.com
220 Views
Registered: ‎09-05-2019

Hello @kvikramaxlnx,

could you describe that in more detail? Do you mean the ports from VCU IP Core (M_AXI_ENC) in blockdesign are connectable to any other IP Core with an AXI-Interface?  

Regards 

Abdul

 

0 Kudos