37 NDIlib_audio_frame_interleaved_16s_t *
audio;
77 av_log(avctx,
AV_LOG_ERROR,
"tmp->width=%d, tmp->height=%d, ctx->video->xres=%d, ctx->video->yres=%d\n",
89 ctx->
video->p_data = (
void *)(avframe->
data[0]);
91 av_log(avctx,
AV_LOG_DEBUG,
"%s: pkt->pts=%"PRId64
", timecode=%"PRId64
", st->time_base=%d/%d\n",
110 ctx->
audio->no_samples = pkt->
size / (ctx->
audio->no_channels << 1);
112 av_log(avctx,
AV_LOG_DEBUG,
"%s: pkt->pts=%"PRId64
", timecode=%"PRId64
", st->time_base=%d/%d\n",
115 NDIlib_util_send_send_audio_interleaved_16s(ctx->
ndi_send, ctx->
audio);
167 " Only AV_CODEC_ID_WRAPPED_AVFRAME is supported (-vcodec wrapped_avframe).\n");
175 " Only AV_PIX_FMT_UYVY422, AV_PIX_FMT_BGRA, AV_PIX_FMT_BGR0," 176 " AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB0 is supported.\n");
191 ctx->
video->FourCC = NDIlib_FourCC_type_UYVY;
194 ctx->
video->FourCC = NDIlib_FourCC_type_BGRA;
197 ctx->
video->FourCC = NDIlib_FourCC_type_BGRX;
200 ctx->
video->FourCC = NDIlib_FourCC_type_RGBA;
203 ctx->
video->FourCC = NDIlib_FourCC_type_RGBX;
212 ? NDIlib_frame_format_type_progressive
213 : NDIlib_frame_format_type_interleaved;
221 ctx->
video->picture_aspect_ratio =
av_q2d(display_aspect_ratio);
236 const NDIlib_send_create_t ndi_send_desc = { .p_ndi_name = avctx->
url,
239 if (!NDIlib_initialize()) {
261 ctx->
ndi_send = NDIlib_send_create(&ndi_send_desc);
271 #define OFFSET(x) offsetof(struct NDIContext, x) 288 .
name =
"libndi_newtek",
289 .long_name =
NULL_IF_CONFIG_SMALL(
"Network Device Interface (NDI) output using NewTek library"),
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
enum AVFieldOrder field_order
Video only.
This structure describes decoded (raw) audio or video data.
#define LIBAVUTIL_VERSION_INT
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
#define AV_OPT_FLAG_AUDIO_PARAM
const char * av_default_item_name(void *ptr)
Return the context name.
static int ndi_write_header(AVFormatContext *avctx)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
This struct describes the properties of an encoded stream.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
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
AVStream ** streams
A list of all streams in the file.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
static int ndi_write_packet(AVFormatContext *avctx, AVPacket *pkt)
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
static int ndi_write_trailer(AVFormatContext *avctx)
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
char * url
input or output URL.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
enum AVMediaType codec_type
General type of the encoded data.
AVRational avg_frame_rate
Average framerate.
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
NDIlib_video_frame_t * video
static const AVOption options[]
Passthrough codec, AVFrames wrapped in AVPacket.
static void error(const char *err)
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
NDIlib_audio_frame_interleaved_16s_t * audio
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
#define AV_OPT_FLAG_VIDEO_PARAM
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
static int ndi_setup_audio(AVFormatContext *avctx, AVStream *st)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int sample_rate
Audio only.
static const AVClass libndi_newtek_muxer_class
void * priv_data
Format private data.
static int ndi_write_audio_packet(AVFormatContext *avctx, AVStream *st, AVPacket *pkt)
static int ndi_write_video_packet(AVFormatContext *avctx, AVStream *st, AVPacket *pkt)
NDIlib_send_instance_t ndi_send
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
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
AVOutputFormat ff_libndi_newtek_muxer
static int ndi_setup_video(AVFormatContext *avctx, AVStream *st)
#define AVERROR_EXTERNAL
Generic error in an external library.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...