Author: stefano Date: Sun Oct 18 11:17:56 2009 New Revision: 5411 Log: Update to FFmpeg r20272.
Added: libavfilter/diffs/03_vfilters_doc.diff Deleted: libavfilter/doc/ Modified: libavfilter/checkout.sh libavfilter/diffs/01_ffplay_filters.diff libavfilter/diffs/02_ffmpeg_filters.diff libavfilter/vf_crop.c libavfilter/vf_null.c libavfilter/vf_overlay.c libavfilter/vf_scale.c libavfilter/vf_transpose.c libavfilter/vsrc_buffer.c libavfilter/vsrc_movie.c Modified: libavfilter/checkout.sh ============================================================================== --- libavfilter/checkout.sh Wed Oct 14 02:45:13 2009 (r5410) +++ libavfilter/checkout.sh Sun Oct 18 11:17:56 2009 (r5411) @@ -1,7 +1,7 @@ #! /bin/sh echo "checking out pristine ffmpeg" -svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk/ ffmpeg -r20198 +svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk/ ffmpeg -r20272 echo "downloading the corresponding version of swscale" cd ffmpeg/libswscale @@ -13,6 +13,3 @@ for diff in $(ls $(pwd)/diffs/*.diff); d echo "copying files to libavfilter" find $(pwd) -maxdepth 1 -type f -not -name $(basename $0) -exec cp {} ffmpeg/libavfilter \; - -echo "copying libavfilter doc files" -cp -p $(pwd)/doc/* ffmpeg/doc Modified: libavfilter/diffs/01_ffplay_filters.diff ============================================================================== --- libavfilter/diffs/01_ffplay_filters.diff Wed Oct 14 02:45:13 2009 (r5410) +++ libavfilter/diffs/01_ffplay_filters.diff Sun Oct 18 11:17:56 2009 (r5411) @@ -1,6 +1,6 @@ Index: ffplay.c =================================================================== ---- ffplay.c (revision 20198) +--- ffplay.c (revision 20272) +++ ffplay.c (working copy) @@ -29,6 +29,12 @@ #include "libavcodec/colorspace.h" @@ -288,15 +288,15 @@ Index: ffplay.c + + /* FIXME: until I figure out how to hook everything up to the codec + * right, we're just copying the entire frame. */ -+ picref = avfilter_get_video_buffer(link, AV_PERM_WRITE); ++ picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, link->w, link->h); + av_picture_copy((AVPicture *)&picref->data, (AVPicture *)priv->frame, -+ picref->pic->format, picref->w, picref->h); ++ picref->pic->format, link->w, link->h); + av_free_packet(&pkt); + + picref->pts = pts; + picref->pixel_aspect = priv->is->video_st->codec->sample_aspect_ratio; + avfilter_start_frame(link, avfilter_ref_pic(picref, ~0)); -+ avfilter_draw_slice(link, 0, picref->h); ++ avfilter_draw_slice(link, 0, link->h); + avfilter_end_frame(link); + avfilter_unref_pic(picref); + Modified: libavfilter/diffs/02_ffmpeg_filters.diff ============================================================================== --- libavfilter/diffs/02_ffmpeg_filters.diff Wed Oct 14 02:45:13 2009 (r5410) +++ libavfilter/diffs/02_ffmpeg_filters.diff Sun Oct 18 11:17:56 2009 (r5411) @@ -1,6 +1,6 @@ Index: ffmpeg.c =================================================================== ---- ffmpeg.c (revision 20198) +--- ffmpeg.c (revision 20272) +++ ffmpeg.c (working copy) @@ -41,6 +41,13 @@ #include "libavutil/avstring.h" Added: libavfilter/diffs/03_vfilters_doc.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ libavfilter/diffs/03_vfilters_doc.diff Sun Oct 18 11:17:56 2009 (r5411) @@ -0,0 +1,191 @@ +Index: doc/vfilters.texi +=================================================================== +--- doc/vfilters.texi (revision 20272) ++++ doc/vfilters.texi (working copy) +@@ -78,4 +78,186 @@ + + Below is a description of the currently available video filters. + +...@section crop ++ +...@example ++./ffmpeg -i in.avi -vfilters "crop=0:0:-1:240" out.avi +...@end example ++ ++Crop the input video to x:y:width:height. ++The -1 in width or height means that dimension in the input video. ++ +...@section drawbox ++ +...@example ++./ffmpeg -i in.avi -vfilters "drawbox=10:20:200:60:red" out.avi +...@end example ++ ++Draw a box with x:y:width:height dimensions in a chosen color. ++ +...@section fifo ++ +...@example ++./ffmpeg -i in.avi -vfilters "fifo" out.avi +...@end example ++ +...@section format ++ +...@example ++./ffmpeg -i in.avi -vfilters "format=yuv420p" out.avi +...@end example ++ ++Convert video to one of the specified filters formats (libavfilter will ++try to pick one that is supported as an input to the next filter). ++ +...@section fps ++ +...@example ++./ffmpeg -i in.avi -vfilters "fps=30000:1001" out.avi +...@end example ++ ++Modifies the framerate of the input video to a chosen one. ++ +...@section hflip ++ +...@example ++./ffmpeg -i in.avi -vfilters "hflip" out.avi +...@end example ++ ++Flip the video horizontally. ++ +...@section negate ++ +...@example ++./ffmpeg -i in.avi -vfilters "negate" out.avi +...@end example ++ ++Convert a video to its negative. ++ +...@section noformat ++ +...@example ++./ffmpeg -i in.avi -vfilters "noformat=yuv420p" out.avi +...@end example ++ ++Force libavfilter not to send any of the specified pixel formats to the ++next filter. ++ +...@section overlay ++ ++Overlay one video on top of another (see the example in the introduction ++section). ++Be aware that frames are taken ++from each input video in timestamp order, hence, if their initial ++timestamps differ, it is a a good idea to pass the two ++inputs through a @var{setpts=PTS-STARTPTS} filter to have them ++begin in the same zero timestamp, as it does the example for ++the @var{movie} filter. ++ ++Parameters to the filter are separated by a colon. The first parameter ++is the x coordinate of the overlay, the second parameter is the y ++coordinate. The parameters need not be constant expressions, but may ++be expressions containing the names @var{mainW}, @var{mainH}, +...@var{overlayw} and @var{overlayH}, for the size of the first and second ++input video, respectively. For example, +...@example ++overlay=mainW-overlayW-10:mainH-overlayH-10 +...@end example ++can be used to draw the overlay at 10 pixels from the bottom right ++corner of the main video. ++ +...@section rotate ++ +...@example ++./ffmpeg -i in.avi -vfilters "rotate=30" out.avi +...@end example ++ ++Rotate video by a chosen amount in degrees. By default, 45 degrees. ++ +...@section scale ++ +...@example ++./ffmpeg -i in.avi -vfilters "scale=200:100:sws_flags=bicubic" out.avi +...@end example ++ ++Scale to new width/height and/or convert pixel format. ++The two first parameter are the desired width and height. ++If the third parameter @var{sws_flags} is absent, then @var{bilinear} is assumed. ++ +...@section setpts ++ +...@example ++# Start counting PTS from zero ++ffmpeg -i input.avi -vfilters setpts=PTS-STARTPTS output.avi ++ ++# Fast motion ++ffmpeg -i input.avi -vfilters setpts=0.5*PTS output.avi ++ ++# Fixed rate 25 fps ++ffmpeg -i input.avi -vfilters setpts=N*AVTB/25 output.avi ++ ++# Fixed rate 25 fps with some jitter ++ffmpeg -i input.avi -vfilters 'setpts=AVTB/25*(N+0.05*sin(N*2*PI/25))' output.avi +...@end example ++ ++Modifies the presentation timestamp (PTS) of the input video. ++ +...@section slicify ++ +...@example ++./ffmpeg -i in.avi -vfilters "slicify=32" out.avi +...@end example ++ ++Pass on input video to next video filter as multiple slices. ++The parameter is the slice height (16 if not specified). ++Adding this in the beginning of filter chains should make filtering ++faster due to the better use of the memory cache. ++ +...@section split ++ ++See the example in the introduction section. ++The input video is passed on to two outputs. ++ +...@section transpose ++ +...@example ++./ffmpeg -i in.avi -vfilters "transpose" out.avi +...@end example ++ ++Transpose (line => column) input video to next video filter. ++ +...@section vflip ++ +...@example ++./ffmpeg -i in.avi -vfilters "vflip" out.avi +...@end example ++ ++Flip the video vertically. ++ +...@section buffer ++ ++This input filter is used by the client application to feed pictures to ++the filter chain. See ffmpeg.c for an usage example. ++ +...@section movie ++ ++The parameters of the movie filter are +...@example ++ seekpoint in microseconds : string format : string filename +...@end example ++ ++We can overlay a second movie on top of a main one as in this graph: ++ +...@example ++ input -----------> deltapts0 --> overlay --> output ++ ^ ++ movie --> scale--> deltapts1 ------| +...@end example ++ ++To do that ++ +...@example ++ffmpeg -i in.avi -s 240x320 -vfilters "[in]setpts=PTS-STARTPTS, [T1]overlay=16:16[out]; movie=3200000:avi:in.avi, scale=180:144, setpts=PTS-STARTPTS[T1]" -y out.avi +...@end example ++ + @bye Modified: libavfilter/vf_crop.c ============================================================================== --- libavfilter/vf_crop.c Wed Oct 14 02:45:13 2009 (r5410) +++ libavfilter/vf_crop.c Sun Oct 18 11:17:56 2009 (r5411) @@ -99,6 +99,11 @@ static int config_output(AVFilterLink *l return 0; } +static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms, int w, int h) +{ + return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h); +} + static void start_frame(AVFilterLink *link, AVFilterPicRef *picref) { CropContext *crop = link->dst->priv; @@ -150,6 +155,7 @@ AVFilter avfilter_vf_crop = .type = CODEC_TYPE_VIDEO, .start_frame = start_frame, .draw_slice = draw_slice, + .get_video_buffer= get_video_buffer, .config_props = config_input, }, { .name = NULL}}, .outputs = (AVFilterPad[]) {{ .name = "default", Modified: libavfilter/vf_null.c ============================================================================== --- libavfilter/vf_null.c Wed Oct 14 02:45:13 2009 (r5410) +++ libavfilter/vf_null.c Sun Oct 18 11:17:56 2009 (r5411) @@ -29,6 +29,11 @@ static void start_frame(AVFilterLink *in avfilter_start_frame(in_link->dst->outputs[0], picref); } +static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms, int w, int h) +{ + return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h); +} + static void end_frame(AVFilterLink *in_link) { avfilter_end_frame(in_link->dst->outputs[0]); @@ -42,6 +47,7 @@ AVFilter avfilter_vf_null = .inputs = (AVFilterPad[]) {{ .name = "default", .type = CODEC_TYPE_VIDEO, + .get_video_buffer= get_video_buffer, .start_frame = start_frame, .end_frame = end_frame }, { .name = NULL}}, Modified: libavfilter/vf_overlay.c ============================================================================== --- libavfilter/vf_overlay.c Wed Oct 14 02:45:13 2009 (r5410) +++ libavfilter/vf_overlay.c Sun Oct 18 11:17:56 2009 (r5411) @@ -249,7 +249,7 @@ static int request_frame(AVFilterLink *l } /* we draw the output frame */ - pic = avfilter_get_video_buffer(link, AV_PERM_WRITE); + pic = avfilter_get_video_buffer(link, AV_PERM_WRITE, link->w, link->h); if(over->pics[0][0]) { pic->pixel_aspect = over->pics[0][0]->pixel_aspect; copy_image(pic, 0, 0, over->pics[0][0], link->w, link->h, Modified: libavfilter/vf_scale.c ============================================================================== --- libavfilter/vf_scale.c Wed Oct 14 02:45:13 2009 (r5410) +++ libavfilter/vf_scale.c Sun Oct 18 11:17:56 2009 (r5411) @@ -99,6 +99,11 @@ static int query_formats(AVFilterContext return 0; } +static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms, int w, int h) +{ + return avfilter_default_get_video_buffer(link, perms, w, h); +} + static int config_props(AVFilterLink *link) { ScaleContext *scale = link->src->priv; @@ -130,7 +135,7 @@ static void start_frame(AVFilterLink *li AVFilterLink *out = link->dst->outputs[0]; int64_t gcd; - out->outpic = avfilter_get_video_buffer(out, AV_PERM_WRITE); + out->outpic = avfilter_get_video_buffer(out, AV_PERM_WRITE, out->w, out->h); out->outpic->pts = picref->pts; out->outpic->pixel_aspect.num = picref->pixel_aspect.num * out->h * link->w; @@ -188,6 +193,7 @@ AVFilter avfilter_vf_scale = .inputs = (AVFilterPad[]) {{ .name = "default", .type = CODEC_TYPE_VIDEO, + .get_video_buffer= get_video_buffer, .start_frame = start_frame, .draw_slice = draw_slice, .min_perms = AV_PERM_READ, }, Modified: libavfilter/vf_transpose.c ============================================================================== --- libavfilter/vf_transpose.c Wed Oct 14 02:45:13 2009 (r5410) +++ libavfilter/vf_transpose.c Sun Oct 18 11:17:56 2009 (r5411) @@ -90,7 +90,7 @@ static void start_frame(AVFilterLink *li { AVFilterLink *out = link->dst->outputs[0]; - out->outpic = avfilter_get_video_buffer(out, AV_PERM_WRITE); + out->outpic = avfilter_get_video_buffer(out, AV_PERM_WRITE, link->w, link->h); out->outpic->pts = picref->pts; out->outpic->pixel_aspect.num = picref->pixel_aspect.den; Modified: libavfilter/vsrc_buffer.c ============================================================================== --- libavfilter/vsrc_buffer.c Wed Oct 14 02:45:13 2009 (r5410) +++ libavfilter/vsrc_buffer.c Sun Oct 18 11:17:56 2009 (r5411) @@ -96,15 +96,16 @@ static int request_frame(AVFilterLink *l /* This picture will be needed unmodified later for decoding the next * frame */ picref = avfilter_get_video_buffer(link, AV_PERM_WRITE | AV_PERM_PRESERVE | - AV_PERM_REUSE2); + AV_PERM_REUSE2, + link->w, link->h); - memcpy(picref->data , c->frame.data , sizeof(c->frame.data )); - memcpy(picref->linesize, c->frame.linesize, sizeof(c->frame.linesize)); + av_picture_copy((AVPicture *)&picref->data, (AVPicture *)&c->frame, + picref->pic->format, link->w, link->h); picref->pts = c->pts; picref->pixel_aspect = c->pixel_aspect; avfilter_start_frame(link, avfilter_ref_pic(picref, ~0)); - avfilter_draw_slice(link, 0, picref->h); + avfilter_draw_slice(link, 0, link->h); avfilter_end_frame(link); avfilter_unref_pic(picref); Modified: libavfilter/vsrc_movie.c ============================================================================== --- libavfilter/vsrc_movie.c Wed Oct 14 02:45:13 2009 (r5410) +++ libavfilter/vsrc_movie.c Sun Oct 18 11:17:56 2009 (r5411) @@ -177,7 +177,8 @@ int movie_get_frame(AVFilterLink *link) if(!mv->pic) mv->pic = avfilter_get_video_buffer(link, AV_PERM_WRITE | AV_PERM_PRESERVE | - AV_PERM_REUSE2); + AV_PERM_REUSE2, + link->w, link->h); //av_log(link->src, AV_LOG_INFO, "movie_get_frame() w:%d h:%d\n", mv->w, mv->h); // Get frame _______________________________________________ FFmpeg-soc mailing list FFmpeg-soc@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc