#6682: hstack repeats input frames -------------------------------------+------------------------------------- Reporter: damonmaria | Type: defect Status: new | Priority: important Component: | Version: git- undetermined | master Keywords: hstack | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Using the hstack filter in code I was having a strange problem where after pushing a single frame into each input buffer I would sometimes get 2 frames out of the buffersink. Also, in the resulting video, some parts would 'pause' between frames as tho the same image was used across 2 frames for one of the hstack inputs, but not the other.
I then switched to command line to try hstack and get the same result. I dumped the output to individual image files so I could make sure it wasn't an issue with my viewer. How to reproduce: {{{ $ ffmpeg -i 2017-08-31T220000-1.mp4 -i 2017-08-31T220000-2.mp4 -filter_complex "[0:v][1:v]hstack=inputs=2[v]" -map "[v]" -t 10 filename%03d.jpg ffmpeg version git-2017-09-21-6f15f1c Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 9.0.0 (clang-900.0.37) configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-6f15f1c --enable- shared --enable-pthreads --enable-gpl --enable-version3 --enable- hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host- ldflags= --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma --enable-nonfree libavutil 55. 76.100 / 55. 76.100 libavcodec 57.106.101 / 57.106.101 libavformat 57. 82.101 / 57. 82.101 libavdevice 57. 8.101 / 57. 8.101 libavfilter 6.105.100 / 6.105.100 libavresample 3. 6. 0 / 3. 6. 0 libswscale 4. 7.103 / 4. 7.103 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2017-08-31T220000-1.mp4': Metadata: major_brand : isml minor_version : 512 compatible_brands: piff title : rtsp://root:root@192.168.14.104/axis- media/media.amp?camera=1 encoder : Lavf57.71.100 comment : rtsp-server Duration: 00:59:59.79, start: 0.000000, bitrate: 263 kb/s Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuvj420p(pc, bt709), 800x600 [SAR 1:1 DAR 4:3], 263 kb/s, 4 fps, 4 tbr, 10000k tbn, 20000k tbc (default) Metadata: handler_name : VideoHandler Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '2017-08-31T220000-2.mp4': Metadata: major_brand : isml minor_version : 512 compatible_brands: piff title : rtsp://root:root@192.168.14.104/axis- media/media.amp?camera=2 encoder : Lavf57.71.100 comment : rtsp-server Duration: 00:59:59.79, start: 0.000000, bitrate: 222 kb/s Stream #1:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuvj420p(pc, bt709), 800x600 [SAR 1:1 DAR 4:3], 222 kb/s, 4 fps, 4 tbr, 10000k tbn, 20000k tbc (default) Metadata: handler_name : VideoHandler Stream mapping: Stream #0:0 (h264) -> hstack:input0 Stream #1:0 (h264) -> hstack:input1 hstack -> Stream #0:0 (mjpeg) Press [q] to stop, [?] for help Output #0, image2, to '/Users/damon/Downloads/cmd-line- hstack-2/filename%03d.jpg': Metadata: major_brand : isml minor_version : 512 compatible_brands: piff title : rtsp://root:root@192.168.14.104/axis- media/media.amp?camera=1 comment : rtsp-server encoder : Lavf57.82.101 Stream #0:0: Video: mjpeg, yuvj420p(pc), 1600x600 [SAR 1:1 DAR 8:3], q=2-31, 200 kb/s, 4 fps, 4 tbn, 4 tbc (default) Metadata: encoder : Lavc57.106.101 mjpeg Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1 Past duration 0.999992 too large frame= 40 fps=0.0 q=24.8 Lsize=N/A time=00:00:10.00 bitrate=N/A dup=0 drop=27 speed= 35x video:2406kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown }}} As I flick through the resulting images sections of the frames (corresponding the inputs to the hstack) clearly remain the same between frames sometimes. Other points that show that I think this is a real problem: - I get the same result in code and on the command line - Using the -t 10 option to only dump 10 seconds (the input videos are an hour long) the 40th image output (the videos are only 4 FPS) is from an earlier time in the video for the hstack output than if I dump one of the individual videos to files in the same way (without hstack). Which would happen if images are being duplicated. - If I run with the null muxer then it outputs errors that (to my uneducated eye) seem to indicate exactly this problem is happening: {{{ $ ffmpeg -i "rtsp://root:root@192.168.13.104/axis- media/media.amp?camera=1" -i "rtsp://root:root@192.168.13.104/axis- media/media.amp?camera=2" -i "rtsp://root:root@192.168.13.104/axis- media/media.amp?camera=3" -filter_complex "[0:v][1:v][2:v]hstack=inputs=3[v]" -map "[v]" -t 60 -f null - ... [null @ 0xbe19849b80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 155 >= 155 [null @ 0xbe19849b80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 156 >= 156 [null @ 0xbe19849b80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 157 >= 157 Last message repeated 1 times [null @ 0xbe19849b80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 158 >= 158 Last message repeated 1 times [null @ 0xbe19849b80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 159 >= 159 Last message repeated 1 times ... }}} - I've tried with both files and RTSP streams as input (my intention is to use RTSP in the end) -- Ticket URL: <https://trac.ffmpeg.org/ticket/6682> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker _______________________________________________ FFmpeg-trac mailing list FFmpeg-trac@avcodec.org http://ffmpeg.org/mailman/listinfo/ffmpeg-trac