Change #273936
| Category | ffmpeg |
| Changed by | marcos ashton <marcosashiglesias@gmail.com> |
| Changed at | Fri 03 Jul 2026 21:47:10 |
| Repository | https://git.ffmpeg.org/ffmpeg.git |
| Project | ffmpeg |
| Branch | master |
| Revision | 2f779272e061fbdf2725009f9e327c2f7a6b0a61 |
Comments
libavformat/img2enc: add update_filemtime option Add a new boolean option -update_filemtime to the image2 muxer that sets each output file's modification time based on the creation_time metadata plus the frame's PTS offset. This is useful when extracting frames from dashcam or action camera footage where wall-clock timestamps should be preserved on the output files, allowing photo management tools to sort frames by capture time without post-processing. The option requires creation_time metadata to be set (via -metadata creation_time=...). If not present, a warning is logged and the option is silently disabled. When PTS is unavailable, the creation time is used as-is without frame offset. Uses utimes() on POSIX and _utime() on Windows to set file timestamps with microsecond and second precision respectively. Includes a FATE roundtrip test that writes frames with a known creation_time, reads them back using the demuxer's -ts_from_file option, and verifies the PTS values match the expected timestamps. Closes: https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/22537 Signed-off-by: marcos ashton <marcosashiglesias@gmail.com>
Changed files
- doc/muxers.texi
- libavformat/img2enc.c
- tests/fate-run.sh
- tests/fate/image.mak
- tests/ref/fate/img2-update-filemtime