UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor
562 Views
Registered: ‎10-04-2018

Multi Stream Decoding and Encoding with VCU

Hello,

I am trying to decode two encoded videos at the same time. I am using PG252 to understand how VCU works. In page 155, 

falan.JPG

But it's for same input.

What is the syntax for different input files?

Tags (2)
0 Kudos
19 Replies
Xilinx Employee
Xilinx Employee
505 Views
Registered: ‎08-01-2007

Re: Multi Stream Decoding and Encoding with VCU

The case you are pointing to shows how to use the GStreamer tee plugin to replicate 1 stream multiple times and send it to the encoder.  That is what the note at the bottom of the code sample is trying to say.


Note: tee element is used to feed same input file into 4 decoder instances, user can use separate gst-launch-1.0 application to fed different inputs.

If you want to decode multiple different files, you just run multiple GStreamer launch pipelines.

gst-launch-1.0 filesrc location=input_0_1920x1080.mp4 ! qtdemux ! h265parse ! queue ! omxh265dec ! queue max-size-bytes=0 ! filesink location="output_0_1920x1080.yuv" &
gst-launch-1.0 filesrc location=input_1_1920x1080.mp4 ! qtdemux ! h265parse ! queue ! omxh265dec ! queue max-size-bytes=0 ! filesink location="output_1_1920x1080.yuv" &
gst-launch-1.0 filesrc location=input_2_1920x1080.mp4 ! qtdemux ! h265parse ! queue ! omxh265dec ! queue max-size-bytes=0 ! filesink location="output_2_1920x1080.yuv" &
gst-launch-1.0 filesrc location=input_3_1920x1080.mp4 ! qtdemux ! h265parse ! queue ! omxh265dec ! queue max-size-bytes=0 ! filesink location="output_3_1920x1080.yuv" 

If you try to decode more streams that the hardware can handle you should see an allocation error.

 

Chris
Video Design Hub | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Highlighted
Contributor
Contributor
484 Views
Registered: ‎10-04-2018

Re: Multi Stream Decoding and Encoding with VCU

Hello,

Thank you so much, it helped for 1080p videos, but failed when I try for 4kp30 or 4Kp15 videos.

Why doesnt it work?

0 Kudos
Scholar watari
Scholar
478 Views
Registered: ‎06-16-2013

Re: Multi Stream Decoding and Encoding with VCU

Hi @yildizbilgin 

 

Did you set QoS parameter for VCU ?

 

$ devmem 0xFD370008 w 0x3

$ devmem 0xFD37001C w 0x3

$ devmem 0xFD380008 w 0x3

$ devmem 0xFD38001C w 0x3

$ devmem 0xFD390008 w 0x3

$ devmem 0xFD39001C w 0x3

$ devmem 0xFD3A0008 w 0x3

$ devmem 0xFD3A001C w 0x3

$ devmem 0xFD3B0008 w 0x3

$ devmem 0xFD3B001C w 0x3

$ devmem 0xFD380004 w 0xF

$ devmem 0xFD390004 w 0xF

$ devmem 0xFD3A0004 w 0xF

$ devmem 0xFD3B0004 w 0xF

$ devmem 0xFD380018 w 0xF

$ devmem 0xFD390018 w 0xF

$ devmem 0xFD3A0018 w 0xF

$ devmem 0xFD3B0018 w 0xF

 

Best regards,

0 Kudos
Contributor
Contributor
466 Views
Registered: ‎10-04-2018

Re: Multi Stream Decoding and Encoding with VCU

Yeah, I've tried. Still doesnt work.

uuuuuuuuu.JPG

0 Kudos
Scholar watari
Scholar
461 Views
Registered: ‎06-16-2013

Re: Multi Stream Decoding and Encoding with VCU

Hi @yildizbilgin 

 

Could you share your gstreamer pipeline ?

I'm an interesting this issue.

 

Best regards,

0 Kudos
Contributor
Contributor
457 Views
Registered: ‎10-04-2018

Re: Multi Stream Decoding and Encoding with VCU

gst-launch-1.0 filesrc location="sunflower4Kp15_part1.mp4" ! qtdemux name=demux1 demux1.video_0 ! h264parse ! video/x-h264, alignment=au ! omxh264dec low-latency=0 ! omxh265enc ! video/x-h265, alignment=au ! filesink location="output_1.h265" & gst-launch-1.0 filesrc location="sunflower4Kp15_part2.mp4" ! qtdemux name=demux2 demux2.video_0 ! h264parse ! video/x-h264, alignment=au ! omxh264dec low-latency=0 ! omxh265enc ! video/x-h265, alignment=au ! filesink location="output_2.h265"

