Package net.sf.ffmpeg_java
Interface AVFormatLibrary
- All Superinterfaces:
FFMPEGLibrary,com.sun.jna.Library
Based on FFMPEG Aug 12 2007. From avformat.h, avio.h
- Author:
- Ken Larson
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classstatic classstatic classinvalid input: '<' full parsing and interpolation of timestamps for frames not starting on packet boundarystatic classstatic classinvalid input: '<' use generic index building codestatic classstatic classstatic classthis structure contains the data a format has to probe a filestatic classstatic classstatic interfacestatic interfacestatic classstatic interfacestatic classstatic classstatic interfacestatic interfacestatic interfaceNested classes/interfaces inherited from interface net.sf.ffmpeg_java.FFMPEGLibrary
FFMPEGLibrary.AVClass, FFMPEGLibrary.AVRationalNested classes/interfaces inherited from interface com.sun.jna.Library
com.sun.jna.Library.Handler -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intinvalid input: '<' format does not need / have any timestampsstatic final intinvalid input: '<' format wants AVPicture structure for raw picture datastatic final intstatic final intstatic final intinvalid input: '<' format wants global headerstatic final intinvalid input: '<' show format stream IDs numbersstatic final intinvalid input: '<' needs '%d' in filenamestatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intinvalid input: '<' full parsing and repackstatic final intstatic final intinvalid input: '<' only parse headers, don't repackstatic final intstatic final AVFormatLibrarystatic final intstatic final Stringstatic final Stringstatic final intstatic final intinvalid input: '<' signal that no header is present (streams are added dynamically)static final intstatic final intstatic final intstatic final intstatic final intFields inherited from interface net.sf.ffmpeg_java.FFMPEGLibrary
PIX_FMT_BGR24, PIX_FMT_BGR32, PIX_FMT_BGR32_1, PIX_FMT_BGR4, PIX_FMT_BGR4_BYTE, PIX_FMT_BGR555, PIX_FMT_BGR565, PIX_FMT_BGR8, PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE, PIX_FMT_GRAY8, PIX_FMT_MONOBLACK, PIX_FMT_MONOWHITE, PIX_FMT_NB, PIX_FMT_NONE, PIX_FMT_NV12, PIX_FMT_NV21, PIX_FMT_PAL8, PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_RGB32_1, PIX_FMT_RGB4, PIX_FMT_RGB4_BYTE, PIX_FMT_RGB555, PIX_FMT_RGB565, PIX_FMT_RGB8, PIX_FMT_UYVY422, PIX_FMT_UYYVYY411, PIX_FMT_XVMC_MPEG2_IDCT, PIX_FMT_XVMC_MPEG2_MC, PIX_FMT_YUV410P, PIX_FMT_YUV411P, PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV440P, PIX_FMT_YUV444P, PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ440P, PIX_FMT_YUVJ444P, PIX_FMT_YUYV422Fields inherited from interface com.sun.jna.Library
OPTION_FUNCTION_MAPPER, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER -
Method Summary
Modifier and TypeMethodDescriptionintav_add_index_entry(AVFormatLibrary.AVStream st, long pos, long timestamp, int size, int distance, int flags) voidintav_codec_get_id(com.sun.jna.ptr.PointerByReference tags, int tag) intav_codec_get_tag(com.sun.jna.ptr.PointerByReference tags, int id) voidvoidintintav_filename_number_test(String filename) intav_find_input_format(String short_name) intvoidlongav_gen_search(AVFormatLibrary.AVFormatContext s, int stream_index, long target_ts, long pos_min, long pos_max, long pos_limit, long ts_min, long ts_max, int flags, com.sun.jna.ptr.LongByReference ts_ret, com.sun.jna.Pointer read_timestamp) intav_get_frame_filename(com.sun.jna.Pointer buf, int buf_size, String path, int number) intav_get_packet(AVFormatLibrary.ByteIOContext s, AVFormatLibrary.AVPacket pkt, int size) longintav_guess_codec(AVFormatLibrary.AVOutputFormat fmt, String short_name, String filename, String mime_type, int type) intav_guess_image2_codec(String filename) voidav_hex_dump(com.sun.jna.Pointer f, com.sun.jna.Pointer buf, int size) voidav_hex_dump_log(com.sun.jna.Pointer avcl, int level, com.sun.jna.Pointer buf, int size) intav_index_search_timestamp(AVFormatLibrary.AVStream st, long timestamp, int flags) voidintav_interleave_packet_per_dts(AVFormatLibrary.AVFormatContext s, AVFormatLibrary.AVPacket out, AVFormatLibrary.AVPacket pkt, int flush) intintav_new_packet(AVFormatLibrary.AVPacket pkt, int size) av_new_stream(AVFormatLibrary.AVFormatContext s, int id) intav_open_input_file(com.sun.jna.ptr.PointerByReference ic_ptr, String filename, AVFormatLibrary.AVInputFormat fmt, int buf_size, AVFormatLibrary.AVFormatParameters ap) Open a media file as input.intav_open_input_stream(com.sun.jna.ptr.PointerByReference ic_ptr, AVFormatLibrary.ByteIOContext pb, String filename, AVFormatLibrary.AVInputFormat fmt, AVFormatLibrary.AVFormatParameters ap) Allocates all the structures needed to read an input stream.voidav_pkt_dump(com.sun.jna.Pointer f, AVFormatLibrary.AVPacket pkt, int dump_payload) voidav_pkt_dump_log(com.sun.jna.Pointer avcl, int level, AVFormatLibrary.AVPacket pkt, int dump_payload) av_probe_input_format(AVFormatLibrary.AVProbeData pd, int is_opened) intReturn the next frame of a stream.intintPause a network based stream (e.g.intstart playing a network based stream (e.g.voidvoidvoidintav_seek_frame(AVFormatLibrary.AVFormatContext s, int stream_index, long timestamp, int flags) Seek to the key frame at timestamp.intav_seek_frame_binary(AVFormatLibrary.AVFormatContext s, int stream_index, long target_ts, int flags) intvoidav_set_pts_info(AVFormatLibrary.AVStream s, int pts_wrap_bits, int pts_num, int pts_den) voidav_update_cur_dts(AVFormatLibrary.AVFormatContext s, AVFormatLibrary.AVStream ref_st, long timestamp) intintintintavf_sdp_create(com.sun.jna.Pointer ac, int n_files, com.sun.jna.Pointer buff, int size) voiddump_format(AVFormatLibrary.AVFormatContext ic, int index, String url, int is_output) longffm_read_write_index(int fd) voidffm_set_write_index(AVFormatLibrary.AVFormatContext s, long pos, long file_size) voidffm_write_write_index(int fd, long pos) intfind_info_tag(com.sun.jna.Pointer arg, int arg_size, String tag1, String info) intintintlongintget_buffer(AVFormatLibrary.ByteIOContext s, com.sun.jna.Pointer buf, int size) intnote return 0 if EOF, so you cannot use it if EOF handling is necessarycom.sun.jna.NativeLongintintintlongintget_partial_buffer(AVFormatLibrary.ByteIOContext s, com.sun.jna.Pointer buf, int size) com.sun.jna.Pointerget_strz(AVFormatLibrary.ByteIOContext s, com.sun.jna.Pointer buf, int maxlen) guess_format(String short_name, String filename, String mime_type) guess_stream_format(String short_name, String filename, String mime_type) voidinit_checksum(AVFormatLibrary.ByteIOContext s, com.sun.jna.Pointer update_checksum, com.sun.jna.NativeLong checksum) intinit_put_byte(com.sun.jna.Pointer s, com.sun.jna.Pointer buffer, int buffer_size, int write_flag, com.sun.jna.Pointer opaque, com.sun.jna.Pointer read_packet, com.sun.jna.Pointer write_packet, com.sun.jna.Pointer seek) intlongparse_date(String datestr, int duration) intparse_frame_rate(com.sun.jna.ptr.IntByReference frame_rate, com.sun.jna.ptr.IntByReference frame_rate_base, String arg) Deprecated.intparse_image_size(com.sun.jna.ptr.IntByReference width_ptr, com.sun.jna.ptr.IntByReference height_ptr, String str) Deprecated.voidput_be16(AVFormatLibrary.ByteIOContext s, int val) voidput_be24(AVFormatLibrary.ByteIOContext s, int val) voidput_be32(AVFormatLibrary.ByteIOContext s, int val) voidput_be64(AVFormatLibrary.ByteIOContext s, long val) voidput_buffer(AVFormatLibrary.ByteIOContext s, com.sun.jna.Pointer buf, int size) voidput_byte(AVFormatLibrary.ByteIOContext s, int b) voidvoidput_le16(AVFormatLibrary.ByteIOContext s, int val) voidput_le24(AVFormatLibrary.ByteIOContext s, int val) voidput_le32(AVFormatLibrary.ByteIOContext s, int val) voidput_le64(AVFormatLibrary.ByteIOContext s, long val) voidvoidintregister_protocol(AVFormatLibrary.URLProtocol protocol) intresolve_host(com.sun.jna.Pointer sin_addr, String hostname) small_strptime(String p, String fmt, com.sun.jna.Pointer dt) intintintintintreturn the written or read sizeinturl_close_dyn_buf(AVFormatLibrary.ByteIOContext s, com.sun.jna.ptr.PointerByReference pbuffer) Return the written size and a pointer to the buffer.intintinturl_fdopen(AVFormatLibrary.ByteIOContext s, com.sun.jna.Pointer h) intintinturl_fget_max_packet_size(com.sun.jna.Pointer s) Return the maximum packet size associated to packetized buffered file handle.intcom.sun.jna.Pointerurl_fgets(AVFormatLibrary.ByteIOContext s, com.sun.jna.Pointer buf, int buf_size) note unlike fgets, the EOL character is not returned and a whole line is parsed.longinturl_fopen(AVFormatLibrary.ByteIOContext s, String filename, int flags) note when opened as read/write, the buffers are only used for readinglongurl_fseek(AVFormatLibrary.ByteIOContext s, long offset, int whence) longvoidurl_fskip(AVFormatLibrary.ByteIOContext s, long offset) longvoidurl_get_filename(AVFormatLibrary.URLContext h, com.sun.jna.Pointer buf, int buf_size) intintinturl_open_buf(AVFormatLibrary.ByteIOContext s, com.sun.jna.Pointer buf, int buf_size, int flags) intOpen a write only memory stream.inturl_open_dyn_packet_buf(AVFormatLibrary.ByteIOContext s, int max_packet_size) Open a write only packetized memory stream with a maximum packet size of 'max_packet_size'.inturl_poll(AVFormatLibrary.URLPollEntry poll_table, int n, int timeout) inturl_read(AVFormatLibrary.URLContext h, com.sun.jna.Pointer buf, int size) longurl_seek(AVFormatLibrary.URLContext h, long pos, int whence) voidurl_set_interrupt_cb(com.sun.jna.Pointer interrupt_cb) inturl_setbufsize(AVFormatLibrary.ByteIOContext s, int buf_size) warning must be called before any I/Ovoidurl_split(com.sun.jna.Pointer proto, int proto_size, com.sun.jna.Pointer authorization, int authorization_size, com.sun.jna.Pointer hostname, int hostname_size, com.sun.jna.ptr.IntByReference port_ptr, com.sun.jna.Pointer path, int path_size, String url) inturl_write(AVFormatLibrary.URLContext h, com.sun.jna.Pointer buf, int size)
-
Field Details
-
INSTANCE
-
LIBAVFORMAT_VERSION_INT
static final int LIBAVFORMAT_VERSION_INT- See Also:
-
LIBAVFORMAT_VERSION
- See Also:
-
LIBAVFORMAT_BUILD
static final int LIBAVFORMAT_BUILD- See Also:
-
LIBAVFORMAT_IDENT
- See Also:
-
PKT_FLAG_KEY
static final int PKT_FLAG_KEY- See Also:
-
AVPROBE_SCORE_MAX
static final int AVPROBE_SCORE_MAX- See Also:
-
AVPROBE_PADDING_SIZE
static final int AVPROBE_PADDING_SIZE- See Also:
-
AVFMT_NOFILE
static final int AVFMT_NOFILE- See Also:
-
AVFMT_NEEDNUMBER
static final int AVFMT_NEEDNUMBER- See Also:
-
AVFMT_SHOW_IDS
static final int AVFMT_SHOW_IDSinvalid input: '<' needs '%d' in filename- See Also:
-
AVFMT_RAWPICTURE
static final int AVFMT_RAWPICTUREinvalid input: '<' show format stream IDs numbers- See Also:
-
AVFMT_GLOBALHEADER
static final int AVFMT_GLOBALHEADERinvalid input: '<' format wants AVPicture structure for raw picture data- See Also:
-
AVFMT_NOTIMESTAMPS
static final int AVFMT_NOTIMESTAMPSinvalid input: '<' format wants global header- See Also:
-
AVFMT_GENERIC_INDEX
static final int AVFMT_GENERIC_INDEXinvalid input: '<' format does not need / have any timestamps- See Also:
-
AVSTREAM_PARSE_NONE
static final int AVSTREAM_PARSE_NONE- See Also:
-
AVSTREAM_PARSE_FULL
static final int AVSTREAM_PARSE_FULL- See Also:
-
AVSTREAM_PARSE_HEADERS
static final int AVSTREAM_PARSE_HEADERSinvalid input: '<' full parsing and repack- See Also:
-
AVSTREAM_PARSE_TIMESTAMPS
static final int AVSTREAM_PARSE_TIMESTAMPSinvalid input: '<' only parse headers, don't repack- See Also:
-
AVFMTCTX_NOHEADER
static final int AVFMTCTX_NOHEADER- See Also:
-
MAX_STREAMS
static final int MAX_STREAMSinvalid input: '<' signal that no header is present (streams are added dynamically)- See Also:
-
AVSEEK_FLAG_BACKWARD
static final int AVSEEK_FLAG_BACKWARD- See Also:
-
AVSEEK_FLAG_BYTE
static final int AVSEEK_FLAG_BYTE- See Also:
-
AVSEEK_FLAG_ANY
static final int AVSEEK_FLAG_ANY- See Also:
-
FFM_PACKET_SIZE
static final int FFM_PACKET_SIZE- See Also:
-
URL_RDONLY
static final int URL_RDONLY- See Also:
-
URL_WRONLY
static final int URL_WRONLY- See Also:
-
URL_RDWR
static final int URL_RDWR- See Also:
-
AVSEEK_SIZE
static final int AVSEEK_SIZE- See Also:
-
URL_EOF
static final int URL_EOF- See Also:
-
-
Method Details
-
av_destruct_packet_nofree
-
av_destruct_packet
-
av_init_packet
-
av_new_packet
-
av_get_packet
-
av_dup_packet
-
av_free_packet
-
av_guess_image2_codec
-
av_register_input_format
-
av_register_output_format
-
guess_stream_format
AVFormatLibrary.AVOutputFormat guess_stream_format(String short_name, String filename, String mime_type) -
guess_format
-
av_guess_codec
int av_guess_codec(AVFormatLibrary.AVOutputFormat fmt, String short_name, String filename, String mime_type, int type) -
av_hex_dump
void av_hex_dump(com.sun.jna.Pointer f, com.sun.jna.Pointer buf, int size) -
av_hex_dump_log
void av_hex_dump_log(com.sun.jna.Pointer avcl, int level, com.sun.jna.Pointer buf, int size) -
av_pkt_dump
-
av_pkt_dump_log
void av_pkt_dump_log(com.sun.jna.Pointer avcl, int level, AVFormatLibrary.AVPacket pkt, int dump_payload) -
av_register_all
void av_register_all() -
av_codec_get_id
int av_codec_get_id(com.sun.jna.ptr.PointerByReference tags, int tag) -
av_codec_get_tag
int av_codec_get_tag(com.sun.jna.ptr.PointerByReference tags, int id) -
av_find_input_format
-
av_probe_input_format
-
av_open_input_stream
int av_open_input_stream(com.sun.jna.ptr.PointerByReference ic_ptr, AVFormatLibrary.ByteIOContext pb, String filename, AVFormatLibrary.AVInputFormat fmt, AVFormatLibrary.AVFormatParameters ap) Allocates all the structures needed to read an input stream. This does not open the needed codecs for decoding the stream[s]. -
av_open_input_file
int av_open_input_file(com.sun.jna.ptr.PointerByReference ic_ptr, String filename, AVFormatLibrary.AVInputFormat fmt, int buf_size, AVFormatLibrary.AVFormatParameters ap) Open a media file as input. The codecs are not opened. Only the file header (if present) is read.- Parameters:
ic_ptr- the opened media file handle is put herefilename- filename to open.fmt- if non NULL, force the file format to usebuf_size- optional buffer size (zero if default is OK)ap- additional parameters needed when opening the file (NULL if default)- Returns:
- 0 if OK. AVERROR_xxx otherwise.
-
av_alloc_format_context
AVFormatLibrary.AVFormatContext av_alloc_format_context() -
av_find_stream_info
-
av_read_packet
-
av_read_frame
Return the next frame of a stream. The returned packet is valid until the next av_read_frame() or until av_close_input_file() and must be freed with av_free_packet. For video, the packet contains exactly one frame. For audio, it contains an integer number of frames if each frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames have a variable size (e.g. MPEG audio), then it contains one frame. pkt->pts, pkt->dts and pkt->duration are always set to correct values in AVStream.timebase units (and guessed if the format cannot provided them). pkt->pts can be AV_NOPTS_VALUE if the video format has B frames, so it is better to rely on pkt->dts if you do not decompress the payload.- Returns:
- 0 if OK, invalid input: '<' 0 if error or end of file.
-
av_seek_frame
Seek to the key frame at timestamp. 'timestamp' in 'stream_index'.- Parameters:
stream_index- If stream_index is (-1), a default stream is selected, and timestamp is automatically converted from AV_TIME_BASE units to the stream specific time_base.timestamp- timestamp in AVStream.time_base units or if there is no stream specified then in AV_TIME_BASE unitsflags- flags which select direction and seeking mode- Returns:
- >= 0 on success
-
av_read_play
start playing a network based stream (e.g. RTSP stream) at the current position -
av_read_pause
Pause a network based stream (e.g. RTSP stream). Use av_read_play() to resume it. -
av_close_input_file
-
av_new_stream
-
av_set_pts_info
-
av_find_default_stream_index
-
av_index_search_timestamp
-
av_add_index_entry
int av_add_index_entry(AVFormatLibrary.AVStream st, long pos, long timestamp, int size, int distance, int flags) -
av_seek_frame_binary
int av_seek_frame_binary(AVFormatLibrary.AVFormatContext s, int stream_index, long target_ts, int flags) -
av_update_cur_dts
void av_update_cur_dts(AVFormatLibrary.AVFormatContext s, AVFormatLibrary.AVStream ref_st, long timestamp) -
av_gen_search
long av_gen_search(AVFormatLibrary.AVFormatContext s, int stream_index, long target_ts, long pos_min, long pos_max, long pos_limit, long ts_min, long ts_max, int flags, com.sun.jna.ptr.LongByReference ts_ret, com.sun.jna.Pointer read_timestamp) -
av_set_parameters
-
av_write_header
-
av_write_frame
-
av_interleaved_write_frame
-
av_interleave_packet_per_dts
int av_interleave_packet_per_dts(AVFormatLibrary.AVFormatContext s, AVFormatLibrary.AVPacket out, AVFormatLibrary.AVPacket pkt, int flush) -
av_write_trailer
-
dump_format
-
parse_image_size
int parse_image_size(com.sun.jna.ptr.IntByReference width_ptr, com.sun.jna.ptr.IntByReference height_ptr, String str) Deprecated. -
parse_frame_rate
int parse_frame_rate(com.sun.jna.ptr.IntByReference frame_rate, com.sun.jna.ptr.IntByReference frame_rate_base, String arg) Deprecated. -
parse_date
-
av_gettime
long av_gettime() -
ffm_read_write_index
long ffm_read_write_index(int fd) -
ffm_write_write_index
void ffm_write_write_index(int fd, long pos) -
ffm_set_write_index
-
find_info_tag
-
av_get_frame_filename
-
av_filename_number_test
-
avf_sdp_create
int avf_sdp_create(com.sun.jna.Pointer ac, int n_files, com.sun.jna.Pointer buff, int size) -
small_strptime
-
resolve_host
-
url_split
void url_split(com.sun.jna.Pointer proto, int proto_size, com.sun.jna.Pointer authorization, int authorization_size, com.sun.jna.Pointer hostname, int hostname_size, com.sun.jna.ptr.IntByReference port_ptr, com.sun.jna.Pointer path, int path_size, String url) -
match_ext
-
url_open
-
url_read
-
url_write
-
url_seek
-
url_close
-
url_exist
-
url_filesize
-
url_get_max_packet_size
-
url_get_filename
-
url_set_interrupt_cb
void url_set_interrupt_cb(com.sun.jna.Pointer interrupt_cb) -
url_poll
-
register_protocol
-
init_put_byte
int init_put_byte(com.sun.jna.Pointer s, com.sun.jna.Pointer buffer, int buffer_size, int write_flag, com.sun.jna.Pointer opaque, com.sun.jna.Pointer read_packet, com.sun.jna.Pointer write_packet, com.sun.jna.Pointer seek) -
put_byte
-
put_buffer
-
put_le64
-
put_be64
-
put_le32
-
put_be32
-
put_le24
-
put_be24
-
put_le16
-
put_be16
-
put_tag
-
put_strz
-
url_fseek
-
url_fskip
-
url_ftell
-
url_fsize
-
url_feof
-
url_ferror
-
url_fgetc
-
url_fgets
com.sun.jna.Pointer url_fgets(AVFormatLibrary.ByteIOContext s, com.sun.jna.Pointer buf, int buf_size) note unlike fgets, the EOL character is not returned and a whole line is parsed. return NULL if first char read was EOF -
put_flush_packet
-
get_buffer
-
get_partial_buffer
-
get_byte
note return 0 if EOF, so you cannot use it if EOF handling is necessary -
get_le24
-
get_le32
-
get_le64
-
get_le16
-
get_strz
-
get_be16
-
get_be24
-
get_be32
-
get_be64
-
url_fdopen
-
url_setbufsize
warning must be called before any I/O -
url_fopen
note when opened as read/write, the buffers are only used for reading -
url_fclose
-
url_fileno
-
url_fget_max_packet_size
int url_fget_max_packet_size(com.sun.jna.Pointer s) Return the maximum packet size associated to packetized buffered file handle. If the file is not packetized (stream like http or file on disk), then 0 is returned.- Parameters:
s- buffered file handle- Returns:
- maximum packet size in bytes
-
url_open_buf
-
url_close_buf
return the written or read size -
url_open_dyn_buf
Open a write only memory stream.- Parameters:
s- new IO context- Returns:
- zero if no error.
-
url_open_dyn_packet_buf
Open a write only packetized memory stream with a maximum packet size of 'max_packet_size'. The stream is stored in a memory buffer with a big endian 4 byte header giving the packet size in bytes.- Parameters:
s- new IO contextmax_packet_size- maximum packet size (must be > 0)- Returns:
- zero if no error.
-
url_close_dyn_buf
Return the written size and a pointer to the buffer. The buffer must be freed with av_free().- Parameters:
s- IO contextpbuffer- to a byte buffer- Returns:
- the length of the byte buffer
-
get_checksum
-
init_checksum
void init_checksum(AVFormatLibrary.ByteIOContext s, com.sun.jna.Pointer update_checksum, com.sun.jna.NativeLong checksum) -
udp_set_remote_url
-
udp_get_local_port
-
udp_get_file_handle
-