Class MediaDecoder
java.lang.Object
javaforce.media.MediaCoder
javaforce.media.MediaFormat
javaforce.media.MediaDecoder
Media Decoder.
TODO : deprecate class
New code should use MediaInput instead.
- Author:
- pquiring
-
Field Summary
Fields inherited from class javaforce.media.MediaCoder
AUDIO_FRAME, AV_CODEC_ID_AAC, AV_CODEC_ID_AC3, AV_CODEC_ID_DEFAULT, AV_CODEC_ID_FLAC, AV_CODEC_ID_GSM_MS, AV_CODEC_ID_H263, AV_CODEC_ID_H264, AV_CODEC_ID_H265, AV_CODEC_ID_MP2, AV_CODEC_ID_MP3, AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_MPEG4, AV_CODEC_ID_NONE, AV_CODEC_ID_OPUS, AV_CODEC_ID_PCM_S16LE, AV_CODEC_ID_SPEEX, AV_CODEC_ID_THEORA, AV_CODEC_ID_VORBIS, AV_CODEC_ID_VP8, AV_CODEC_ID_VP9, AV_FORMAT_ID_AVI, AV_FORMAT_ID_MKV, AV_FORMAT_ID_MOV, AV_FORMAT_ID_MP1, AV_FORMAT_ID_MP2, AV_FORMAT_ID_MP4, AV_FORMAT_ID_OGG, AV_FORMAT_ID_WAV, AV_FORMAT_ID_WEBM, ctx, END_FRAME, NULL_FRAME, PROFILE_BASELINE, PROFILE_HIGH, PROFILE_MAIN, SEEK_CUR, SEEK_END, SEEK_SET, shared, VIDEO_FRAME -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class javaforce.media.MediaFormat
getAudioCodecID, getAudioStream, getVideoCodecID, getVideoStreamMethods inherited from class javaforce.media.MediaCoder
getStream, init, isRunning, setLogging, setStream
-
Constructor Details
-
MediaDecoder
public MediaDecoder()
-
-
Method Details
-
start
public boolean start(MediaIO io, int new_width, int new_height, int new_chs, int new_freq, boolean seekable) Starts decoder.- Parameters:
io- = MediaIO interfacenew_width- = change video width during decoding (-1 = no change)new_height- = change video height during decoding (-1 = no change)new_chs- = change audio channels during decoding (-1 = no change)new_freq- = change audio frequency during decoding (-1 = no change)seekable- = do you need to seek position during playback?
-
startFile
public boolean startFile(String file, String format, int new_width, int new_height, int new_chs, int new_freq) Starts decoder.- Parameters:
file- = file to write to.format- = format of file (see MediaCoder.AV_FORMAT_...) (NULL = auto detect)new_width- = change video width during decoding (-1 = no change)new_height- = change video height during decoding (-1 = no change)new_chs- = change audio channels during decoding (-1 = no change)new_freq- = change audio frequency during decoding (-1 = no change)
-
stop
public void stop() -
read
public int read() -
getVideo
public int[] getVideo() -
getAudio
public short[] getAudio() -
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getFrameRate
public float getFrameRate() -
getDuration
public long getDuration() -
getSampleRate
public int getSampleRate() -
getChannels
public int getChannels() -
getBitsPerSample
public int getBitsPerSample() -
seek
public boolean seek(long seconds) -
getVideoBitRate
public int getVideoBitRate()- Overrides:
getVideoBitRatein classMediaFormat
-
getAudioBitRate
public int getAudioBitRate()- Overrides:
getAudioBitRatein classMediaFormat
-
isKeyFrame
public boolean isKeyFrame() -
resize
public boolean resize(int newWidth, int newHeight)
-