Hi,
I'm trying to create a GStreamer pipeline that decodes H264 video using vpudec and tee elements looking something like this:
v4l2src ! vpudec ! tee name=t
t. ! queue ! videorate ! imxvideoconvert_g2d ! vpuenc_h264 ! h264parse ! rtph264pay ! rtpbin ! udpsink
t. ! queue ! videorate ! imxvideoconvert_g2d ! vpuenc_h264 ! appsink
If I run the pipeline with this configuration while attaching only one of the branches to the tee elements, it works fine. As soon as I add the second branch to the tee element (ordering doesn't matter), my program crashes. I've tried adding queue elements with max-size-time=0 property to the first pipeline (before or after the vpudec, or both) but It did nothing.
I've managed to prevent the crashing by adding more elements to the first pipeline so it would look like this:
v4l2src ! vpudec ! queue ! videorate ! imxvideoconvert_g2d ! tee
By doing so, a new problem appears - Adding a second branch with lower video resolution affects the video resolution on the first branch.
Steps to reproduce:
- add branch 1 at 1080p
- add branch 2 at 240p
Result: Branch 1 resolution drops significantly. Looks like 240p.
This happens on-the-fly, without restarting the pipelines.
Note: When running the similar configuration with RAW camera on the same device (no decoding needed), there is no any issues.
v4l2src ! tee
EDIT: I've added logs as an attachment.
Pipeline used:
GST_DEBUG=4 gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-h264 ! vpudec ! tee name=t
t. ! queue ! videorate ! imxvideoconvert_g2d ! videoconvert ! vpuenc_h264 ! appsink
t. ! queue ! videorate ! imxvideoconvert_g2d ! vpuenc_h264 ! h264parse ! rtph264pay ! udpsink
Individually both branches work fine, program crashes when adding second branch.
Every advice is much appreciated.
If needed I can provide more information.
Thanks!
Robert