x264enc on android: very slow.

Nicolas Dufresne nicolas.dufresne at collabora.com
Mon Jul 29 04:14:09 PDT 2013

Le lundi 29 juillet 2013 à 16:18 +0800, Haiming Wang a écrit :
>    data->pipeline = gst_parse_launch("gstrtpbin name=rtpbin appsrc
> block=true is-live=true name=app_src ! video/x-raw-yuv,
> format=(fourcc)NV21, width=(int)320, height=(int)240,
> framerate=(fraction)15/1 ! ffmpegcolorspace ! x264enc tune=zerolatency
> byte-stream=true bitrate=300 ! rtph264pay ! rtpbin.send_rtp_sink_0
> rtpbin.send_rtp_src_0 ! udpsink name=udp_sink
> clients=", &error);

There is multiple ways this pipeline can be slow. Using profiling tool
would be very useful. Meanwhile, I'm worried about the colorspace
conversion, x264enc accept I420 and you send NV21. The direct conversion
for that format was added upstream 0.10, but never released, so it is
likely that you don't have this in your build.

Other then that, you should consider using simpler profile, by default
x264 produce main profile, try contrained-baseline. Finally, using a
sofware encoder on Android is a little strange, any ready not to use the
HW encoder ?


More information about the gstreamer-devel mailing list