java.lang.Object | |
↳ | com.ksyun.media.shortvideo.kit.MultiComposeBase |
![]() |
for compose multi files
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | MultiComposeBase.MediaContext |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
float | DEFAULT_IFRAME_INTERVAL | ||||||||||
int | DEFAULT_VIDEO_BIRATERATE |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected int | mAudioChannels | ||||||||||
protected int | mAudioDecodeMethod | ||||||||||
protected AudioMixer | mAudioMixer | ||||||||||
protected AVPtsFilter | mAudioPtsFilter | ||||||||||
protected Context | mContext | ||||||||||
protected int | mCount | ||||||||||
public FilePublisher.PubListener | mFilePublisherListener | ||||||||||
protected GLRender | mGLRender | ||||||||||
protected ImgTexFilterMgt | mImgTexFilterMgt | ||||||||||
protected ImgTexMixer | mImgTexMixer | ||||||||||
protected boolean | mInit | ||||||||||
protected Handler | mMainHandler | ||||||||||
protected List<MultiComposeBase.MediaContext> | mMediaContexts | ||||||||||
protected int | mScaleMode | ||||||||||
protected boolean | mStopped | ||||||||||
protected int | mVideoDecodeMethod | ||||||||||
protected AVPtsFilter | mVideoPtsFilter |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MultiComposeBase(Context context) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | getAudioBitrate() | ||||||||||
int | getAudioEncodeProfile() | ||||||||||
GLRender |
getGLRender()
Get
GLRender instance. | ||||||||||
ImgTexFilterMgt |
getImgTexFilterMgt()
Get ImgTexFilterMgt instance to manage GPU filters.
| ||||||||||
int | getVideoBitrate() | ||||||||||
int | getVideoCodecId() | ||||||||||
int | getVideoEncodeMethod() | ||||||||||
int | getVideoEncodeProfile() | ||||||||||
float | getVideoFps() | ||||||||||
void | release() | ||||||||||
void |
setAudioBitrate(int bitrate)
Set audio bitrate in bps.
| ||||||||||
void |
setAudioChannels(int channels)
Set audio channel number.
| ||||||||||
void |
setAudioDecodeMethod(int decodeMethod)
Set decode method for video.
| ||||||||||
void |
setAudioEncodeProfile(int profile)
Set audio encode profile.
| ||||||||||
void |
setAudioKBitrate(int kBitrate)
Set audio bitrate in kbps.
| ||||||||||
void |
setAudioSampleRate(int sampleRate)
Set audio sample rate while streaming.
| ||||||||||
void | setAudioVolume(int idx, float leftVolume, float rightVolume) | ||||||||||
void |
setDecodeMethod(int decodeMethod)
Set decode method for video and audio.
| ||||||||||
void |
setEnableMp4FastStart(boolean enable)
Run a second pass moving the index (moov atom) to the beginning of the mp4 file.
| ||||||||||
void |
setEncodeMethod(int encodeMethod)
Set encode method for both video and audio.
| ||||||||||
void | setIFrameInterval(float interval) | ||||||||||
void |
setOnBaseErrorListener(MultiComposeBase.OnErrorListener onErrorListener)
Set onErrorListener.
| ||||||||||
void |
setOnBaseInfoListener(MultiComposeBase.OnInfoListener onInfoListener)
Set OnInfoListener.
| ||||||||||
void |
setScaleMode(int scaleMode)
set scale mode
| ||||||||||
void |
setTargetResolution(int width, int height)
Set transcode target resolution.
| ||||||||||
void |
setVideoBitrate(int bitrate)
Set video bitrate in bps, and disable video bitrate auto adjustment.
| ||||||||||
void |
setVideoCodecId(int codecId)
Set codec id to video encoder.
| ||||||||||
void |
setVideoCrf(int crf)
set Constant Rate Factor
| ||||||||||
void |
setVideoDecodeMethod(int decodeMethod)
Set decode method for video.
| ||||||||||
void |
setVideoEncodeMethod(int encodeMethod)
Set encode method for video.
| ||||||||||
void |
setVideoEncodeProfile(int profile)
Set encode profile to video encoder.
| ||||||||||
void |
setVideoFps(float fps)
Sets video fps.
| ||||||||||
void |
setVideoKBitrate(int kBitrate)
Set video bitrate in kbps, and disable video bitrate auto adjustment.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | abort() | ||||||||||
void | config(MultiComposeBase.MediaContext context) | ||||||||||
void |
config(MultiComposeBase.MediaContext context, int index)
main MediaContext
| ||||||||||
MultiComposeBase.MediaContext | createMediaContext(boolean isMain) | ||||||||||
void | setAudioParams() | ||||||||||
boolean | startCompose(String desUrl, int checkAuthFeature) | ||||||||||
void |
stopCompose()
中止合成
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Get ImgTexFilterMgt instance to manage GPU filters.
Set audio bitrate in bps.
bitrate | audio bitrate in bps. |
---|
IllegalArgumentException |
---|
Set audio channel number.
default value : 1
channels | audio channel number, 1 for mono, 2 for stereo, 0 for input config. |
---|
IllegalArgumentException |
---|
Set decode method for video.
Must not be set while decoding.
decodeMethod | Decode method. |
---|
IllegalStateException | |
IllegalArgumentException | |
IllegalStateException |
Set audio encode profile.
profile | profile to set. |
---|
Set audio bitrate in kbps.
kBitrate | audio bitrate in kbps. |
---|
IllegalArgumentException |
---|
Set audio sample rate while streaming.
default value 44100
sampleRate | sample rate in Hz. |
---|
IllegalArgumentException |
---|
Set decode method for video and audio.
Must not be set while decoding.
decodeMethod | Decode method. |
---|
IllegalStateException | |
IllegalArgumentException | |
IllegalStateException |
Run a second pass moving the index (moov atom) to the beginning of the mp4 file.
This operation can take a while, and will not work in various situations such as fragmented output, thus it is not enabled by default.
enable | true to enable, false to disable |
---|
Set encode method for both video and audio.
Must not be set while encoding.
default value:ENCODE_METHOD_SOFTWARE
encodeMethod | Encode method. |
---|
IllegalStateException | |
IllegalArgumentException | |
IllegalStateException |
interval | I frame interval |
---|
Set onErrorListener.
onErrorListener | error callback |
---|
Set OnInfoListener.
onInfoListener | info callback |
---|
set scale mode
Set transcode target resolution.
The set resolution would take effect immediately if compose started.
The set width and height must not be 0 at same time. If one of the params is 0, the other would calculated by the actual preview view size to keep the ratio of the preview view.
width | streaming width. |
---|---|
height | streaming height. |
IllegalArgumentException |
---|
Set video bitrate in bps, and disable video bitrate auto adjustment.
bitrate | video bitrate in bps |
---|
IllegalArgumentException |
---|
Set codec id to video encoder.
codecId | video codec id to set. |
---|
IllegalArgumentException |
---|
set Constant Rate Factor
Set decode method for video.
Must not be set while decoding.
decodeMethod | Decode method. |
---|
IllegalStateException | |
IllegalArgumentException | |
IllegalStateException |
Set encode method for video.
Must not be set while encoding.
encodeMethod | Encode method. |
---|
IllegalStateException | |
IllegalArgumentException | |
IllegalStateException |
Set encode profile to video encoder.
Only valid in ENCODE_METHOD_SOFTWARE and ENCODE_METHOD_SOFTWARE_COMPAT mode.
profile | encode profile mode to be set, default value VideoEncodeFormat#ENCODE_PROFILE_LOW_POWER |
---|
Sets video fps.
fps | the fps |
---|
Set video bitrate in kbps, and disable video bitrate auto adjustment.
kBitrate | video bitrate in kbps |
---|
IllegalArgumentException |
---|
中止合成