From: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org> To: ffmpeg-devel@ffmpeg.org Cc: Zhao Zhili <zhilizhao@tencent.com> Subject: [FFmpeg-devel] [PATCH 2/2] doc/encoders: Document mediacodec wrapper Date: Fri, 13 Jun 2025 19:43:38 +0800 Message-ID: <tencent_51813EAD56779C2AE01E5B3034ED80E23509@qq.com> (raw) From: Zhao Zhili <zhilizhao@tencent.com> --- 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".
next reply other threads:[~2025-06-13 11:44 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-06-13 11:43 Zhao Zhili [this message] 2025-06-15 7:37 ` Marth64
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=tencent_51813EAD56779C2AE01E5B3034ED80E23509@qq.com \ --to=quinkblack-at-foxmail.com@ffmpeg.org \ --cc=ffmpeg-devel@ffmpeg.org \ --cc=zhilizhao@tencent.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git