I would like to batch process mp4 videos, getting the last x seconds of each and saving them to individual files. I need to do this with a very high accuracy, preferably to 0.001 seconds or better. Found a related question (FFMPEG: get last 10 seconds) suggesting -sseof, which works great, but as the answer said it's not completely accurate with stream copy.
I am trying to match video lengths to the length of a reference video.
Would I need to re-encode? Can sseof handle this accurate enough if I specify duration as 00:00:00.000000 (which I get from reference video ffprobe)?
Please see related ffprobe -i below, all videos to be processed have this same encoding.
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.83.100
Duration: 00:00:58.67, start: 0.000000, bitrate: 639 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 499 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 131 kb/s (default)
Metadata:
handler_name : SoundHandler
duration=58.673000
Is there a better way to achieve frame-level accuracy? As end goal I would need to overlay these videos with 25fps 'frame-level accuracy'.
Thanks a lot!