Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#8576 closed enhancement (worksforme)

strftime does not support %s

Reported by: Alan Piszcz Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

[image2 @ 0000020d6a852b80] Could not get frame filename with strftime
av_interleaved_write_frame(): Invalid argument

strftime support is indicated in ffmpeg documentation
strftime
If set to 1, expand the filename with date and time information from strftime(). Default value is 0.

http://man7.org/linux/man-pages/man3/strftime.3.html states '%s' for epoch seconds. Ideally this format would also support microseconds.

How to reproduce:

% ffmpeg -i input ... output -strftime 1 "%s.jpg"
[image2 @ 0000020d6a852b80] Could not get frame filename with strftime
av_interleaved_write_frame(): Invalid argument

ffmpeg version git-2020-03-15-c467328

Change History (3)

comment:2 by Carl Eugen Hoyos, 5 years ago

Keywords: strftime removed
Resolution: worksforme
Status: newclosed
$ ffmpeg -f lavfi -i testsrc2 -strftime 1 -vframes 1 %s.jpg
ffmpeg version N-97021-gf39678b3a9 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (SUSE Linux)
  configuration: --enable-gpl --enable-gnutls --enable-libx264 --enable-libx265 --enable-libdav1d --enable-libaom --enable-libvpx --enable-libxml2
  libavutil      56. 42.101 / 56. 42.101
  libavcodec     58. 76.100 / 58. 76.100
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.100 /  7. 77.100
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, lavfi, from 'testsrc2':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x2a3e100] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '%s.jpg':
  Metadata:
    encoder         : Lavf58.42.100
    Stream #0:0: Video: mjpeg, yuvj420p(pc), 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.76.100 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=    1 fps=0.0 q=3.8 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=12.7x    
video:9kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
$ ls *.jpg
1584744228.jpg

comment:3 by Martin, 4 years ago

Hi this enhancement is closed, so does ffmpeg somehow support writing millisec as output-name. I would like to use this for to get a better timestamp.

What I am using currently is this:
ffmpeg -debug_ts -i DJI_0024.mp4 -copyts -an -strftime 1 %s.png

This is since epoch, but surftime only support secs.

Thanky Martin

Note: See TracTickets for help on using tickets.