From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 0D0214EACE for ; Fri, 13 Jun 2025 11:44:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 1508568C633; Fri, 13 Jun 2025 14:43:54 +0300 (EEST) Received: from out162-62-57-252.mail.qq.com (out162-62-57-252.mail.qq.com [162.62.57.252]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 7D41C68C488 for ; Fri, 13 Jun 2025 14:43:47 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1749815020; bh=2cDeCMRe/rmSK1VZj9iJNPHPHe3tcVGcnY25w6sloZg=; h=From:To:Cc:Subject:Date; b=yYwTNvJ+yQf+iAJqiYkTn9zHpCRNq402yR6RKYeu7hxLdXTrfln+91XGBQfa/jNfs DBNmTuTuTIJvu3vF709CvJi2NxI2gGgswcFsvNM4sQja2toV5CAtBKiJJpPk0mh90k xFA7ikN2jXIIHoxMjKSNQ3K8uOQB4cns4WqzP+5U= Received: from localhost.localdomain ([119.147.10.242]) by newxmesmtplogicsvrszgpuc5-0.qq.com (NewEsmtp) with SMTP id AE6B2A36; Fri, 13 Jun 2025 19:43:38 +0800 X-QQ-mid: xmsmtpt1749815018tw36o7v50 Message-ID: X-QQ-XMAILINFO: MS1AjjpKGz7zGDEdtfAdhmlmpIgnrVuyBESyJT773xSxoVyNddJq8wVRrGE5t4 bHhDzqAj6+/WSgFEdqpBm03jASutqdEGli+qRGC3KPvFYjO6y3FVT0NYBlCVh6D6tX0bsqbE8IOg 3+yvf3ryJ5Q1m2ALcODTe7jgepb9OTdCmew3Tb/QijBdE6SUkVO5iyGdoG2jRqk5UThPbIv1wg3w 2mWA9uVRRyryK1s0AP2ILeG6Vxh8fo3U6UOB7dbG/eQKkHT6fueCaAXhoRsX+Vym+TzRGpFZKzyV 9cezbj9zgG30nY4RNrPLu0q6wwhlJPsWBxieioJhSKful3nwsLwxXNm9991yaYPPbwTQ/WuoViea EFtcX8cAzfcXSQK6q9RJ5tTmwX9ssEzfhOx3cC4D3LkjX+hQoLhsBa+xIVut/e10asWDXylniYVg cn/PppuUEK5jFI/sQFboet1BNUTvBI5VO2oqvPbvdEnWlecFYU8axpbMTT2Oziua17lBn4i0HfB4 gxV9erwlPBGHAxC5+vNPiDOjHPcCPoIXKjztcNKdyZHzuRZNrw3ToJvH6H/ppaUCu6Kx6cL9SXWn COTdBTkgJPIIHSI9CInIB33weQkUGCpg3G8BmEDhzICoFHzT0FDlseqXud1/Kuq497/c3SotUpWu 4dpgeuwsn6Hpq0m5ykkigpnct5sYF0UOF3xODssbTN0dBDyCX1LTQKkYyZ4ohZsrJxo6P6vQs7A4 304IupfRNCLLPL3Zm819qo2Z2kCcn9CjLHsg1Lz66v8o62r1pUZzR+3EQ5OwdwccHn3742+0Sbwv LBwgq9bpF7jxsF7mS+PXftm6bjXu+hyXlZFpxK6WFzn+c0q2AKTRAKIvtmU8Rn/tRNa5DmIW1Wc4 kqaMI31gmAU4HfTUwyzGxN4Cd4nr1BUkqnnR3lgM6xAmkYMYhz/35KnRlaLzYm8Gl6e4GDl3BOKb QpwgTjnqm9t28vC4V8V6mjguzUxFliGwiFMyvzQnXVc9t1ddbJzCxnIOhWQ0X2il2BWZIsmqI= X-QQ-XMRINFO: Nq+8W0+stu50PRdwbJxPCL0= From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Fri, 13 Jun 2025 19:43:38 +0800 X-OQ-MSGID: <20250613114338.4231-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] doc/encoders: Document mediacodec wrapper X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Zhao Zhili Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Zhao Zhili --- doc/encoders.texi | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/doc/encoders.texi b/doc/encoders.texi index f6f6c096ec..5595e57038 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -3342,6 +3342,75 @@ fastest. @end table +@section MediaCodec + +MediaCodec encoder wrapper enables hardware-accelerated video encoding on +Android device. It supports H.264, H.265 (HEVC), VP8, VP9, MPEG-4, and AV1 +encoding (whether works or not is device dependent). + +Android provides two sets of APIs: Java MediaCodec and NDK MediaCodec. The +MediaCodec encoder wrapper supports both. Note that the NDK MediaCodec API +operates without requiring JVM, but may fail to function outside the JVM +environment due to dependencies on system framework services, particularly +after Android 15. + +@table @option +@item ndk_codec @var{boolean} +Use the NDK-based MediaCodec API instead of the Java API. Enabled by default +if @code{av_jni_get_java_vm()} return NULL. + +@item ndk_async @var{boolean} +Use NDK MediaCodec in async mode. Async mode has less overhead than poll in a +loop in sync mode. The drawback of async mode is AV_CODEC_FLAG_GLOBAL_HEADER +doesn't work (use extract_extradata bsf when necessary). It doesn't work and +will be disabled automatically on devices below Android 8.0. + +@item codec_name @var{string} +A codec type can have multiple implementations on a single device, this option +specify which backend to use (via MediaCodec createCodecByName API). It's NULL +by default, and encoder is created by createEncoderByType. + +@item bitrate_mode @var{integer} + +Possible values: +@table @samp +@item cq +Constant quality mode +@item vbr +Variable bitrate mode +@item cbr +Constant bitrate mode +@item cbr_fd +Constant bitrate mode with frame drops +@end table + +@item pts_as_dts @var{boolean} +Use PTS as DTS. This is a workaround since MediaCodec API doesn't provide +decoding timestamp. It is enabled automatically if B frame is 0. + +@item operating_rate @var{integer} +The desired operating rate that the codec will need to operate at, zero for +unspecified. This is used for cases like high-speed/slow-motion video capture, +where the video encoder format contains the target playback rate (e.g. 30fps), +but the component must be able to handle the high operating capture rate (e.g. +240fps). This rate will be used by codec for resource planning and setting the +operating points. + +@item qp_i_min @var{integer} +Minimum quantization parameter for I frame. +@item qp_p_min @var{integer} +Minimum quantization parameter for P frame. +@item qp_b_min @var{integer} +Minimum quantization parameter for B frame. +@item qp_i_max @var{integer} +Maximum quantization parameter for I frame. +@item qp_p_max @var{integer} +Maximum quantization parameter for P frame. +@item qp_b_max @var{integer} +Maximum quantization parameter for B frame. + +@end table + @section MediaFoundation This provides wrappers to encoders (both audio and video) in the -- 2.46.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".