rubygarage / media-watermark

GPU/CPU-based iOS Watermark Library for Image and Video Overlay
https://rubygarage.org/
MIT License
217 stars 63 forks source link

Frame rate corresponding to the input video #49

Open mireczech opened 1 year ago

mireczech commented 1 year ago

I have been recently looking into how you could watermark a video using the library while maintaining the original frame rate. What worked for me just fine was to retrieve the frame rate from the MediaItem like so: let fps = Int32(item.sourceAsset.tracks(withMediaType: .video).first!.nominalFrameRate)

Then I only changed this line in the MediaVideoProcessor.swift file to contain the desired frame rate.

I would suggest you include this, if possible, as an optional argument of the function so that the user could control that behaviour more easily.