AVStream Struct Reference

Stream structure. More...

#include <avformat.h>

Data Fields

int index
 stream index in AVFormatContext
int id
 format-specific stream ID
AVCodecContextcodec
 codec context
AVRational r_frame_rate
 Real base framerate of the stream.
voidpriv_data
struct AVFrac pts
 encoding: pts generation when outputting stream
AVRational time_base
 This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
enum AVDiscard discard
 Selects which packets can be discarded at will and do not need to be demuxed.
int64_t start_time
 Decoding: pts of the first frame of the stream, in stream time base.
int64_t duration
 Decoding: duration of the stream, in stream time base.
int64_t nb_frames
 number of frames in this stream if known or 0
int disposition
 AV_DISPOSITION_* bit field.
AVRational sample_aspect_ratio
 sample aspect ratio (0 if unknown)
AVDictionarymetadata
AVRational avg_frame_rate
 Average framerate.
int codec_info_nb_frames
 Number of frames that have been demuxed during av_find_stream_info()
struct {
   int64_t   last_dts
   int64_t   duration_gcd
   int   duration_count
   double   duration_error [MAX_STD_TIMEBASES]
   int64_t   codec_info_duration
   int   nb_decoded_frames
info
const uint8_t * cur_ptr
int cur_len
AVPacket cur_pkt
int64_t reference_dts
 Timestamp corresponding to the last dts sync point.
int64_t first_dts
int64_t cur_dts
int last_IP_duration
int64_t last_IP_pts
int probe_packets
struct AVPacketListlast_in_packet_buffer
 last packet in packet_buffer for this stream when muxing.
AVProbeData probe_data
int64_t pts_buffer [MAX_REORDER_DELAY+1]
enum AVStreamParseType need_parsing
struct AVCodecParserContextparser
AVIndexEntryindex_entries
 Only used if the format does not support seeking natively.
int nb_index_entries
unsigned int index_entries_allocated_size
int pts_wrap_bits
 number of bits in pts (used for wrapping control)

Detailed Description

Stream structure.

New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. sizeof(AVStream) must not be used outside libav*.

Examples:
libavformat/output-example.c.

Definition at line 619 of file avformat.h.

Field Documentation

AVCodecContext* AVStream::codec

codec context

Examples:
libavformat/output-example.c.

Definition at line 622 of file avformat.h.

Referenced by a64_write_header(), a64_write_packet(), add_audio_stream(), add_av_stream(), add_av_stream1(), add_codec(), add_dstream(), add_input_streams(), add_video_stream(), adts_aac_read_header(), adts_write_header(), adx_read_header(), adx_read_packet(), aea_read_header(), aea_read_packet(), aiff_read_header(), aiff_read_packet(), aiff_write_header(), aiff_write_trailer(), alloc_buffer(), alloc_picture(), amf_parse_object(), amr_handle_packet(), amr_read_header(), amr_read_packet(), apc_read_header(), ape_read_header(), applehttp_read_header(), asf_read_header(), asf_read_stream_properties(), asf_write_header1(), asf_write_packet(), asfrtp_parse_sdp_line(), au_read_header(), au_read_packet(), audio_decode_frame(), audio_read_header(), audio_read_packet(), audio_write_header(), av_find_best_stream(), av_find_default_stream_index(), av_interleaved_write_frame(), av_read_packet(), avformat_find_stream_info(), avformat_free_context(), avformat_new_stream(), avformat_write_header(), avi_read_header(), avi_sync(), avi_write_counters(), avi_write_header(), avi_write_idx1(), avi_write_ix(), avi_write_packet(), avi_write_trailer(), avisynth_read_header(), avpriv_dv_init_demux(), avpriv_dv_produce_packet(), avs_read_packet(), bfi_read_header(), bmv_read_header(), build_feed_streams(), build_file_streams(), build_frame_code(), cdata_read_header(), celt_header(), check_inputs(), check_stream_max_drift(), check_stream_specifier(), choose_decoder(), choose_encoder(), choose_pixel_fmt(), choose_sample_fmt(), choose_sample_rate(), cin_read_header(), close_audio(), close_connection(), close_video(), compute_bandwidth(), compute_frame_duration(), compute_pkt_fields(), compute_pkt_fields2(), compute_status(), create_audio_stream(), create_stream(), daud_header(), daud_write_header(), dc1394_read_common(), decode_stream_header(), decode_thread(), deplanarize(), dfa_read_header(), dirac_header(), do_audio_out(), do_streamcopy(), do_subtitle_out(), do_video_out(), do_video_resample(), do_video_stats(), dump_attachment(), dump_stream_format(), dv_assemble_frame(), dv_extract_audio_info(), dv_extract_video_info(), dv_frame_offset(), dv_init_mux(), dv_offset_reset(), dxa_read_header(), ea_read_header(), encode_audio_frame(), estimate_timings_from_bit_rate(), estimate_timings_from_pts(), extract_mpeg4_header(), fbdev_read_header(), ff_alsa_open(), ff_asf_parse_packet(), ff_audio_interleave_close(), ff_audio_interleave_init(), ff_audio_rechunk_interleave(), ff_mov_read_stsd_entries(), ff_mp4_read_dec_config_descr(), ff_parse_mpeg2_descriptor(), ff_raw_audio_read_header(), ff_raw_read_header(), ff_raw_video_read_header(), ff_rm_parse_packet(), ff_rm_read_mdpr_codecdata(), ff_rm_retrieve_cache(), ff_rtp_chain_mux_open(), ff_rtp_parse_open(), ff_rtp_send_aac(), ff_rtp_send_latm(), ff_sauce_read(), ffm_close(), ffm_read_header(), ffm_write_header(), film_read_header(), find_stream_in_feed(), flac_header(), flac_read_header(), flac_write_header(), flac_write_trailer(), flush_encoders(), flv_get_extradata(), flv_read_metabody(), flv_read_packet(), flv_set_video_codec(), flv_write_header(), flv_write_packet(), flv_write_trailer(), fourxm_read_header(), get_attachment(), get_audio_clock(), get_codec_data(), get_packet_header(), get_sindex(), get_video_frame(), gif_write_header(), gif_write_packet(), grab_read_header(), gsm_read_header(), gxf_compare_field_nb(), gxf_find_lines_index(), gxf_interleave_packet(), gxf_packet(), gxf_write_header(), gxf_write_media_preamble(), gxf_write_mpeg_auxiliary(), gxf_write_packet(), gxf_write_umf_media_description(), gxf_write_umf_media_mpeg(), has_decode_delay_been_guessed(), http_prepare_data(), http_receive_data(), idcin_read_header(), iff_read_header(), init_input_stream(), ipmovie_read_header(), iss_read_header(), iss_read_packet(), ivf_write_header(), latm_write_frame_header(), latm_write_header(), lmlm4_read_header(), lxf_read_header(), lxf_read_packet(), m4sl_cb(), main(), matroska_parse_block(), matroska_read_header(), mkv_write_attachments(), mkv_write_block(), mkv_write_header(), mkv_write_packet(), mkv_write_packet_internal(), mkv_write_tracks(), mmf_read_header(), modify_current_stream(), mov_build_index(), mov_read_chan(), mov_read_close(), mov_read_dac3(), mov_read_enda(), mov_read_extradata(), mov_read_fiel(), mov_read_glbl(), mov_read_hdlr(), mov_read_smi(), mov_read_strf(), mov_read_trak(), mov_read_trun(), mov_read_wave(), mov_read_wfex(), mov_write_ftyp_tag(), mov_write_header(), mov_write_tkhd_tag(), mov_write_udta_sdp(), mov_write_uuidprof_tag(), movie_init(), mp3_parse_vbr_tags(), mp3_read_header(), mpc8_read_header(), mpc_read_header(), mpeg_mux_init(), mpeg_mux_write_packet(), mpegps_read_packet(), mpegts_find_stream_type(), mpegts_push_data(), mpegts_read_header(), mpegts_set_stream_info(), mpegts_write_header(), mpegts_write_packet(), mpegts_write_pes(), mpegts_write_pmt(), msnwc_tcp_read_header(), mtv_read_header(), mxf_get_d10_aes3_packet(), mxf_parse_mpeg2_frame(), mxf_parse_structural_metadata(), mxf_write_cdci_common(), mxf_write_common_fields(), mxf_write_d10_audio_packet(), mxf_write_d10_video_packet(), mxf_write_generic_sound_common(), mxf_write_header(), mxf_write_identification(), mxf_write_mpegvideo_desc(), mxf_write_packet(), mxf_write_wav_common(), mxg_read_header(), nc_read_header(), new_audio_stream(), new_data_stream(), new_output_stream(), new_stream(), new_subtitle_stream(), new_video_stream(), nsv_parse_NSVs_header(), nsv_read_chunk(), nsv_read_close(), nut_read_header(), nut_write_header(), nuv_header(), ogg_buffer_data(), ogg_read_seek(), ogg_write_header(), ogg_write_packet(), ogg_write_trailer(), ogm_dshow_header(), ogm_header(), old_dirac_header(), old_flac_header(), oma_read_header(), oma_read_packet(), oma_write_header(), open_audio(), open_input_file(), open_input_stream(), open_video(), opt_input_file(), opt_output_file(), opt_target(), output_packet(), output_picture2(), parse_fmtp(), parse_fmtp_config(), parse_h264_sdp_line(), parse_media_type(), parse_mpeg1waveformatex(), pcm_read_seek(), pmp_header(), pmt_cb(), pre_process_video_frame(), prepare_sdp_description(), print_report(), pulse_read_header(), pva_read_header(), qcp_read_header(), qdm2_parse_config(), qdm2_parse_packet(), qt_rtp_parse_packet(), queue_picture(), r3d_read_rdvo(), r3d_read_red1(), r3d_read_reda(), r3d_read_redv(), r3d_seek(), raw_read_packet(), rawvideo_read_packet(), rdt_parse_packet(), rdt_parse_sdp_line(), read_avserver_streams(), read_desc_chunk(), read_frame_internal(), read_gab2_sub(), read_header(), read_kuki_chunk(), read_packet(), read_seek(), real_parse_asm_rule(), rl2_read_header(), rm_ac3_swap_bytes(), rm_read_audio_stream_info(), rm_read_dts(), rm_read_header(), rm_write_header(), rm_write_packet(), roq_read_packet(), rpl_read_header(), rpl_read_packet(), rso_read_header(), rso_read_packet(), rso_write_header(), rtp_parse_one_packet(), rtp_parse_packet_internal(), rtp_parse_queued_packet(), rtp_write_header(), rtp_write_packet(), sap_fetch_packet(), sap_read_header(), sdp_parse_fmtp_config_h264(), seg_write_header(), seg_write_packet(), seq_read_header(), set_codec_from_probe_data(), setup_find_stream_info_opts(), show_packet(), show_stream(), siff_parse_vbv1(), skeleton_header(), smacker_read_header(), smjpeg_read_header(), smjpeg_write_header(), smjpeg_write_packet(), sol_read_header(), sox_read_header(), sox_read_packet(), sox_write_header(), sox_write_trailer(), spdif_read_packet(), spdif_write_header(), speex_header(), srt_read_header(), str_read_packet(), stream_component_close(), stream_component_open(), stream_cycle_channel(), subtitle_thread(), svq3_parse_packet(), swf_read_packet(), swf_write_header(), swf_write_packet(), swf_write_trailer(), synchronize_audio(), theora_header(), thp_read_header(), tmv_read_header(), transcode(), transcode_audio(), transcode_init(), transcode_subtitles(), transcode_video(), try_decode_frame(), tta_read_header(), txd_read_header(), update_initial_durations(), v4l2_read_header(), v4l2_read_packet(), v4l2_set_parameters(), validate_codec_tag(), vc1t_read_header(), vc1test_write_header(), vfw_read_header(), vid_read_header(), vid_read_packet(), video_audio_display(), video_image_display(), video_open(), video_thread(), vmd_read_header(), voc_get_packet(), voc_read_header(), voc_write_header(), voc_write_packet(), vorbis_header(), vqf_read_header(), vqf_read_seek(), wc3_read_header(), write_audio_frame(), write_frame(), write_header(), write_streamheader(), write_trailer(), write_video_frame(), wsaud_read_header(), wsvqa_read_header(), wv_read_header(), x11grab_read_header(), xa_read_header(), xa_read_packet(), xiph_parse_fmtp_pair(), xmv_process_packet_header(), xmv_read_header(), xwma_read_header(), xwma_read_packet(), yop_read_header(), yuv4_read_header(), and yuv4_read_packet().

int64_t AVStream::codec_info_duration

Definition at line 778 of file avformat.h.

Referenced by avformat_find_stream_info().

int AVStream::codec_info_nb_frames

Number of frames that have been demuxed during av_find_stream_info()

Definition at line 767 of file avformat.h.

Referenced by av_find_best_stream(), avformat_find_stream_info(), dump_stream_format(), transcode(), and try_decode_frame().

int AVStream::cur_len
const uint8_t* AVStream::cur_ptr
int AVStream::duration_count

Definition at line 776 of file avformat.h.

Referenced by avformat_find_stream_info().

double AVStream::duration_error[MAX_STD_TIMEBASES]

Definition at line 777 of file avformat.h.

Referenced by avformat_find_stream_info().

int64_t AVStream::duration_gcd

Definition at line 775 of file avformat.h.

Referenced by avformat_find_stream_info().

int AVStream::index

stream index in AVFormatContext

Examples:
libavformat/output-example.c.

Definition at line 620 of file avformat.h.

Referenced by aac_parse_packet(), add_av_stream1(), amr_handle_packet(), av_read_packet(), avformat_find_stream_info(), avformat_new_stream(), avpriv_set_pts_info(), avs_read_audio_packet(), avs_read_video_packet(), build_feed_streams(), check_stream_specifier(), cin_read_header(), compute_pkt_fields2(), dc1394_read_common(), do_audio_out(), do_video_out(), do_video_resample(), dump_attachment(), dv_extract_audio_info(), ea_read_header(), ff_rm_parse_packet(), ff_rm_retrieve_cache(), film_read_header(), flv_read_packet(), fourxm_read_header(), get_subtitle_pkt(), gxf_write_header(), gxf_write_media_preamble(), h263_handle_packet(), h264_handle_packet(), idcin_read_header(), init_input_stream(), ipmovie_read_header(), latm_parse_packet(), matroska_parse_block(), mov_build_index(), mov_read_trak(), mov_read_trun(), mov_seek_stream(), mpegps_read_packet(), mpegts_set_stream_info(), mxf_parse_structural_metadata(), mxf_write_generic_desc(), mxf_write_header(), mxf_write_packet(), mxf_write_sequence(), mxf_write_structural_component(), mxf_write_timecode_component(), mxf_write_track(), new_pes_packet(), nsv_read_chunk(), open_input_file(), pmt_cb(), qdm2_restore_block(), qt_rtp_parse_packet(), rdt_load_mdpr(), rdt_parse_packet(), rdt_parse_sdp_line(), read_frame_internal(), return_stored_frame(), roq_read_packet(), rtp_parse_packet_internal(), rtsp_open_transport_ctx(), seq_read_header(), show_stream(), smacker_read_header(), smjpeg_read_header(), store_packet(), str_read_packet(), svq3_parse_packet(), thp_read_header(), transcode(), transcode_init(), transcode_video(), vmd_read_header(), vp8_handle_packet(), wc3_read_header(), write_audio_frame(), write_video_frame(), wsaud_read_header(), wsvqa_read_header(), xa_read_packet(), xiph_handle_packet(), and xmv_read_header().

unsigned int AVStream::index_entries_allocated_size

Definition at line 820 of file avformat.h.

Referenced by av_add_index_entry(), and mov_build_index().

int64_t AVStream::last_dts

Definition at line 774 of file avformat.h.

Referenced by avformat_find_stream_info().

struct AVPacketList* AVStream::last_in_packet_buffer

last packet in packet_buffer for this stream when muxing.

Definition at line 809 of file avformat.h.

Referenced by av_interleave_packet_per_dts(), ff_interleave_add_packet(), and mxf_interleave_get_packet().

int AVStream::last_IP_duration

Definition at line 797 of file avformat.h.

Referenced by compute_pkt_fields().

int AVStream::nb_decoded_frames

Definition at line 779 of file avformat.h.

Referenced by has_decode_delay_been_guessed(), and try_decode_frame().

void* AVStream::priv_data

Definition at line 632 of file avformat.h.

Referenced by add_av_stream1(), asf_read_pts(), asf_read_stream_properties(), asf_reset_header(), av_write_trailer(), avformat_free_context(), avi_read_close(), avi_read_header(), avi_read_idx1(), avi_read_packet(), avi_read_seek(), avi_start_new_riff(), avi_sync(), avi_write_counters(), avi_write_header(), avi_write_idx1(), avi_write_ix(), avi_write_packet(), avi_write_trailer(), check_stream_max_drift(), clean_index(), ff_asf_parse_packet(), ff_audio_interleave_close(), ff_audio_interleave_init(), ff_audio_rechunk_interleave(), ff_interleave_new_audio_packet(), ff_mov_read_stsd_entries(), flush_packet(), flv_write_header(), flv_write_packet(), flv_write_trailer(), get_subtitle_pkt(), get_system_header_size(), gxf_compare_field_nb(), gxf_find_lines_index(), gxf_write_header(), gxf_write_media_preamble(), gxf_write_mpeg_auxiliary(), gxf_write_track_description_section(), gxf_write_umf_media_description(), gxf_write_umf_media_mpeg(), gxf_write_umf_track_description(), http_prepare_data(), mov_build_index(), mov_find_next_sample(), mov_read_chapters(), mov_read_close(), mov_read_ctts(), mov_read_dref(), mov_read_elst(), mov_read_mdhd(), mov_read_packet(), mov_read_stco(), mov_read_stps(), mov_read_stsc(), mov_read_stss(), mov_read_stsz(), mov_read_stts(), mov_read_tkhd(), mov_read_trak(), mov_read_trun(), mov_seek_stream(), mpeg_mux_end(), mpeg_mux_init(), mpeg_mux_write_packet(), mpegts_get_pcr(), mpegts_insert_pcr_only(), mpegts_set_stream_info(), mpegts_write_end(), mpegts_write_header(), mpegts_write_packet(), mpegts_write_pes(), mpegts_write_pmt(), mxf_compare_timestamps(), mxf_free(), mxf_get_stream_index(), mxf_parse_mpeg2_frame(), mxf_parse_structural_metadata(), mxf_read_close(), mxf_write_cdci_common(), mxf_write_essence_container_refs(), mxf_write_footer(), mxf_write_generic_desc(), mxf_write_header(), mxf_write_index_table_segment(), mxf_write_multi_descriptor(), mxf_write_package(), mxf_write_packet(), mxf_write_system_item(), mxf_write_track(), new_stream(), nsv_parse_NSVs_header(), nsv_read_chunk(), nsv_read_close(), nsv_read_seek(), ogg_buffer_data(), ogg_compare_granule(), ogg_write_header(), ogg_write_packet(), ogg_write_page(), ogg_write_pages(), ogg_write_trailer(), output_packet(), parse_chunks(), put_system_header(), qt_rtp_parse_packet(), read_braindead_odml_indx(), read_gab2_sub(), remove_decoded_packets(), rm_read_close(), rm_read_header(), rm_read_header_old(), rm_read_packet(), rtp_new_av_stream(), sap_write_close(), sap_write_header(), sap_write_packet(), and seek_subtitle().

AVProbeData AVStream::probe_data

Definition at line 810 of file avformat.h.

Referenced by av_read_packet(), and avformat_free_context().

struct AVFrac AVStream::pts

encoding: pts generation when outputting stream

Examples:
libavformat/output-example.c.

Definition at line 642 of file avformat.h.

Referenced by avformat_write_header(), compute_pkt_fields2(), main(), print_report(), and transcode().

int64_t AVStream::pts_buffer[MAX_REORDER_DELAY+1]
int AVStream::pts_wrap_bits

number of bits in pts (used for wrapping control)

Definition at line 822 of file avformat.h.

Referenced by av_read_frame(), avpriv_set_pts_info(), compute_pkt_fields(), and estimate_timings_from_pts().

AVRational AVStream::r_frame_rate

Real base framerate of the stream.

This is the lowest framerate with which all timestamps can be represented accurately (it is the least common multiple of all framerates in the stream). Note, this value is just a guess! For example, if the time base is 1/90000 and all frames have either approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.

Definition at line 631 of file avformat.h.

Referenced by avformat_find_stream_info(), avisynth_read_header(), compute_frame_duration(), dump_stream_format(), ff_raw_video_read_header(), ff_rm_read_mdpr_codecdata(), flv_write_header(), mov_read_trak(), nuv_header(), opt_input_file(), show_stream(), transcode(), transcode_init(), and vc1test_write_header().

int64_t AVStream::reference_dts

Timestamp corresponding to the last dts sync point.

Initialized when AVCodecParserContext.dts_sync_point >= 0 and a DTS is received from the underlying container. Otherwise set to AV_NOPTS_VALUE by default.

Definition at line 794 of file avformat.h.

Referenced by avformat_new_stream(), compute_pkt_fields(), estimate_timings_from_pts(), ff_read_frame_flush(), ff_restore_parser_state(), and ff_store_parser_state().

AVRational AVStream::time_base

This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.

For fixed-fps content, time base should be 1/framerate and timestamp increments should be 1. decoding: set by libavformat encoding: set by libavformat in av_write_header

Examples:
libavformat/output-example.c.

Definition at line 651 of file avformat.h.

Referenced by applehttp_read_seek(), audio_decode_frame(), av_pkt_dump2(), av_pkt_dump_log2(), av_seek_frame(), avformat_find_stream_info(), avformat_write_header(), avi_read_packet(), avi_read_seek(), avpriv_set_pts_info(), check_stream_max_drift(), compute_frame_duration(), compute_pkt_fields(), compute_pkt_fields2(), config_output_props(), decode_thread(), do_audio_out(), do_streamcopy(), do_subtitle_out(), do_video_out(), dump_stream_format(), encode_audio_frame(), estimate_timings_from_bit_rate(), ff_gen_syncpoint_search(), ff_interleave_compare_dts(), ff_interleave_new_audio_packet(), ff_mov_init_hinting(), ff_update_cur_dts(), ff_write_chained(), fill_all_stream_timings(), finalize_packet(), flac_read_header(), flush_encoders(), get_subtitle_pkt(), http_prepare_data(), ivf_write_header(), main(), mov_read_chapters(), mov_read_seek(), movie_get_frame(), mp3_parse_vbr_tags(), mxf_read_seek(), nut_read_header(), ogg_compare_granule(), output_packet(), pcm_read_seek(), print_report(), r3d_read_rdvo(), r3d_read_red1(), r3d_read_reda(), r3d_read_redv(), r3d_seek(), read_gab2_sub(), read_header(), read_seek(), read_seek2(), rl2_read_seek(), rtsp_read_play(), rtsp_read_seek(), sap_fetch_packet(), sap_read_header(), search_hi_lo_keyframes(), seek_subtitle(), seg_write_packet(), show_packet(), show_stream(), subtitle_thread(), transcode(), transcode_init(), transcode_video(), update_stream_timings(), vc1t_read_packet(), video_thread(), vqf_read_seek(), write_audio_frame(), and write_video_frame().


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