Output from AVAssetWriter (UIImages written to video) distorted

后端 未结 3 1128
时光说笑
时光说笑 2020-12-18 09:49

I am using an AVAssetWriter to encode a series of images to a movie file, following Zoul\'s answer here: How do I export UIImage array as a movie?.

In short my proc

相关标签:
3条回答
  • 2020-12-18 10:17

    Ok, this turned out to be an issue with the aspect ratio of the images I was reading in being different from the aspect ratio of the PixelBuffer I was creating. Made them equal and it works fine.

    0 讨论(0)
  • 2020-12-18 10:22

    Old thread but different answer, instead of multiplying by a number I use CVPixelBufferGetBytesPerRow to get the actual bytes per row for CGBitmapContextCreate and it fixed the distortion, leaving height/width the same

    0 讨论(0)
  • 2020-12-18 10:30

    Please take a look at this link. It says the width should be a multiple of 16.

    Just get the size.width, calculate the nearest number which is multiple of 16. And hard code it in place of size.width.

    It works :)

    0 讨论(0)
提交回复
热议问题