Go to the documentation of this file.
56 #define DECODING_FOR_OST 1
57 #define DECODING_FOR_FILTER 2
175 "New %s stream with index %d at pos:%"PRId64
" and DTS:%ss\n",
214 int disable_discontinuity_correction =
copy_ts;
224 disable_discontinuity_correction = 0;
229 if (fmt_is_discont) {
234 "timestamp discontinuity "
235 "(stream id=%d): %"PRId64
", new offset= %"PRId64
"\n",
244 "DTS %"PRId64
", next:%"PRId64
" st:%d invalid dropping\n",
253 "PTS %"PRId64
", next:%"PRId64
" invalid dropping st:%d\n",
265 "Inter stream timestamp discontinuity %"PRId64
", new offset= %"PRId64
"\n",
367 #define SHOW_TS_DEBUG(tag_) \
369 av_log(ist, AV_LOG_INFO, "%s -> ist_index:%d:%d type:%s " \
370 "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s\n", \
371 tag_, ifile->index, pkt->stream_index, \
372 av_get_media_type_string(ist->st->codecpar->codec_type), \
373 av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &pkt->time_base), \
374 av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &pkt->time_base), \
375 av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &pkt->time_base)); \
479 av_log(ist,
AV_LOG_INFO,
"demuxer+ffmpeg -> ist_index:%d:%d type:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s off:%s off_time:%s\n",
499 for (
int i = 0;
i <
f->nb_streams;
i++) {
506 if (
pts - burst_until > now)
512 const char *pkt_desc)
529 }
else if (
ret < 0) {
532 "Unable to send %s packet to consumers: %s\n",
551 for (
int i = 0;
i <
f->nb_streams;
i++) {
587 "Error applying bitstream filters to a packet: %s\n",
614 for (
unsigned i = 0;
i <
f->nb_streams;
i++) {
664 memset(dt, 0,
sizeof(*dt));
669 memset(dt, 0,
sizeof(*dt));
704 unsigned send_flags = 0;
759 "corrupt input packet in stream %d\n",
793 uint64_t total_packets = 0, total_size = 0;
796 f->index,
f->ctx->url);
798 for (
int j = 0; j <
f->nb_streams; j++) {
816 "%"PRIu64
" frames decoded; %"PRIu64
" decode errors",
827 total_packets, total_size);
865 for (
int i = 0;
i <
f->nb_streams;
i++)
885 decoding_needed ?
"decode" :
"streamcopy");
889 if (decoding_needed && !ist->
dec) {
891 "Decoding requested, but no decoder found for: %s\n",
934 "Warning using DVB subtitles for filtering and output at the "
935 "same time is not fully supported, also see -compute_edt [0|1]\n");
969 *
src = decoding_needed ?
1006 if (sd && sd->
size >=
sizeof(uint32_t) * 4) {
1021 if (!(
opts->sub2video_width &&
opts->sub2video_height)) {
1031 if (!(
opts->sub2video_width &&
opts->sub2video_height)) {
1033 opts->sub2video_height =
FFMAX(
opts->sub2video_height, 576);
1080 const char *codec_name =
NULL;
1106 if (
config->device_type == hwaccel_device_type) {
1107 av_log(logctx,
AV_LOG_VERBOSE,
"Selecting decoder '%s' because of requested hwaccel method %s\n",
1122 int guess_layout_max)
1125 char layout_name[256];
1143 double rotation = DBL_MAX;
1144 int hflip = -1, vflip = -1;
1145 int hflip_set = 0, vflip_set = 0, rotation_set = 0;
1152 rotation_set = rotation != DBL_MAX;
1153 hflip_set = hflip != -1;
1154 vflip_set = vflip != -1;
1156 if (!rotation_set && !hflip_set && !vflip_set)
1170 rotation_set ? -(rotation) : -0.0f);
1173 hflip_set ? hflip : 0,
1174 vflip_set ? vflip : 0);
1212 type_str ? *type_str :
'?', d->
f.
index, st->
index,
1227 const char *hwaccel_output_format =
NULL;
1228 const char *codec_tag =
NULL;
1229 const char *bsfs =
NULL;
1231 const char *discard_str =
NULL;
1271 const AVClass *pclass = &
class;
1282 uint32_t
tag = strtol(codec_tag, &next, 0);
1284 uint8_t buf[4] = { 0 };
1285 memcpy(buf, codec_tag,
FFMIN(
sizeof(buf), strlen(codec_tag)));
1299 &hwaccel_output_format);
1300 if (!hwaccel_output_format &&
hwaccel && !strcmp(
hwaccel,
"cuvid")) {
1302 "WARNING: defaulting hwaccel_output_format to cuda for compatibility "
1303 "with old commandlines. This behaviour is DEPRECATED and will be removed "
1304 "in the future. Please explicitly set \"-hwaccel_output_format cuda\".\n");
1306 }
else if (!hwaccel_output_format &&
hwaccel && !strcmp(
hwaccel,
"qsv")) {
1308 "WARNING: defaulting hwaccel_output_format to qsv for compatibility "
1309 "with old commandlines. This behaviour is DEPRECATED and will be removed "
1310 "in the future. Please explicitly set \"-hwaccel_output_format qsv\".\n");
1312 }
else if (!hwaccel_output_format &&
hwaccel && !strcmp(
hwaccel,
"mediacodec")) {
1316 }
else if (hwaccel_output_format) {
1320 "format: %s", hwaccel_output_format);
1333 else if (!strcmp(
hwaccel,
"auto"))
1358 if (hwaccel_device) {
1427 const char *ch_layout_str =
NULL;
1430 if (ch_layout_str) {
1442 "Specified channel layout '%s' has %d channels, but input has %d channels.\n",
1448 int guess_layout_max = INT_MAX;
1456 const char *canvas_size =
NULL;
1494 "Error parsing bitstream filter sequence '%s': %s\n",
1533 filename = e->
value;
1600 const char* data_codec_name =
NULL;
1601 int scan_all_pmts_set = 0;
1619 if (stop_time != INT64_MAX && recording_time != INT64_MAX) {
1620 stop_time = INT64_MAX;
1624 if (stop_time != INT64_MAX && recording_time == INT64_MAX) {
1626 if (stop_time <= start) {
1630 recording_time = stop_time - start;
1641 if (!strcmp(filename,
"-"))
1645 strcmp(filename,
"fd:") &&
1646 strcmp(filename,
"/dev/stdin");
1704 if (data_codec_name)
1724 scan_all_pmts_set = 1;
1730 "Error opening input: %s\n",
av_err2str(err));
1740 if (scan_all_pmts_set)
1769 for (
int i = 0;
i < orig_nb_streams;
i++)
1786 if (start_time_eof >= 0) {
1806 int64_t seek_timestamp = timestamp;
1809 int dts_heuristic = 0;
1817 if (dts_heuristic) {
1857 "Option -readrate_initial_burst is %0.3f; it must be non-negative.\n",
1863 "since neither -readrate nor -re were given\n");
1885 for (
int j = 0; j <
f->nb_streams; j++) {
@ AV_PKT_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
int64_t av_gettime_relative(void)
Get the current time in microseconds since some unspecified starting point.
AVCodecParameters * par_in
Parameters of the input stream.
#define AV_LOG_WARNING
Something somehow does not look correct.
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
static void demux_final_stats(Demuxer *d)
static int err_merge(int err0, int err1)
Merge two return codes - return one of the error codes if at least one of them was negative,...
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVMediaType codec_type
General type of the encoded data.
static const AVClass input_stream_class
int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b)
Compare two timestamps each in its own time base.
unsigned int nb_stream_indexes
int check_avoptions(AVDictionary *m)
static int apply_cropping(AVCodecContext *avctx, AVFrame *frame)
The official guide to swscale for confused that is
@ AV_PKT_DATA_FRAME_CROPPING
The number of pixels to discard from the top/bottom/left/right border of the decoded frame to obtain ...
This struct describes the properties of an encoded stream.
@ DECODER_FLAG_SEND_END_TS
#define AVERROR_EOF
End of file.
enum AVDiscard discard
Selects which packets can be discarded at will and do not need to be demuxed.
int sch_add_demux(Scheduler *sch, SchThreadFunc func, void *ctx)
Add a demuxer to the scheduler.
static int input_packet_process(Demuxer *d, AVPacket *pkt, unsigned *send_flags)
static int demux_thread_init(DemuxThreadContext *dt)
#define SCH_DSTREAM(file, stream)
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
SpecifierOptList audio_ch_layouts
static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictionary **opts_used)
InputStream * ist_iter(InputStream *prev)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
AVStream ** streams
A list of all streams in the file.
@ DECODER_FLAG_FRAMERATE_FORCED
This structure stores auxiliary information for decoding, presenting, or otherwise processing the cod...
SpecifierOptList display_hflips
const AVCodecParameters * par
void ifile_close(InputFile **pf)
void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip)
Flip the input matrix horizontally and/or vertically.
static const char * subtitle_codec_name
static DemuxStream * demux_stream_alloc(Demuxer *d, AVStream *st)
AVRational avg_frame_rate
Average framerate.
enum HWAccelID hwaccel_id
AVRational framerate
Video only.
enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name)
Look up an AVHWDeviceType by name.
#define AV_LOG_VERBOSE
Detailed information.
AVDictionary * decoder_opts
enum AVHWDeviceType av_hwdevice_iterate_types(enum AVHWDeviceType prev)
Iterate over supported device types.
void av_display_rotation_set(int32_t matrix[9], double angle)
Initialize a transformation matrix describing a pure clockwise rotation by the specified angle (in de...
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
enum AVChannelOrder order
Channel order used in this layout.
int av_read_frame(AVFormatContext *s, AVPacket *pkt)
Return the next frame of a stream.
enum AVCodecID video_codec_id
Forced video codec_id.
@ IFILTER_FLAG_AUTOROTATE
int nb_channels
Number of channels in this layout.
void av_bsf_free(AVBSFContext **pctx)
Free a bitstream filter context and everything associated with it; write NULL into the supplied point...
static const AVInputFormat * file_iformat
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
SpecifierOptList frame_pix_fmts
The bitstream filter state.
SpecifierOptList canvas_sizes
enum AVPixelFormat hwaccel_output_format
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
AVIOInterruptCB interrupt_callback
Custom interrupt callbacks for the I/O layer.
float dts_delta_threshold
void opt_match_per_stream_int(void *logctx, const SpecifierOptList *sol, AVFormatContext *fc, AVStream *st, int *out)
enum AVDiscard discard
selects which program to discard and which to feed to the caller
static const char * input_file_item_name(void *obj)
@ AVDISCARD_NONE
discard nothing
AVChannelLayout ch_layout
Channel layout of the audio data.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
AVCodecParameters * par_out
Parameters of the output stream.
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
int64_t ts_offset_discont
Extra timestamp offset added by discontinuity handling.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
@ AV_CODEC_ID_DVB_SUBTITLE
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
Check if the given stream matches a stream specifier.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
AVDictionary * codec_opts
void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output)
Print detailed information about the input or output format, such as duration, bitrate,...
SpecifierOptList hwaccel_output_formats
int avformat_open_input(AVFormatContext **ps, const char *url, const AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
int frame_size
Audio only.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
int assert_file_overwrite(const char *filename)
This struct describes the properties of a single codec described by an AVCodecID.
const struct AVCodec * video_codec
Forced video codec.
void av_bsf_flush(AVBSFContext *ctx)
Reset the internal bitstream filter state.
int flags
Flags modifying the (de)muxer behaviour.
AVRational sample_aspect_ratio
Video only.
int dec_init(Decoder **pdec, Scheduler *sch, AVDictionary **dec_opts, const DecoderOpts *o, AVFrame *param_out)
const struct AVInputFormat * iformat
The input container format.
SpecifierOptList hwaccel_devices
@ AV_CHANNEL_ORDER_UNSPEC
Only the channel count is specified, without any further information about the channel order.
int sch_add_demux_stream(Scheduler *sch, unsigned demux_idx)
Add a demuxed stream for a previously added demuxer.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
double readrate_initial_burst
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AVIO_FLAG_WRITE
write-only
static void discard_unused_programs(InputFile *ifile)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
AVRational time_base_in
The timebase used for the timestamps of the input packets.
static int demux_send(Demuxer *d, DemuxThreadContext *dt, DemuxStream *ds, AVPacket *pkt, unsigned flags)
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
SpecifierOptList fix_sub_duration
static const char * input_stream_item_name(void *obj)
const char * av_hwdevice_get_type_name(enum AVHWDeviceType type)
Get the string name of an AVHWDeviceType.
int av_usleep(unsigned usec)
Sleep for a period of time.
int nb_coded_side_data
Amount of entries in coded_side_data.
@ AVMEDIA_TYPE_DATA
Opaque data information usually continuous.
@ AV_ROUND_NEAR_INF
Round to nearest and halfway cases away from zero.
void * opaque
for some private data of the user
const struct AVCodec * data_codec
Forced data codec.
#define SCH_DEC_IN(decoder)
@ AV_ROUND_PASS_MINMAX
Flag telling rescaling functions to pass INT64_MIN/MAX through unchanged, avoiding special cases for ...
@ AV_PIX_FMT_MEDIACODEC
hardware decoding through MediaCodec
@ AV_CLASS_CATEGORY_DEMUXER
int props
Codec properties, a combination of AV_CODEC_PROP_* flags.
the definition of that something depends on the semantic of the filter The callback must examine the status of the filter s links and proceed accordingly The status of output links is stored in the status_in and status_out fields and tested by the then the processing requires a frame on this link and the filter is expected to make efforts in that direction The status of input links is stored by the fifo and status_out fields
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
int repeat_pict
This field is used for proper frame duration computation in lavf.
@ AVDISCARD_ALL
discard all
enum AVCodecID audio_codec_id
Forced audio codec_id.
AVDictionary * format_opts
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define LIBAVUTIL_VERSION_INT
int av_bsf_init(AVBSFContext *ctx)
Prepare the filter for use, after all the parameters and options have been set.
static Demuxer * demuxer_from_ifile(InputFile *f)
Describe the class of an AVClass context structure.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
int dec_request_view(Decoder *dec, const ViewSpecifier *vs, SchedulerNode *src)
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
void avcodec_parameters_free(AVCodecParameters **ppar)
Free an AVCodecParameters instance and everything associated with it and write NULL to the supplied p...
int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt)
Retrieve a filtered packet.
SpecifierOptList audio_channels
Rational number (pair of numerator and denominator).
int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id, AVFormatContext *s, AVStream *st, const AVCodec *codec, AVDictionary **dst, AVDictionary **opts_used)
Filter out options for given codec.
const char * av_default_item_name(void *ptr)
Return the context name.
unsigned int * stream_index
SpecifierOptList reinit_filters
#define AV_OPT_SEARCH_FAKE_OBJ
The obj passed to av_opt_find() is fake – only a double pointer to AVClass instead of a required poin...
SpecifierOptList dump_attachment
int64_t wallclock[LATENCY_PROBE_NB]
#define AV_DICT_DONT_OVERWRITE
Don't overwrite existing entries.
@ DEMUX_SEND_STREAMCOPY_EOF
Treat the packet as an EOF for SCH_NODE_TYPE_MUX destinations send normally to other types.
SpecifierOptList display_vflips
@ AV_PIX_FMT_QSV
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
AVChannelLayout ch_layout
Audio only.
static void report_new_stream(Demuxer *d, const AVPacket *pkt)
static int guess_input_channel_layout(InputStream *ist, AVCodecParameters *par, int guess_layout_max)
@ DECODER_FLAG_FIX_SUB_DURATION
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int sample_rate
Audio only.
int find_codec(void *logctx, const char *name, enum AVMediaType type, int encoder, const AVCodec **codec)
const struct AVCodec * audio_codec
Forced audio codec.
const AVPacketSideData * av_packet_side_data_get(const AVPacketSideData *sd, int nb_sd, enum AVPacketSideDataType type)
Get side information from a side data array.
const AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
int extradata_size
Size of the extradata content in bytes.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int av_codec_is_decoder(const AVCodec *codec)
int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
Read packets of a media file to get stream information.
const AVOption * av_opt_find(void *obj, const char *name, const char *unit, int opt_flags, int search_flags)
Look for an option in an object.
#define av_ts2timestr(ts, tb)
Convenience macro, the return value should be used only directly in function arguments but never stan...
static int seek_to_start(Demuxer *d, Timestamp end_pts)
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
@ AVDISCARD_DEFAULT
discard useless packets like 0 size packets in avi
An AVChannelLayout holds information about the channel layout of audio data.
int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
Submit a packet for filtering.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
static int64_t start_time
SpecifierOptList apply_cropping
static void demux_thread_uninit(DemuxThreadContext *dt)
int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
Seek to timestamp ts.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define AV_CODEC_PROP_FIELDS
Video codec supports separate coding of fields in interlaced frames.
static const AVClass input_file_class
#define DECODING_FOR_FILTER
int ist_use(InputStream *ist, int decoding_needed, const ViewSpecifier *vs, SchedulerNode *src)
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
@ AVMEDIA_TYPE_UNKNOWN
Usually treated as AVMEDIA_TYPE_DATA.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
double readrate_initial_burst
void * allocate_array_elem(void *ptr, size_t elem_size, int *nb_elems)
Atomically add a new element to an array of pointers, i.e.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
SpecifierOptList display_rotations
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
void opt_match_per_stream_dbl(void *logctx, const SpecifierOptList *sol, AVFormatContext *fc, AVStream *st, double *out)
int flags
A combination of AV_PKT_FLAG values.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
SpecifierOptList ts_scale
int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str)
Parse str and put in width_ptr and height_ptr the detected values.
void av_packet_rescale_ts(AVPacket *pkt, AVRational src_tb, AVRational dst_tb)
Convert valid timing fields (timestamps / durations) in a packet from one timebase to another.
#define AV_LOG_INFO
Standard information.
static const char * video_codec_name
int64_t next_dts
dts of the last packet read for this stream (in AV_TIME_BASE units)
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
AVCodecParameters * avcodec_parameters_alloc(void)
Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0).
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
int av_channel_layout_from_string(AVChannelLayout *channel_layout, const char *str)
Initialize a channel layout from a given string description.
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
SpecifierOptList frame_rates
int setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *local_codec_opts, AVDictionary ***dst)
Setup AVCodecContext options for avformat_find_stream_info().
SpecifierOptList codec_names
static int demux_bsf_flush(Demuxer *d, DemuxThreadContext *dt)
const struct AVCodec * subtitle_codec
Forced subtitle codec.
SpecifierOptList autorotate
#define AV_TIME_BASE
Internal time base represented as integer.
#define SHOW_TS_DEBUG(tag_)
#define SCH_DEC_OUT(decoder, out_idx)
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
@ AVMEDIA_TYPE_ATTACHMENT
Opaque data information usually sparse.
SpecifierOptList hwaccels
New fields can be added to the end with minor version bumps.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
const AVIOInterruptCB int_cb
AVRational time_base_out
The timebase used for the timestamps of the output packets.
AVPacketSideData * coded_side_data
Additional data associated with the entire stream.
const AVCodec * av_codec_iterate(void **opaque)
Iterate over all registered codecs.
int sch_connect(Scheduler *sch, SchedulerNode src, SchedulerNode dst)
InputStream * ist_find_unused(enum AVMediaType type)
Find an unused input stream of given type.
int disposition
Stream disposition - a combination of AV_DISPOSITION_* flags.
const AVCodecDescriptor * codec_desc
static void ts_discontinuity_process(Demuxer *d, InputStream *ist, AVPacket *pkt)
int id
Format-specific stream ID.
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
void dec_free(Decoder **pdec)
AVRational av_guess_frame_rate(AVFormatContext *format, AVStream *st, AVFrame *frame)
Guess the frame rate, based on both the container and codec information.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes,...
int av_opt_eval_int(void *obj, const AVOption *o, const char *val, int *int_out)
static int add_display_matrix_to_stream(const OptionsContext *o, AVFormatContext *ctx, InputStream *ist)
static const char * hwaccel
@ DECODER_FLAG_TOP_FIELD_FIRST
AVPacketSideData * av_packet_side_data_new(AVPacketSideData **psd, int *pnb_sd, enum AVPacketSideDataType type, size_t size, int flags)
Allocate a new packet side data.
static int choose_decoder(const OptionsContext *o, void *logctx, AVFormatContext *s, AVStream *st, enum HWAccelID hwaccel_id, enum AVHWDeviceType hwaccel_device_type, const AVCodec **pcodec)
int check_avoptions_used(const AVDictionary *opts, const AVDictionary *opts_used, void *logctx, int decode)
void remove_avoptions(AVDictionary **a, AVDictionary *b)
#define AV_DICT_MATCH_CASE
Only get an entry with exact-case key match.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
enum AVCodecID data_codec_id
Forced Data codec_id.
const char * av_get_media_type_string(enum AVMediaType media_type)
Return a string describing the media_type enum, NULL if media_type is unknown.
int index
stream index in AVFormatContext
SpecifierOptList audio_sample_rate
static const char * audio_codec_name
int sch_demux_send(Scheduler *sch, unsigned demux_idx, AVPacket *pkt, unsigned flags)
Called by demuxer tasks to communicate with their downstreams.
static void ts_discontinuity_detect(Demuxer *d, InputStream *ist, AVPacket *pkt)
@ PKT_OPAQUE_SUB_HEARTBEAT
@ AV_OPT_TYPE_INT
Underlying C type is int.
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
SpecifierOptList frame_sizes
static DemuxStream * ds_from_ist(InputStream *ist)
const AVInputFormat * av_find_input_format(const char *short_name)
Find AVInputFormat based on the short name of the input format.
static Demuxer * demux_alloc(void)
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
#define GROW_ARRAY(array, nb_elems)
const AVCodecHWConfig * avcodec_get_hw_config(const AVCodec *codec, int index)
Retrieve supported hardware configurations for a codec.
static int ist_dts_update(DemuxStream *ds, AVPacket *pkt, FrameData *fd)
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src)
Make a copy of a channel layout.
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set() that converts the value to a string and stores it.
SpecifierOptList codec_tags
char * av_strdup(const char *s)
Duplicate a string.
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
int av_bsf_list_parse_str(const char *str, AVBSFContext **bsf_lst)
Parse string describing list of bitstream filters and create single AVBSFContext describing the whole...
int avio_open2(AVIOContext **s, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options)
Create and initialize a AVIOContext for accessing the resource indicated by url.
@ DECODER_FLAG_TS_UNRELIABLE
int video_delay
Video only.
static void readrate_sleep(Demuxer *d)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple, const ViewSpecifier *vs, InputFilterOptions *opts, SchedulerNode *src)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
int64_t pos
byte position in stream, -1 if unknown
FrameData * packet_data(AVPacket *pkt)
static void ist_free(InputStream **pist)
#define flags(name, subs,...)
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
static int ts_fixup(Demuxer *d, AVPacket *pkt, FrameData *fd)
int avio_close(AVIOContext *s)
Close the resource accessed by the AVIOContext s and free it.
int64_t start_time
Position of the first frame of the component, in AV_TIME_BASE fractional seconds.
float dts_error_threshold
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define av_ts2str(ts)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
void av_pkt_dump_log2(void *avcl, int level, const AVPacket *pkt, int dump_payload, const AVStream *st)
Send a nice dump of a packet to the log.
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
static int do_send(Demuxer *d, DemuxStream *ds, AVPacket *pkt, unsigned flags, const char *pkt_desc)
const char * opt_match_per_type_str(const SpecifierOptList *sol, char mediatype)
void opt_match_per_stream_str(void *logctx, const SpecifierOptList *sol, AVFormatContext *fc, AVStream *st, const char **out)
int saw_first_ts
dts of the first packet read for this stream (in AV_TIME_BASE units)
SpecifierOptList guess_layout_max
int pts_wrap_bits
Number of bits in timestamps.
static int dump_attachment(InputStream *ist, const char *filename)
#define AVERROR_PROTOCOL_NOT_FOUND
Protocol not found.
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
enum AVHWDeviceType hwaccel_device_type
int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq, enum AVRounding rnd)
Rescale a 64-bit integer by 2 rational numbers with specified rounding.
SpecifierOptList bitstream_filters
static int input_thread(void *arg)
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
Copy the contents of src to dst.
AVRational time_base
Time base of the packet's timestamps.
SpecifierOptList top_field_first
static void thread_set_name(InputFile *f)
static int ff_thread_setname(const char *name)
enum AVCodecID subtitle_codec_id
Forced subtitle codec_id.