DEV Community

Xiong Yang
Xiong Yang

Posted on

iOS implements basic operations for slow playback of videos

  1. The video must be shot at 120 fps, or at a frame rate above 120 fps, to be played in slow motion when using the AVPlayer player;

  2. The key is slow playback. There is no need to modify or debug the original video content after shooting. You only need to set the playback rate multiple in the player. For example:

self.player.play() 
self.player.rate = 0.25.
Enter fullscreen mode Exit fullscreen mode

Please note that the playback rate must be set after

self.player.play()
Enter fullscreen mode Exit fullscreen mode

,
because the player automatically adjusts the rate to the normal 1.0 times speed during playback, and cannot be set directly. You must set the player's .rate after the player executes the play() function, so that the video can be played accurately at slow speed.

Top comments (0)

Cloudinary image

Optimize, customize, deliver, manage and analyze your images.

Remove background in all your web images at the same time, use outpainting to expand images with matching content, remove objects via open-set object detection and fill, recolor, crop, resize... Discover these and hundreds more ways to manage your web images and videos on a scale.

Learn more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay