[FFmpeg-trac] #11202(ffmpeg:new): indices with strftime are incompatible.

FFmpeg trac at avcodec.org
Mon Sep 23 17:30:19 EEST 2024


#11202: indices with strftime are incompatible.
-------------------------------------+-------------------------------------
             Reporter:  elias        |                    Owner:  (none)
  tsolis                             |
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:  ffmpeg
              Version:  6.1.1        |               Resolution:
             Keywords:  timestamp,   |               Blocked By:
  filename                           |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Description changed by elias tsolis:

Old description:

> command:
> `ffmpeg -rtbufsize 100M -vsync 0 -vf "select='$frms'" -fps_mode
> passthrough -strftime 1 frames/"%Y-%m-%d_%H-%M-%S_%5d.bmp" -i
> "${vid_scr}"`
>
> problem:
> extracting multiple frames from multiple splitted videos, in automated
> way using ffmpeg, in an ordered way, with timestamp+increment of index is
> impossible. Think of multiple videos (vid01.mp4 vid02.mp4) recorded at 50
> fps / 128 etc.
>
> When you try to extract these thumbnails all will start as "00001.jpg,
> 00002.jpg". which will overwrite them. Otherwise you must make a
> differect directory for each video which is inconvenient.
>
> I have read that strftime cannot work with miliseconds or with other
> incremented indices.
>
> So this is a problem.
>
> Solution
> strftime must define only time and must work with other incremental
> indices. Also, it must support miliseconds & nanoseconds. There are some
> addons that do that.
>
> I tried to set the time outside ffmpeg as variable but do not "renew" it.
> it stuck on same number.
>
> `dtmil="$(date +"%T.%N")";`
>
> `ffmpeg -rtbufsize 100M -vsync 0 -vf "select='$frms'" -fps_mode
> passthrough frames/"$dtmil_%5d.bmp" -i vid01.mp4`
>
> {{{
> ffmpeg version 6.1.1-4+b4 Copyright (c) 2000-2023 the FFmpeg developers
>   built with gcc 13 (Debian 13.3.0-1)
>   configuration: --prefix=/usr --extra-version=4+b4 --toolchain=hardened
> --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu
> --arch=amd64 --enable-gpl --disable-stripping --disable-omx --enable-
> gnutls --enable-libaom --enable-libass --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-libharfbuzz --enable-
> libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
> --enable-libopus --enable-librubberband --enable-libshine --enable-
> libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-
> libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx
> --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid
> --enable-libzimg --enable-openal --enable-opencl --enable-opengl
> --disable-sndio --enable-libvpl --disable-libmfx --enable-libdc1394
> --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r
> --enable-ladspa --enable-libbluray --enable-libjack --enable-libpulse
> --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh
> --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi
> --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e
> --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
>   libavutil      58. 29.100 / 58. 29.100
>   libavcodec     60. 31.102 / 60. 31.102
>   libavformat    60. 16.100 / 60. 16.100
>   libavdevice    60.  3.100 / 60.  3.100
>   libavfilter     9. 12.100 /  9. 12.100
>   libswscale      7.  5.100 /  7.  5.100
>   libswresample   4. 12.100 /  4. 12.100
>   libpostproc    57.  3.100 / 57.  3.100
> }}}

New description:

 command:
 `ffmpeg -rtbufsize 100M -vsync 0 -vf "select='$frms'" -fps_mode
 passthrough -strftime 1 frames/"%Y-%m-%d_%H-%M-%S_%5d.bmp" -i
 "${vid_scr}"`

 problem:
 extracting multiple frames from multiple splitted videos, in automated way
 using ffmpeg, in an ordered way, with timestamp+increment of index is
 impossible. Think of multiple videos (vid01.mp4 vid02.mp4) recorded at 50
 fps / 128 etc.

 When you try to extract these thumbnails all will start as "00001.jpg,
 00002.jpg". which will overwrite them. Otherwise you must make a differect
 directory for each video which is inconvenient.

 I have read that strftime cannot work with miliseconds or with other
 incremented indices.

 So this is a problem.

 Solution
 strftime must define only time and must work with other incremental
 indices. Also, it must support miliseconds & nanoseconds. There are some
 addons that do that.

 I tried to set the time outside ffmpeg as variable but do not "renew" it.
 it stuck on same number.

 `dtmil="$(date +"%T.%N")";`

 `ffmpeg -rtbufsize 100M -vsync 0 -vf "select='$frms'" -fps_mode
 passthrough frames/"$dtmil_%5d.bmp" -i vid01.mp4`

 system: linux debian

 {{{
 ffmpeg version 6.1.1-4+b4 Copyright (c) 2000-2023 the FFmpeg developers
   built with gcc 13 (Debian 13.3.0-1)
   configuration: --prefix=/usr --extra-version=4+b4 --toolchain=hardened
 --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu
 --arch=amd64 --enable-gpl --disable-stripping --disable-omx --enable-
 gnutls --enable-libaom --enable-libass --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-libharfbuzz --enable-
 libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
 --enable-libopus --enable-librubberband --enable-libshine --enable-
 libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-
 libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx
 --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid
 --enable-libzimg --enable-openal --enable-opencl --enable-opengl
 --disable-sndio --enable-libvpl --disable-libmfx --enable-libdc1394
 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r
 --enable-ladspa --enable-libbluray --enable-libjack --enable-libpulse
 --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh
 --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi
 --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-
 pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
   libavutil      58. 29.100 / 58. 29.100
   libavcodec     60. 31.102 / 60. 31.102
   libavformat    60. 16.100 / 60. 16.100
   libavdevice    60.  3.100 / 60.  3.100
   libavfilter     9. 12.100 /  9. 12.100
   libswscale      7.  5.100 /  7.  5.100
   libswresample   4. 12.100 /  4. 12.100
   libpostproc    57.  3.100 / 57.  3.100
 }}}

--
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11202#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list