FFmpeg
Loading...
Searching...
No Matches
setts.c File Reference

Change the PTS/DTS timestamps. More...

#include "libavutil/opt.h"
#include "libavutil/eval.h"
#include "libavcodec/bsf.h"
#include "libavcodec/bsf_internal.h"

Go to the source code of this file.

Data Structures

struct  SetTSContext
 

Macros

#define PRESCALED(x)
 
#define OFFSET(x)
 
#define FLAGS   (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_SUBTITLE_PARAM|AV_OPT_FLAG_BSF_PARAM)
 

Enumerations

enum  var_name {
  VAR_N , VAR_TS , VAR_POS , VAR_PREV_INPTS ,
  VAR_PREV_INDTS , VAR_PREV_INDUR , VAR_PREV_OUTPTS , VAR_PREV_OUTDTS ,
  VAR_PREV_OUTDUR , VAR_NEXT_PTS , VAR_NEXT_DTS , VAR_NEXT_DUR ,
  VAR_PTS , VAR_DTS , VAR_DURATION , VAR_STARTPTS ,
  VAR_STARTDTS , VAR_TB , VAR_TB_OUT , VAR_SR ,
  VAR_NOPTS , VAR_VARS_NB
}
 

Functions

static int setts_init (AVBSFContext *ctx)
 
static int setts_filter (AVBSFContext *ctx, AVPacket *pkt)
 
static void setts_close (AVBSFContext *bsf)
 

Variables

static const char *const var_names []
 
static const AVOption options []
 
static const AVClass setts_class
 
const FFBitStreamFilter ff_setts_bsf
 

Detailed Description

Change the PTS/DTS timestamps.

Definition in file setts.c.

Macro Definition Documentation

◆ PRESCALED

#define PRESCALED ( x)
Value:
( s->prescale ? av_rescale_q(x, ctx->time_base_in, ctx->time_base_out) : x )
#define s(width, name)
Definition cbs_vp9.c:198
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
static AVFormatContext * ctx
Definition movenc.c:49

Definition at line 171 of file setts.c.

Referenced by setts_filter().

◆ OFFSET

#define OFFSET ( x)
Value:
offsetof(SetTSContext, x)

Definition at line 271 of file setts.c.

◆ FLAGS

Enumeration Type Documentation

◆ var_name

enum var_name
Enumerator
VAR_N 
VAR_TS 
VAR_POS 
VAR_PREV_INPTS 
VAR_PREV_INDTS 
VAR_PREV_INDUR 
VAR_PREV_OUTPTS 
VAR_PREV_OUTDTS 
VAR_PREV_OUTDUR 
VAR_NEXT_PTS 
VAR_NEXT_DTS 
VAR_NEXT_DUR 
VAR_PTS 
VAR_DTS 
VAR_DURATION 
VAR_STARTPTS 
VAR_STARTDTS 
VAR_TB 
VAR_TB_OUT 
VAR_SR 
VAR_NOPTS 
VAR_VARS_NB 

Definition at line 57 of file setts.c.

Function Documentation

◆ setts_init()

static int setts_init ( AVBSFContext * ctx)
static

Definition at line 108 of file setts.c.

◆ setts_filter()

static int setts_filter ( AVBSFContext * ctx,
AVPacket * pkt )
static

Definition at line 173 of file setts.c.

◆ setts_close()

static void setts_close ( AVBSFContext * bsf)
static

Definition at line 253 of file setts.c.

Variable Documentation

◆ var_names

const char* const var_names[]
static
Initial value:
= {
"N",
"TS",
"POS",
"PREV_INPTS",
"PREV_INDTS",
"PREV_INDURATION",
"PREV_OUTPTS",
"PREV_OUTDTS",
"PREV_OUTDURATION",
"NEXT_PTS",
"NEXT_DTS",
"NEXT_DURATION",
"PTS",
"DTS",
"DURATION",
"STARTPTS",
"STARTDTS",
"TB",
"TB_OUT",
"SR",
"NOPTS",
}
#define NULL
Definition coverity.c:32

Definition at line 32 of file setts.c.

◆ options

const AVOption options[]
static
Initial value:
= {
{ "ts", "set expression for packet PTS and DTS", OFFSET(ts_str), AV_OPT_TYPE_STRING, {.str="TS"}, 0, 0, FLAGS },
{ "pts", "set expression for packet PTS", OFFSET(pts_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
{ "dts", "set expression for packet DTS", OFFSET(dts_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
{ "duration", "set expression for packet duration", OFFSET(duration_str), AV_OPT_TYPE_STRING, {.str="DURATION"}, 0, 0, FLAGS },
{ "time_base", "set output timebase", OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX, FLAGS },
{ "prescale", "convert to output timebase before evaluation", OFFSET(prescale), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ NULL },
}
#define FLAGS
Definition cmdutils.c:598
static const FLOAT prescale[64]
Definition faanidct.c:40
#define OFFSET(x)
@ AV_OPT_TYPE_RATIONAL
Underlying C type is AVRational.
Definition opt.h:279
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275
static void ts_str(char buffer[60], int64_t ts, AVRational base)
Definition seek.c:47

Definition at line 274 of file setts.c.

◆ setts_class

const AVClass setts_class
static
Initial value:
= {
.class_name = "setts_bsf",
.item_name = av_default_item_name,
.option = options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 284 of file setts.c.

◆ ff_setts_bsf

const FFBitStreamFilter ff_setts_bsf
Initial value:
= {
.p.name = "setts",
.p.priv_class = &setts_class,
.priv_data_size = sizeof(SetTSContext),
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
static int setts_init(AVBSFContext *ctx)
Definition setts.c:108
static const AVClass setts_class
Definition setts.c:284
static int setts_filter(AVBSFContext *ctx, AVPacket *pkt)
Definition setts.c:173
static void setts_close(AVBSFContext *bsf)
Definition setts.c:253
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
Definition h263dsp.c:29

Definition at line 291 of file setts.c.