MeiCam SDK For Android  3.14.0
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
com.meicam.sdk.NvsMediaFileConvertor Class Reference

MediaFileConvertor. More...

Classes

interface  MeidaFileConvertorCallback
 

Public Member Functions

 NvsMediaFileConvertor ()
 
void release ()
 Release convertor object. More...
 
boolean isReleased ()
 Whether released. More...
 
void setMeidaFileConvertorCallback (MeidaFileConvertorCallback callback, Handler hanlder)
 Set callback to convertor. More...
 
void setMeidaFileConvertorCallback (MeidaFileConvertorCallback callback, boolean postMainLoop)
 Sets callback to convertor. More...
 
long convertMeidaFile (String srcFile, String dstFile, boolean isReverseConvert, long fromPositon, long toPosition, Hashtable< String, Object > configurations)
 Start to convert file. More...
 
void cancelTask (long taskId)
 Cancel task. More...
 

Static Public Attributes

static final String CONVERTOR_AUDIO_CHANNEL_MAP = "convertor-audio-channel-map"
 set audio channel map, More...
 
convertor params

static final String CONVERTOR_CUSTOM_VIDEO_HEIGHT = "custom-video-height"
 Set custom video height, width will be automatic scaled to keep aspect ratio. type: int. More...
 
static final String CONVERTOR_CUSTOM_AUDIO_SAMPLE_RATE = "custom-audio-sample-rate"
 Set custom audio sample rate, type: int. More...
 
static final String CONVERTOR_NO_VIDEO = "convertor-no-video"
 only convert audio stream, type: bool More...
 
static final String CONVERTOR_NO_AUDIO = "convertor-no-audio"
 only convert video stream, type: bool More...
 
static final String CONVERTOR_CUSTOM_AUDIO_CHANNEL = "custom-audio-channel"
 Set custom audio channels, type: int. More...
 
static final String CONVERTOR_CUSTOM_AUDIO_PCM_FILE = "custom-audio-pcm-file"
 Set custom audio pcm file, type: bool. More...
 
static final String CONVERTOR_DETECTED_AUDIO_MUTE_FACTOR = "detected_audio_mute"
 Set threshold of mute audio, type: int. More...
 
static final String CONVERTOR_DISABLE_HARDWARE_VIDEO_DECODER = "disable_hardware_video_decoder"
 disable hardware decoder,type: bool More...
 
static final String CONVERTOR_CUSTOM_VIDEO_FRAME_RATE = "custom-video-frame-rate"
 Set custom video frame rate, type: int. More...
 
static final String CONVERTOR_MAX_CACHE_SIZE_IN_MEMORY = "max_cache_size_in_memory"
 max cache video frame buffer count in host memory,type: int More...
 
static final String CONVERTOR_REVERSE_AUDIO_STREAM = "convertor-reverse-audio"
 Reverse audio stream,type: bool. More...
 
static final String CONVERTOR_AUDIO_ENCODER_NAME = "audio encoder name"
 Assigned audio encoding format, amr-wb, mp3 is supported,type: string. More...
 
static final String CONVERTOR_BITRATE = "bitrate"
 convertor video bitrate in bps. type: int More...
 
static final String CONVERTOR_GOP_SIZE = "gopsize"
 convertor video GOP size, type: int More...
 
static final String CONVERTOR_AUDIO_BITRATE = "audio bitrate"
 convertor audio bitrate in bps. type:int More...
 
static final String CONVERTOR_ENABLE_HDR = "enable hdr"
 Enable HDR video convert if the video is HDR type: bool. More...
 
convertor error

static final int CONVERTOR_ERROR_CODE_NO_ERROR = 0
 no error More...
 
static final int CONVERTOR_ERROR_CODE_CANCEL = 1
 task is canceled More...
 
static final int CONVERTOR_ERROR_VIDEO_ENCODER_SETUP_ERROR = 2
 video encoder setup error More...
 
static final int CONVERTOR_ERROR_VIDEO_ENCODING_ERROR = 3
 video encoder error More...
 
