Hardware accelerated H.264 encoding and streaming on Android
I have the following pipeline running on Android to stream real-time video
from the phone's webcam to a server also running GStreamer:
ahcsrc ! video/x-raw, width=640, height=480 !
tee name=t t. ! videoconvert ! autovideosink sync=true name=sink ! t. !
x264enc speed-preset=ultrafast tune=zerolatency ! rtph264pay
config-interval=1 pt=96 !
udpsink host=192.168.1.3 port=34455
For testing I'm also using a recorded video (30 fps):
filesrc location=input.mp4 ! decodebin ! videoscale !
This works far from perfect. Often the phone struggles with the stream
encoding (or perhaps transmission) and I want to achieve at least "okayish"
framerates, decent latency and no choppiness for these low-resolution
I've tried replacing x264enc with the accelerated codec
"amcvidenc-omxgoogleh264encoder ! video/x-h264", but none of the caps I
tried with videoconvert seem to work. I only got:
only supports GL output but downstream does not
(Tested on an LG G6 with Qualcomm chips)