[FFmpeg-devel] [PATCH] ffmpeg: redesign video resampling in case of mid-stream video size/format change

Stefano Sabatini stefano.sabatini-lala at poste.it
Fri Apr 22 10:51:35 CEST 2011


On date Thursday 2011-04-21 12:48:15 +0200, Stefano Sabatini encoded:
> On date Wednesday 2011-04-20 01:24:28 +0200, Michael Niedermayer encoded:
[...]
> > breaks stream copy
> > ffmpeg -i ~/videos/matrixbench_mpeg2.mpg -vcodec copy tmp.avi
> > [IMGUTILS @ 0x7fff8c6a1b70] Picture size 0x0 is invalid
> > Cannot allocate temp picture, check pix fmt
> 
> Fixed by the pre_process_video_frmae() patch already applied.
> 
> Patch updated.
> -- 
> FFmpeg = Frenzy and Faithful Mastodontic Philosofic Ecumenical Gem

> From 648239f2e80278e04b3c78b4013abe30b332d2ef Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Sat, 16 Apr 2011 23:14:44 +0200
> Subject: [PATCH] ffmpeg: redesign video resampling in case of mid-stream video size/format change
> 
> The new design supports video resolution/format change with and
> without AVFILTER_CONFIG, thus avoiding the need for the
> av_vsrc_buffer_add_frame2() hack.
> 
> When a change in video resolution/format is detected, a scaling
> context is lazily initialized, and used for rescaling the input video
> to the initial destination size/format.
> 
> The rescaling/conversion is moved from do_video_out() to
> pre_process_video_frame(), and all the resampling/conversion structs
> are moved from AVOutputStream to AVInputStream. Conversion is now
> performed *just after decoding*, and before feeding either the encoder
> (in case libavfilter is not enabled) or the filterchain source.
> 
> Tested with files:
> all_filese_together.avi
> crash_pirateszz_2_s25_r003.fuzz.sample
> kgv1.avi
> res_change_ffmpeg_aspect.ts
> resolutionchange.mpg
> size_change.nsv
> 
> Fix issues:
> roundup #2217
> trac #59
> trac #64
> trac #74
> 
> Signed-off-by: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> ---
>  ffmpeg.c |  185 ++++++++++++++++++++++++++++++--------------------------------
>  1 files changed, 90 insertions(+), 95 deletions(-)

Ping.
-- 
FFmpeg = Fanciful and Forgiving Miracolous Practical Extensive Goblin


More information about the ffmpeg-devel mailing list