static final int CONVERTOR_ERROR_VIDEO_DECODER_ERROR = 4
 video decoder setup error More...
 
static final int CONVERTOR_ERROR_VIDEO_DECODING_ERROR = 5
 video decode error More...
 
static final int CONVERTOR_ERROR_UNKNOWN = 65535
 

Protected Member Functions

void finalize () throws Throwable
 
void notifyProgress (final long taskId, final float progress)
 
void notifyFinish (final long taskId, final String srcFile, final String dstFile, final int errorCode)
 
void notifyAudioMuteRage (final long taskId, final long startPts, final long endPts)
 

Detailed Description

MediaFileConvertor.

Constructor & Destructor Documentation

◆ NvsMediaFileConvertor()

com.meicam.sdk.NvsMediaFileConvertor.NvsMediaFileConvertor ( )
inline

Member Function Documentation

◆ cancelTask()

void com.meicam.sdk.NvsMediaFileConvertor.cancelTask ( long  taskId)
inline

Cancel task.

Parameters
taskIdTask Id

◆ convertMeidaFile()

long com.meicam.sdk.NvsMediaFileConvertor.convertMeidaFile ( String  srcFile,
String  dstFile,
boolean  isReverseConvert,
long  fromPositon,
long  toPosition,
Hashtable< String, Object >  configurations 
)
inline

Start to convert file.

Parameters
srcFilesource file
dstFiledestination file
isReverseConvertreverse convert file
fromPositonstart time
toPositionend time
configurationsconvert params
Returns
Task ID

◆ finalize()

void com.meicam.sdk.NvsMediaFileConvertor.finalize ( ) throws Throwable
inlineprotected

◆ isReleased()

boolean com.meicam.sdk.NvsMediaFileConvertor.isReleased ( )
inline

Whether released.

Returns
Returns whether released

◆ notifyAudioMuteRage()

void com.meicam.sdk.NvsMediaFileConvertor.notifyAudioMuteRage ( final long  taskId,
final long  startPts,
final long  endPts 
)
inlineprotected

◆ notifyFinish()

void com.meicam.sdk.NvsMediaFileConvertor.notifyFinish ( final long  taskId,
final String  srcFile,
final String  dstFile,
final int  errorCode 
)
inlineprotected

◆ notifyProgress()

void com.meicam.sdk.NvsMediaFileConvertor.notifyProgress ( final long  taskId,
final float  progress 
)
inlineprotected

◆ release()

void com.meicam.sdk.NvsMediaFileConvertor.release ( )
inline

Release convertor object.

◆ setMeidaFileConvertorCallback() [1/2]

void com.meicam.sdk.NvsMediaFileConvertor.setMeidaFileConvertorCallback ( MeidaFileConvertorCallback  callback,
boolean  postMainLoop 
)
inline

Sets callback to convertor.

Parameters
callbackCallback interface
postMainLoopwhether to callback to main looper

◆ setMeidaFileConvertorCallback() [2/2]

void com.meicam.sdk.NvsMediaFileConvertor.setMeidaFileConvertorCallback ( MeidaFileConvertorCallback  callback,
Handler  hanlder 
)
inline

Set callback to convertor.

Parameters
callbackCallback interface
hanlderCallback to this handler,if null will callback to main looper

Member Data Documentation

◆ CONVERTOR_AUDIO_BITRATE

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_AUDIO_BITRATE = "audio bitrate"
static

convertor audio bitrate in bps. type:int

◆ CONVERTOR_AUDIO_CHANNEL_MAP

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_AUDIO_CHANNEL_MAP = "convertor-audio-channel-map"
static

set audio channel map,

set audio channel map, Currently, "left" and "right" are supported; the number of mapping tables must be consistent with the number of output channels For example, the mapping table is "'right ','left'", which means that the input right channel to the output left channel, and the input left channel to the output audio channel.

◆ CONVERTOR_AUDIO_ENCODER_NAME

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_AUDIO_ENCODER_NAME = "audio encoder name"
static

Assigned audio encoding format, amr-wb, mp3 is supported,type: string.

