[FFmpeg-devel] [PATCH] vf_fps: when reading EOF, using current_pts to duplicate the last frame if needed.

Michael Niedermayer michael at niedermayer.cc
Wed Sep 13 03:46:00 EEST 2017


On Mon, Sep 11, 2017 at 06:25:08PM -0700, Thierry Foucu wrote:
> Fix ticket #2674
> Tested with examples from ticket 2674.
> ---
> 
> Update the Patch with the correct number of duplicate showing.
> For exmaple, in case we up-sample one second video at 24fps by 2, we should be getting 24 duplicate frames.
> 
> ffmpeg -loglevel verbose -i 24fps.avi -vf fps=48 -f null -
> ffmpeg version N-87234-g9a32769f5e Copyright (c) 2000-2017 the FFmpeg developers
>   built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
>   configuration: 
>   libavutil      55. 74.100 / 55. 74.100
>   libavcodec     57.105.100 / 57.105.100
>   libavformat    57. 81.100 / 57. 81.100
>   libavdevice    57.  8.100 / 57.  8.100
>   libavfilter     6.103.100 /  6.103.100
>   libswscale      4.  7.103 /  4.  7.103
>   libswresample   2.  8.100 /  2.  8.100
> Input #0, avi, from '24fps.avi':
>   Metadata:
>     encoder         : Lavf57.81.100
>   Duration: 00:00:01.00, start: 0.000000, bitrate: 368 kb/s
>     Stream #0:0: Video: mpeg4 (Simple Profile), 1 reference frame (FMP4 / 0x34504D46), yuv420p(left), 320x240 [SAR 1:1 DAR 4:3], 24 fps, 24 tbr, 24 tbn, 24 tbc
> Stream mapping:
>   Stream #0:0 -> #0:0 (mpeg4 (native) -> wrapped_avframe (native))
> Press [q] to stop, [?] for help
> [Parsed_fps_0 @ 0x25ea6a0] fps=48/1
> [graph 0 input from stream 0:0 @ 0x275cc00] w:320 h:240 pixfmt:yuv420p tb:1/24 fr:24/1 sar:1/1 sws_param:flags=2
> Output #0, null, to 'pipe:':
>   Metadata:
>     encoder         : Lavf57.81.100
>     Stream #0:0: Video: wrapped_avframe, 1 reference frame, yuv420p(left), 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 48 fps, 48 tbn, 48 tbc
>     Metadata:
>       encoder         : Lavc57.105.100 wrapped_avframe
> No more output streams to write to, finishing.
> frame=   48 fps=0.0 q=-0.0 Lsize=N/A time=00:00:01.00 bitrate=N/A speed=99.3x    
> video:25kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
> Input file #0 (24fps.avi):
>   Input stream #0:0 (video): 24 packets read (39693 bytes); 24 frames decoded; 
>   Total: 24 packets (39693 bytes) demuxed
> Output file #0 (pipe:):
>   Output stream #0:0 (video): 48 frames encoded; 48 packets muxed (25344 bytes); 
>   Total: 48 packets (25344 bytes) muxed
> [Parsed_fps_0 @ 0x25ea6a0] 24 frames in, 48 frames out; 0 frames dropped, 24 frames duplicated.
> 
>  libavfilter/vf_fps.c        | 44 +++++++++++++++++++++++++++++++++++++++-----
>  tests/ref/fate/filter-fps   |  6 ++++++
>  tests/ref/fate/filter-fps-r |  4 ++++
>  tests/ref/fate/m4v-cfr      |  1 -
>  4 files changed, 49 insertions(+), 6 deletions(-)

this breaks "make fate"

--- ./tests/ref/fate/filter-mpdecimate  2017-09-13 02:17:33.572000292 +0200
+++ tests/data/fate/filter-mpdecimate   2017-09-13 02:33:35.508011763 +0200
@@ -22,4 +22,3 @@
 0,         24,         24,        1,   115200, 0x056d40ca
 0,         26,         26,        1,   115200, 0xa4374737
 0,         27,         27,        1,   115200, 0x3eaa3ae8
-0,         29,         29,        1,   115200, 0x7551e9ee
Test filter-mpdecimate failed. Look at tests/data/fate/filter-mpdecimate.err for details.
make: *** [fate-filter-mpdecimate] Error 1
make: *** Waiting for unfinished jobs....


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170913/277d8787/attachment.sig>


More information about the ffmpeg-devel mailing list