multiple vaapi encoding pipelines
Hi,
I'm doing an application where I have to decode and encode multiple times in parallel. For that, I use vaapih264enc
and vaapidecodebin
. The problem is that at some point, I cannot use the encoder anymore inside the application since I get the error:
Error:
"Cannot create a VA derived image from surface 0xxxx".
So, buffers 'feeding' the encoder don't come out into the src pad of the vaapih264enc
in one of the instances but, if at the same time I run a separate gst-launch
where I use the vaapih264enc
I can see how the encoder works fine.
Note: In all
vaapi
element instances I'm running a queue before and also after the encoder/decoder.
So, looking for the error I've found this solved issue which might be related to my problem:
- Subject: multiple vaapi encoding pipelines on radeonsi segfault
- Link: https://bugzilla.gnome.org/show_bug.cgi?id=785085
I've checked the patches pushed to the issue in mesa and also gstreamer-vaapi projects and I'm kind of up to date. Actually, I'm not using the latest but these are the versions I'm running:
- mesa: 19.0.1
- gstreamer-vaapi: 1.14.4
According to the Bugzilla error, Tomas Rataj reported this:
Could be indeed something with the memory mappings because:
This one is working: gst-launch-1.0 videotestsrc ! video/x-raw,format=NV12 ! vaapipostproc ! video/x-raw,format=RGBA ! fakesink
This one is not: gst-launch-1.0 videotestsrc ! video/x-raw,format=RGBA ! vaapipostproc ! video/x-raw,format=NV12 ! fakesink
Where the second pipe also fails on my setup. Not sure if it is really fixed with the patches submitted or if that was some kind of different issue or if it could be some kind of regression.
As a reference, here the pipeline I use to check the encoder is still working:
gst-launch-1.0 filesrc location=<file.ts> ! \
tsdemux name=td td.video_0_0041 ! h264parse ! queue ! \
vaapidecodebin ! video/x-raw,format=NV12,width=1920,height=1080 ! \
queue ! vaapih264enc ! video/x-h264,profile=high ! \
mpegtsmux ! queue ! rtpmp2tpay ! queue ! udpsink host=<ip> port=<port>
Any ideas? @cap @vjaquez Anything I can do to add more debug on the problem?
Thanks in advance!