◆ CONVERTOR_BITRATE

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_BITRATE = "bitrate"
static

convertor video bitrate in bps. type: int

◆ CONVERTOR_CUSTOM_AUDIO_CHANNEL

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_CUSTOM_AUDIO_CHANNEL = "custom-audio-channel"
static

Set custom audio channels, type: int.

◆ CONVERTOR_CUSTOM_AUDIO_PCM_FILE

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_CUSTOM_AUDIO_PCM_FILE = "custom-audio-pcm-file"
static

Set custom audio pcm file, type: bool.

◆ CONVERTOR_CUSTOM_AUDIO_SAMPLE_RATE

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_CUSTOM_AUDIO_SAMPLE_RATE = "custom-audio-sample-rate"
static

Set custom audio sample rate, type: int.

◆ CONVERTOR_CUSTOM_VIDEO_FRAME_RATE

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_CUSTOM_VIDEO_FRAME_RATE = "custom-video-frame-rate"
static

Set custom video frame rate, type: int.

◆ CONVERTOR_CUSTOM_VIDEO_HEIGHT

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_CUSTOM_VIDEO_HEIGHT = "custom-video-height"
static

Set custom video height, width will be automatic scaled to keep aspect ratio. type: int.

◆ CONVERTOR_DETECTED_AUDIO_MUTE_FACTOR

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_DETECTED_AUDIO_MUTE_FACTOR = "detected_audio_mute"
static

Set threshold of mute audio, type: int.

◆ CONVERTOR_DISABLE_HARDWARE_VIDEO_DECODER

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_DISABLE_HARDWARE_VIDEO_DECODER = "disable_hardware_video_decoder"
static

disable hardware decoder,type: bool

◆ CONVERTOR_ENABLE_HDR

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_ENABLE_HDR = "enable hdr"
static

Enable HDR video convert if the video is HDR type: bool.

◆ CONVERTOR_ERROR_CODE_CANCEL

final int com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_ERROR_CODE_CANCEL = 1
static

task is canceled

◆ CONVERTOR_ERROR_CODE_NO_ERROR

final int com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_ERROR_CODE_NO_ERROR = 0
static

no error

◆ CONVERTOR_ERROR_UNKNOWN

final int com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_ERROR_UNKNOWN = 65535
static

task has unknown error

◆ CONVERTOR_ERROR_VIDEO_DECODER_ERROR

final int com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_ERROR_VIDEO_DECODER_ERROR = 4
static

video decoder setup error

◆ CONVERTOR_ERROR_VIDEO_DECODING_ERROR

final int com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_ERROR_VIDEO_DECODING_ERROR = 5
static

video decode error

◆ CONVERTOR_ERROR_VIDEO_ENCODER_SETUP_ERROR

final int com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_ERROR_VIDEO_ENCODER_SETUP_ERROR = 2
static

video encoder setup error

◆ CONVERTOR_ERROR_VIDEO_ENCODING_ERROR

final int com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_ERROR_VIDEO_ENCODING_ERROR = 3
static

video encoder error

◆ CONVERTOR_GOP_SIZE

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_GOP_SIZE = "gopsize"
static

convertor video GOP size, type: int

◆ CONVERTOR_MAX_CACHE_SIZE_IN_MEMORY

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_MAX_CACHE_SIZE_IN_MEMORY = "max_cache_size_in_memory"
static

max cache video frame buffer count in host memory,type: int

◆ CONVERTOR_NO_AUDIO

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_NO_AUDIO = "convertor-no-audio"
static

only convert video stream, type: bool

◆ CONVERTOR_NO_VIDEO

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_NO_VIDEO = "convertor-no-video"
static

only convert audio stream, type: bool

◆ CONVERTOR_REVERSE_AUDIO_STREAM

final String com.meicam.sdk.NvsMediaFileConvertor.CONVERTOR_REVERSE_AUDIO_STREAM = "convertor-reverse-audio"
static

Reverse audio stream,type: bool.


The documentation for this class was generated from the following file: