History

doc/encoders: Document mediacodec wrapper

Zhao Zhili committed 1 year ago

Commit e6fb8f31 parent 808c6851 file · +69 −0Browse files

Unified · Split

doc/encoders.texi+69−0
@@ -3342,6 +3342,75 @@ fastest. · 3341 unmodified lines
3342 3342
3343@end table3343@end table
3344 3344
3345@section MediaCodec
3346
3347MediaCodec encoder wrapper enables hardware-accelerated video encoding on
3348Android device. It supports H.264, H.265 (HEVC), VP8, VP9, MPEG-4, and AV1
3349encoding (whether works or not is device dependent).
3350
3351Android provides two sets of APIs: Java MediaCodec and NDK MediaCodec. The
3352MediaCodec encoder wrapper supports both. Note that the NDK MediaCodec API
3353operates without requiring JVM, but may fail to function outside the JVM
3354environment due to dependencies on system framework services, particularly
3355after Android 15.
3356
3357@table @option
3358@item ndk_codec @var{boolean}
3359Use the NDK-based MediaCodec API instead of the Java API. Enabled by default
3360if @code{av_jni_get_java_vm()} return NULL.
3361
3362@item ndk_async @var{boolean}
3363Use NDK MediaCodec in async mode. Async mode has less overhead than poll in a
3364loop in sync mode. The drawback of async mode is AV_CODEC_FLAG_GLOBAL_HEADER
3365doesn't work (use extract_extradata bsf when necessary). It doesn't work and
3366will be disabled automatically on devices below Android 8.0.
3367
3368@item codec_name @var{string}
3369A codec type can have multiple implementations on a single device, this option
3370specify which backend to use (via MediaCodec createCodecByName API). It's NULL
3371by default, and encoder is created by createEncoderByType.
3372
3373@item bitrate_mode @var{integer}
3374
3375Possible values:
3376@table @samp
3377@item cq
3378Constant quality mode
3379@item vbr
3380Variable bitrate mode
3381@item cbr
3382Constant bitrate mode
3383@item cbr_fd
3384Constant bitrate mode with frame drops
3385@end table
3386
3387@item pts_as_dts @var{boolean}
3388Use PTS as DTS. This is a workaround since MediaCodec API doesn't provide
3389decoding timestamp. It is enabled automatically if B frame is 0.
3390
3391@item operating_rate @var{integer}
3392The desired operating rate that the codec will need to operate at, zero for
3393unspecified. This is used for cases like high-speed/slow-motion video capture,
3394where the video encoder format contains the target playback rate (e.g. 30fps),
3395but the component must be able to handle the high operating capture rate (e.g.
3396240fps). This rate will be used by codec for resource planning and setting the
3397operating points.
3398
3399@item qp_i_min @var{integer}
3400Minimum quantization parameter for I frame.
3401@item qp_p_min @var{integer}
3402Minimum quantization parameter for P frame.
3403@item qp_b_min @var{integer}
3404Minimum quantization parameter for B frame.
3405@item qp_i_max @var{integer}
3406Maximum quantization parameter for I frame.
3407@item qp_p_max @var{integer}
3408Maximum quantization parameter for P frame.
3409@item qp_b_max @var{integer}
3410Maximum quantization parameter for B frame.
3411
3412@end table
3413
3345@section MediaFoundation3414@section MediaFoundation
3346 3415
3347This provides wrappers to encoders (both audio and video) in the3416This provides wrappers to encoders (both audio and video) in the

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t