Please find attached new patch. I tried it against ticket 2674 and it seems to work Here are the output:
For the up-sample, getting 48 frames out, instead of 47 ------------------------------ ./ffmpeg -loglevel verbose -i 24fps.avi -vf fps=48 -y 48fps.avi 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) -> mpeg4 (native)) Press [q] to stop, [?] for help [Parsed_fps_0 @ 0x34ea4a0] fps=48/1 [graph 0 input from stream 0:0 @ 0x365ca20] w:320 h:240 pixfmt:yuv420p tb:1/24 fr:24/1 sar:1/1 sws_param:flags=2 Output #0, avi, to '48fps.avi': Metadata: ISFT : Lavf57.81.100 Stream #0:0: Video: mpeg4, 1 reference frame (FMP4 / 0x34504D46), 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 mpeg4 Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1 No more output streams to write to, finishing. frame= 48 fps=0.0 q=2.0 Lsize= 67kB time=00:00:01.00 bitrate= 552.9kbits/s speed=28.2x video:61kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 11.158647% 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 (48fps.avi): Output stream #0:0 (video): 48 frames encoded; 48 packets muxed (62176 bytes); Total: 48 packets (62176 bytes) muxed [Parsed_fps_0 @ 0x34ea4a0] 24 frames in, 48 frames out; 0 frames dropped, 23 frames duplicated. ------------------------------ For down-sample, getting 12 frames out instead of 13 ----------------------------- ./ffmpeg -loglevel verbose -i 24fps.avi -vf fps=12 -y 12fps.avi 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) -> mpeg4 (native)) Press [q] to stop, [?] for help [Parsed_fps_0 @ 0x304e4a0] fps=12/1 [graph 0 input from stream 0:0 @ 0x31c0aa0] w:320 h:240 pixfmt:yuv420p tb:1/24 fr:24/1 sar:1/1 sws_param:flags=2 Output #0, avi, to '12fps.avi': Metadata: ISFT : Lavf57.81.100 Stream #0:0: Video: mpeg4, 1 reference frame (FMP4 / 0x34504D46), yuv420p(left), 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 12 fps, 12 tbn, 12 tbc Metadata: encoder : Lavc57.105.100 mpeg4 Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1 No more output streams to write to, finishing. frame= 12 fps=0.0 q=2.0 Lsize= 26kB time=00:00:01.00 bitrate= 211.3kbits/s speed=39.8x video:20kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 29.731853% 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 (12fps.avi): Output stream #0:0 (video): 12 frames encoded; 12 packets muxed (20362 bytes); Total: 12 packets (20362 bytes) muxed [Parsed_fps_0 @ 0x304e4a0] 24 frames in, 12 frames out; 12 frames dropped, 0 frames duplicated. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel