#11337(undetermined:new): asegment with relative timestamps creates segments with wrong duration
#11337: asegment with relative timestamps creates segments with wrong duration -------------------------------------+------------------------------------- Reporter: pablo | Type: defect Status: new | Priority: normal Component: | Version: undetermined | unspecified Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Summary of the bug: asegment with relative timestamps produces segments with wrong duration. Absolute timestamps works as exepcted. How to reproduce: Use the first wav from here: https://www2.cs.uic.edu/~i101/SoundFiles/ The third segment has duration N/A. {{{ ffmpeg -i BabyElephantWalk60.wav -filter_complex "asegment=timestamps=1000ms|+1000ms|+1000ms[1][2][3][4]" -map "[1]" test1.wav -map "[2]" test2.wav -map "[3]" test3.wav -map "[4]" test4.wav ffmpeg version 5.1.6-0+deb12u1 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 12 (Debian 12.2.0-14) configuration: --prefix=/usr --extra-version=0+deb12u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable- libglslang --enable-libgme --enable-libgsm --enable-libjack --enable- libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable- libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable- libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable- pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable- libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable- libx264 --enable-libplacebo --enable-librav1e --enable-shared libavutil 57. 28.100 / 57. 28.100 libavcodec 59. 37.100 / 59. 37.100 libavformat 59. 27.100 / 59. 27.100 libavdevice 59. 7.100 / 59. 7.100 libavfilter 8. 44.100 / 8. 44.100 libswscale 6. 7.100 / 6. 7.100 libswresample 4. 7.100 / 4. 7.100 libpostproc 56. 6.100 / 56. 6.100 Guessed Channel Layout for Input Stream #0.0 : mono Input #0, wav, from 'BabyElephantWalk60.wav': Duration: 00:01:00.00, bitrate: 352 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s Stream mapping: Stream #0:0 (pcm_s16le) -> asegment:default asegment -> Stream #0:0 (pcm_s16le) asegment -> Stream #1:0 (pcm_s16le) asegment -> Stream #2:0 (pcm_s16le) asegment -> Stream #3:0 (pcm_s16le) Press [q] to stop, [?] for help Output #0, wav, to 'test1.wav': Metadata: ISFT : Lavf59.27.100 Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s Metadata: encoder : Lavc59.37.100 pcm_s16le Output #1, wav, to 'test2.wav': Metadata: ISFT : Lavf59.27.100 Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s Metadata: encoder : Lavc59.37.100 pcm_s16le Output #2, wav, to 'test3.wav': Metadata: ISFT : Lavf59.27.100 Stream #2:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s Metadata: encoder : Lavc59.37.100 pcm_s16le Output #3, wav, to 'test4.wav': Metadata: ISFT : Lavf59.27.100 Stream #3:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s Metadata: encoder : Lavc59.37.100 pcm_s16le size= 43kB time=00:01:00.00 bitrate= 5.9kbits/s speed=3.19e+03x video:0kB audio:2584kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown }}} You can also try: ffmpeg -v verbose -y -lavfi "sine=d=10,asegment=timestamps=1|+1|+1" -c:a pcm_s16le out.mka 2>&1 ffmpeg -v verbose -y -lavfi "sine=d=10,asegment=timestamps=1|+2|+2" -c:a pcm_s16le out.mka 2>&1 -- Ticket URL: <https://trac.ffmpeg.org/ticket/11337> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11337: "asegment" with relative timestamps created segments of wrong duration ----------------------------------+------------------------------------ Reporter: pablo | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: 5.1.4 | Resolution: Keywords: asegment | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 1 | ----------------------------------+------------------------------------ Changes (by MasterQuestionable): * analyzed: 0 => 1 * cc: MasterQuestionable (added) * component: undetermined => avfilter * keywords: => asegment * summary: asegment with relative timestamps creates segments with wrong duration => "asegment" with relative timestamps created segments of wrong duration * version: unspecified => 5.1.4 Comment: ͏ Try later versions? (prominently, "git-master") -- Ticket URL: <https://trac.ffmpeg.org/ticket/11337#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11337: "asegment" with relative timestamps created segments of wrong duration ------------------------------------+------------------------------------ Reporter: pablo | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: asegment | Blocked By: Blocking: | Reproduced by developer: 1 Analyzed by developer: 1 | ------------------------------------+------------------------------------ Changes (by Leo Izen): * reproduced: 0 => 1 * version: 5.1.4 => git-master Comment: I can reproduce this. The issue here appears that the second `+1` is relative to the first absolute timestamp. This means something like `'sine=d=10,asegment=1|+1|+1` is creating the last segment as having the same offset as the second-to-last segment, so the second-to-last segment has zero duration. Which any encoder fails to encode (you can try with `-f null -`, for example). Try something like this: `ffmpeg -v verbose -lavfi 'sine=d=10,asegment=timestamps=1|+1|+4[a0][a1][a2][a3]' -map '[a0]' -map '[a1]' -map '[a2]' -map '[a3]' -f null -` The last segment should start 6 seconds after the initial one, but it actually starts 5 seconds after the initial one. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11337#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11337: Counter-intuitive "asegment" behavior of relative timestamps ------------------------------------+------------------------------------ Reporter: pablo | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: asegment | Blocked By: Blocking: | Reproduced by developer: 1 Analyzed by developer: 1 | ------------------------------------+------------------------------------ Changes (by MasterQuestionable): * summary: "asegment" with relative timestamps created segments of wrong duration => Counter-intuitive "asegment" behavior of relative timestamps -- Ticket URL: <https://trac.ffmpeg.org/ticket/11337#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg