112 #define OFFSET(x) offsetof(TrimContext, x)
113 #define COMMON_OPTS \
114 { "start", "Timestamp in seconds of the first frame that " \
115 "should be passed", OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX }, -DBL_MAX, DBL_MAX, FLAGS }, \
116 { "end", "Timestamp in seconds of the first frame that " \
117 "should be dropped again", OFFSET(end_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX }, -DBL_MAX, DBL_MAX, FLAGS }, \
118 { "start_pts", "Timestamp of the first frame that should be " \
119 " passed", OFFSET(start_pts), AV_OPT_TYPE_INT64, { .i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, FLAGS }, \
120 { "end_pts", "Timestamp of the first frame that should be " \
121 "dropped again", OFFSET(end_pts), AV_OPT_TYPE_INT64, { .i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, FLAGS }, \
122 { "duration", "Maximum duration of the output in seconds", OFFSET(duration), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, 0, DBL_MAX, FLAGS },
125 #if CONFIG_TRIM_FILTER
180 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
181 static const AVOption trim_options[] = {
183 {
"start_frame",
"Number of the first frame that should be passed "
185 {
"end_frame",
"Number of the first frame that should be dropped "
197 .filter_frame = trim_filter_frame,
214 .description =
NULL_IF_CONFIG_SMALL(
"Pick one continuous section from the input, drop the rest."),
219 .priv_class = &trim_class,
224 #endif // CONFIG_TRIM_FILTER
226 #if CONFIG_ATRIM_FILTER
231 int64_t start_sample, end_sample = frame->
nb_samples;
305 start_sample =
FFMAX(0, start_sample);
337 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
338 static const AVOption atrim_options[] = {
340 {
"start_sample",
"Number of the first audio sample that should be "
342 {
"end_sample",
"Number of the first audio sample that should be "
354 .filter_frame = atrim_filter_frame,
371 .description =
NULL_IF_CONFIG_SMALL(
"Pick one continuous section from the input, drop the rest."),
376 .priv_class = &atrim_class,
381 #endif // CONFIG_ATRIM_FILTER