Skip to main content
deleted 2 characters in body
Source Link
Pyoro
  • 41
  • 3

I want to ask this question again because old solutions no longer work with ffmpeg 6.0, owing to a change made in January 2023 that prevents the use of the -r and -vsync/-fps_mode parameters simultaneously.

The goal is to use filenames or superposed text with images of frames, to identify their exact (presentation) timestamps in the original video, without any kinds of offsets, sanitisations, and to a user-desired precision (by default, milliseconds). Additionally, it should be possible to tell that every frame has been dumped, and sorted in timestamp order, from a specified segment of the video. The motive is to use the video to time the durations of events recorded in it.

The command I had previously thought solved this problem was:

ffmpeg
-ss 1:23:45
-t 5
-i input.mkv
-copyts
-fps_mode passthrough
-r 1000
-frame_pts 1
%08d.jpg

But it's apparently no longer possible to use -fps_mode with -r 1000. It seems that the image2 demuxermuxer implicitly used here defaults to a timebase of 1, and -r 1000 was previously being used to scale the timebase to 0.001. I am unsure if -enc_time_base 0.001 will do the same thing, and if I may need to also use -video_track_timescale or similar. I want to ideally extract the timestamps verbatim from the source, optionally truncated (e.g. to milliseconds) and not have to make assumptions about CFR/VFR etc. So I'd like a pro to check I'm doing this correctly. I'd also like to know how to get these same timestamps superposed on the images themselves, but haven't researched it pending getting the filenames method to work. Thanks.

Here's an answer by Gyan suggesting the now-impossible mixture of -vsync and -r.

I want to ask this question again because old solutions no longer work with ffmpeg 6.0, owing to a change made in January 2023 that prevents the use of the -r and -vsync/-fps_mode parameters simultaneously.

The goal is to use filenames or superposed text with images of frames, to identify their exact (presentation) timestamps in the original video, without any kinds of offsets, sanitisations, and to a user-desired precision (by default, milliseconds). Additionally, it should be possible to tell that every frame has been dumped, and sorted in timestamp order, from a specified segment of the video. The motive is to use the video to time the durations of events recorded in it.

The command I had previously thought solved this problem was:

ffmpeg
-ss 1:23:45
-t 5
-i input.mkv
-copyts
-fps_mode passthrough
-r 1000
-frame_pts 1
%08d.jpg

But it's apparently no longer possible to use -fps_mode with -r 1000. It seems that the image2 demuxer implicitly used here defaults to a timebase of 1, and -r 1000 was previously being used to scale the timebase to 0.001. I am unsure if -enc_time_base 0.001 will do the same thing, and if I may need to also use -video_track_timescale or similar. I want to ideally extract the timestamps verbatim from the source, optionally truncated (e.g. to milliseconds) and not have to make assumptions about CFR/VFR etc. So I'd like a pro to check I'm doing this correctly. I'd also like to know how to get these same timestamps superposed on the images themselves, but haven't researched it pending getting the filenames method to work. Thanks.

Here's an answer by Gyan suggesting the now-impossible mixture of -vsync and -r.

I want to ask this question again because old solutions no longer work with ffmpeg 6.0, owing to a change made in January 2023 that prevents the use of the -r and -vsync/-fps_mode parameters simultaneously.

The goal is to use filenames or superposed text with images of frames, to identify their exact (presentation) timestamps in the original video, without any kinds of offsets, sanitisations, and to a user-desired precision (by default, milliseconds). Additionally, it should be possible to tell that every frame has been dumped, and sorted in timestamp order, from a specified segment of the video. The motive is to use the video to time the durations of events recorded in it.

The command I had previously thought solved this problem was:

ffmpeg
-ss 1:23:45
-t 5
-i input.mkv
-copyts
-fps_mode passthrough
-r 1000
-frame_pts 1
%08d.jpg

But it's apparently no longer possible to use -fps_mode with -r 1000. It seems that the image2 muxer implicitly used here defaults to a timebase of 1, and -r 1000 was previously being used to scale the timebase to 0.001. I am unsure if -enc_time_base 0.001 will do the same thing, and if I may need to also use -video_track_timescale or similar. I want to ideally extract the timestamps verbatim from the source, optionally truncated (e.g. to milliseconds) and not have to make assumptions about CFR/VFR etc. So I'd like a pro to check I'm doing this correctly. I'd also like to know how to get these same timestamps superposed on the images themselves, but haven't researched it pending getting the filenames method to work. Thanks.

Here's an answer by Gyan suggesting the now-impossible mixture of -vsync and -r.

Source Link
Pyoro
  • 41
  • 3

Extracting every frame from a video with its original timestamp (in the filename or printed on the image)

I want to ask this question again because old solutions no longer work with ffmpeg 6.0, owing to a change made in January 2023 that prevents the use of the -r and -vsync/-fps_mode parameters simultaneously.

The goal is to use filenames or superposed text with images of frames, to identify their exact (presentation) timestamps in the original video, without any kinds of offsets, sanitisations, and to a user-desired precision (by default, milliseconds). Additionally, it should be possible to tell that every frame has been dumped, and sorted in timestamp order, from a specified segment of the video. The motive is to use the video to time the durations of events recorded in it.

The command I had previously thought solved this problem was:

ffmpeg
-ss 1:23:45
-t 5
-i input.mkv
-copyts
-fps_mode passthrough
-r 1000
-frame_pts 1
%08d.jpg

But it's apparently no longer possible to use -fps_mode with -r 1000. It seems that the image2 demuxer implicitly used here defaults to a timebase of 1, and -r 1000 was previously being used to scale the timebase to 0.001. I am unsure if -enc_time_base 0.001 will do the same thing, and if I may need to also use -video_track_timescale or similar. I want to ideally extract the timestamps verbatim from the source, optionally truncated (e.g. to milliseconds) and not have to make assumptions about CFR/VFR etc. So I'd like a pro to check I'm doing this correctly. I'd also like to know how to get these same timestamps superposed on the images themselves, but haven't researched it pending getting the filenames method to work. Thanks.

Here's an answer by Gyan suggesting the now-impossible mixture of -vsync and -r.