|
FFmpeg
|
muxing functions for use within libavformat More...
#include "avformat.h"#include "avio_internal.h"#include "internal.h"#include "libavcodec/internal.h"#include "libavcodec/bytestream.h"#include "libavutil/opt.h"#include "libavutil/dict.h"#include "libavutil/pixdesc.h"#include "libavutil/timestamp.h"#include "metadata.h"#include "id3v2.h"#include "libavutil/avassert.h"#include "libavutil/avstring.h"#include "libavutil/internal.h"#include "libavutil/mathematics.h"#include "libavutil/parseutils.h"#include "libavutil/time.h"#include "riff.h"#include "audiointerleave.h"#include "url.h"#include <stdarg.h>Macros | |
| #define | AV_PKT_FLAG_UNCODED_FRAME 0x2000 |
| #define | UNCODED_FRAME_PACKET_SIZE (INT_MIN / 3 * 2 + (int)sizeof(AVFrame)) |
| #define | CHUNK_START 0x1000 |
Functions | |
| AVRational | ff_choose_timebase (AVFormatContext *s, AVStream *st, int min_precision) |
| Chooses a timebase for muxing the specified stream. More... | |
| enum AVChromaLocation | ff_choose_chroma_location (AVFormatContext *s, AVStream *st) |
| Chooses a timebase for muxing the specified stream. | |
| int | avformat_alloc_output_context2 (AVFormatContext **avctx, AVOutputFormat *oformat, const char *format, const char *filename) |
| Allocate an AVFormatContext for an output format. More... | |
| int | avformat_init_output (AVFormatContext *s, AVDictionary **options) |
| Allocate the stream private data and initialize the codec, but do not write the header. More... | |
| int | avformat_write_header (AVFormatContext *s, AVDictionary **options) |
| Allocate the stream private data and write the stream header to an output media file. More... | |
| int | av_write_frame (AVFormatContext *s, AVPacket *pkt) |
| Write a packet to an output media file. More... | |
| int | ff_interleave_add_packet (AVFormatContext *s, AVPacket *pkt, int(*compare)(AVFormatContext *, AVPacket *, AVPacket *)) |
| Add packet to AVFormatContext->packet_buffer list, determining its interleaved position using compare() function argument. More... | |
| int | ff_interleave_packet_per_dts (AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush) |
| Interleave a packet per dts in an output media file. More... | |
| int | ff_interleaved_peek (AVFormatContext *s, int stream, AVPacket *pkt, int add_offset) |
| Find the next packet in the interleaving queue for the given stream. More... | |
| int | av_interleaved_write_frame (AVFormatContext *s, AVPacket *pkt) |
| Write a packet to an output media file ensuring correct interleaving. More... | |
| int | av_write_trailer (AVFormatContext *s) |
| Write the stream trailer to an output media file and free the file private data. More... | |
| int | av_get_output_timestamp (struct AVFormatContext *s, int stream, int64_t *dts, int64_t *wall) |
| Get timing information for the data currently output. More... | |
| int | ff_write_chained (AVFormatContext *dst, int dst_stream, AVPacket *pkt, AVFormatContext *src, int interleave) |
| Write a packet to another muxer than the one the user originally intended. More... | |
| int | av_write_uncoded_frame (AVFormatContext *s, int stream_index, AVFrame *frame) |
| Write an uncoded frame to an output media file. More... | |
| int | av_interleaved_write_uncoded_frame (AVFormatContext *s, int stream_index, AVFrame *frame) |
| Write an uncoded frame to an output media file. More... | |
| int | av_write_uncoded_frame_query (AVFormatContext *s, int stream_index) |
| Test whether a muxer supports uncoded frame. More... | |
muxing functions for use within libavformat
| int avformat_alloc_output_context2 | ( | AVFormatContext ** | ctx, |
| AVOutputFormat * | oformat, | ||
| const char * | format_name, | ||
| const char * | filename | ||
| ) |
Allocate an AVFormatContext for an output format.
avformat_free_context() can be used to free the context and everything allocated by the framework within it.
| *ctx | is set to the created format context, or to NULL in case of failure |
| oformat | format to use for allocating the context, if NULL format_name and filename are used instead |
| format_name | the name of output format to use for allocating the context, if NULL filename is used instead |
| filename | the name of the filename to use for allocating the context, may be NULL |
| AVRational ff_choose_timebase | ( | AVFormatContext * | s, |
| AVStream * | st, | ||
| int | min_precision | ||
| ) |
Chooses a timebase for muxing the specified stream.
The chosen timebase allows sample accurate timestamps based on the framerate or sample rate for audio streams. It also is at least as precise as 1/min_precision would be.
| int ff_interleave_add_packet | ( | AVFormatContext * | s, |
| AVPacket * | pkt, | ||
| int(*)(AVFormatContext *, AVPacket *, AVPacket *) | compare | ||
| ) |
Add packet to AVFormatContext->packet_buffer list, determining its interleaved position using compare() function argument.
| int ff_interleave_packet_per_dts | ( | AVFormatContext * | s, |
| AVPacket * | out, | ||
| AVPacket * | pkt, | ||
| int | flush | ||
| ) |
Interleave a packet per dts in an output media file.
Packets with pkt->destruct == av_destruct_packet will be freed inside this function, so they cannot be used after it. Note that calling av_packet_unref() on them is still safe.
| s | media file handle |
| out | the interleaved packet will be output here |
| pkt | the input packet |
| flush | 1 if no further packets are available as input and all remaining packets should be output |
| int ff_interleaved_peek | ( | AVFormatContext * | s, |
| int | stream, | ||
| AVPacket * | pkt, | ||
| int | add_offset | ||
| ) |
Find the next packet in the interleaving queue for the given stream.
The pkt parameter is filled in with the queued packet, including references to the data (which the caller is not allowed to keep or modify).
| int ff_write_chained | ( | AVFormatContext * | dst, |
| int | dst_stream, | ||
| AVPacket * | pkt, | ||
| AVFormatContext * | src, | ||
| int | interleave | ||
| ) |
Write a packet to another muxer than the one the user originally intended.
Useful when chaining muxers, where one muxer internally writes a received packet to another muxer.
| dst | the muxer to write the packet to |
| dst_stream | the stream index within dst to write the packet to |
| pkt | the packet to be written |
| src | the muxer the packet originally was intended for |
| interleave | 0->use av_write_frame, 1->av_interleaved_write_frame |
1.8.12