I inspire from :

ccccccccc.JPG

0 Kudos
Scholar watari
Scholar
391 Views
Registered: ‎06-16-2013

Re: Multi Stream Decoding and Encoding with VCU

Hi @yildizbilgin 

 

I'd like to duplicate your environment, if possibel.

Would you share the following result, if possible ?

 

$ mediainfo <your mp4 file>

 

note)

"mediainfo" is a utility of media file on Linux. (Ubuntu/Debian)

 

Best regards,

 

0 Kudos
Contributor
Contributor
370 Views
Registered: ‎10-04-2018

Re: Multi Stream Decoding and Encoding with VCU

I am using windows so I have these:

bbb_1.JPGbbb_2.JPG

0 Kudos
Moderator
Moderator
359 Views
Registered: ‎11-09-2015

Re: Multi Stream Decoding and Encoding with VCU

Hi @yildizbilgin 

Your log clearly mention that you do not have enough memory. What if you try with less or smaller streams?

Probably you need to move to a board with more DDR as the ZCU106.

Regards


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Scholar watari
Scholar
350 Views
Registered: ‎06-16-2013

Re: Multi Stream Decoding and Encoding with VCU

Hi @yildizbilgin 

 

As @florentw  already mentioned at other post, the route cause is memory allocation error.

In this case (VCU TRD), there is not specific cma (Continuous Memory Allocator) setting at Linux kernel argument and default value is 16MB.

 

VCU software, like gstreamer and so on, requires memory to share it between hardware resource and userland software.

This case (resolution is 3840x2160) is required large memory by it.

At least it needs about 32MB.

So, software give up "memory allocation".

 

Here is solution for like this issue.

 

# Solution

- Change cma value from default (16MB) to 128MB (maxmum value)

 

1. Execute petalinux-config

2. Exnter DTG Settings ---> Kernel Bootargs --->

3. Edit it

4. Add "cma=128M" on it

5. Execute petalinux-build

 

Best regards,

0 Kudos
Contributor
Contributor
341 Views
Registered: ‎10-04-2018

Re: Multi Stream Decoding and Encoding with VCU

Hello I normally follow this instruction:

Under "DTG Settings" ->
"Kernel Bootargs" ->
Un-select "generate boot args automatically" ->
Enter "user set kernel bootargs" -> Paste in the following line
earlycon clk_ignore_unused earlyprintk root=/dev/mmcblk0p2 rw rootwait cma=1024M

 

So, should I just write cma=128M instead of the above line?

0 Kudos
Moderator
Moderator
311 Views
Registered: ‎11-09-2015

Re: Multi Stream Decoding and Encoding with VCU

HI @yildizbilgin 

I think that if you have CMA=1024M this is enough you should keep this value


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Contributor
Contributor
276 Views
Registered: ‎10-04-2018

Re: Multi Stream Decoding and Encoding with VCU

Hi @florentw ,

Maybe I should enable the PL DDR?

How should I connect the PL DDR in ZCU104 BSP project? Do you have an idea?

Thanks...

0 Kudos
Moderator
Moderator
272 Views
Registered: ‎11-09-2015

Re: Multi Stream Decoding and Encoding with VCU

HI @yildizbilgin 

Yes, it might worth to try. This is documented in PG252 page 113.


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Contributor
Contributor
239 Views
Registered: ‎10-04-2018

Re: Multi Stream Decoding and Encoding with VCU

Yes, I have seen this but it didnt work. I think I should also add ddr4 IP block to the vivado project which isnt explained in PG252. I dont know how to do it.
0 Kudos
Moderator
Moderator
223 Views
Registered: ‎11-09-2015

Re: Multi Stream Decoding and Encoding with VCU

Hi @yildizbilgin 

You need to add the Zynq UltraScale+ EV Architecture Video Codec Unit DDR4 LogiCORE IP as described in pg252 chapter 6 ...


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Contributor
Contributor
169 Views
Registered: ‎10-04-2018

Re: Multi Stream Decoding and Encoding with VCU

Hello @watari ,

I have already configure Kernel bootargs as

earlycon clk_ignore_unused earlyprintk root=/dev/mmcblk0p2 rw rootwait cma=1024M

Is it wrong?

0 Kudos
Moderator
Moderator
160 Views
Registered: ‎11-09-2015

Re: Multi Stream Decoding and Encoding with VCU

HI @yildizbilgin 

No it should be fine


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Contributor
Contributor
141 Views
Registered: ‎10-04-2018

Re: Multi Stream Decoding and Encoding with VCU

Hello,
So what should I change? My problem still exists. I cant decode or encode two 4Kp30 videos at the same time.
0 Kudos