👋 I noticed that ProcessingManager.getPreviewImageAtPosition() does not specify a time tolerance for the AVAssetImageGenerator object. This means that the time parameter provided to the function is only an approximate guideline, and iOS may return an image frame slightly before or after the specified time.
It will be helpful if getPreviewImageAtPosition() provides a configurable time tolerance parameter.
Specifically, to get strict tolerance, where the preview image is obtained exactly at the time specified, the change would be to include right after this line here
👋 I noticed that
ProcessingManager.getPreviewImageAtPosition()
does not specify a time tolerance for theAVAssetImageGenerator
object. This means that the time parameter provided to the function is only an approximate guideline, and iOS may return an image frame slightly before or after the specified time.It will be helpful if
getPreviewImageAtPosition()
provides a configurable time tolerance parameter.Specifically, to get strict tolerance, where the preview image is obtained exactly at the time specified, the change would be to include right after this line here
https://github.com/shahen94/react-native-video-processing/blob/1a5ebbfedf2a0f1149c8a27d3db0241b5537571b/ios/RNVideoProcessing/RNVideoTrimmer/RNVideoTrimmer.swift#L587
these two lines:
Documentation reference: https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1390571-requestedtimetolerancebefore https://developer.apple.com/documentation/avfoundation/avassetimagegenerator/1387751-requestedtimetoleranceafter