1

I'm able to record slow motion videos at 120fps using AVFoundation. These videos play as expected on iphone and mac quicktime player. But other players like videojs and my own player[AVPlayer] are not able to play it in slow motion. But if I create a slow motion video using iphone native camera app, then these same players are able to play it as expected.

I compared the two videos using mediainfo and two differences came up - 1. Format Profile: High@L5.1 vs High@L4.1 . I used ffpmeg to make my video's profile to High@L5.1 but it didn't make any difference.

  1. Format GOP : M=1, N=120 vs M=1, N=30. Again I used ffmpeg to set N=120 on my video but it didn't make any difference.

I also read online that exporting using PHAsset may help but my video files are created inside my Documents directory and will never go to Photo Album/Camera roll. I can probably try exporting to camera roll using PHAsset and then move it to my Documents directory as a hack (if it works at all). But I really need to know the underlying reason.

Any ideas what is causing this issue ? Thanks

user4848830
  • 779
  • 12
  • 22
  • 1
    From memory & guessing, slow motion videos are simply videos with a higher than usual framerate. The slow motion effect you're expecting is due to the player ramping the playback rate down and then back up. Non Apple players don't do this. If you do see the effect in a non Apple player, it's because at some point the playback rate effect has been rendered into the file (e.g. via `AVComposition` + `AVAssetExportSession`) & the file no longer has a high framerate. So have a look at the various FPSs of your files. – Rhythmic Fistman Jan 11 '19 at 15:30

0 Answers0