In previous small video recording articles, we used avassetexportsession to compress the merged video output into a final video file. High-quality compression (avassetexportpresethighestquality) was used at that time.
Let exporter = avassetexportsession (Asset:composition,
presetname:avassetexportpresethighestquality)!
Of course, in addition to avassetexportpresethighestquality, there are many other settings video resolution (Export preset) for us to choose to use. For example, in order to facilitate transmission, save bandwidth, you can turn the video into a low resolution.
1, fixed resolution preset properties
(1) avassetexportpreset640x480: Set video resolution 640x480
(2) avassetexportpreset960x540: Set video resolution 960X540
(3) avassetexportpreset1280x720: Set video resolution 1280X720
(4) avassetexportpreset1920x1080: Set video resolution 1920x1080
(5) avassetexportpreset3840x2160: Set video resolution 3840X2160
2, relative quality preset properties
(1) avassetexportpresetlowquality: Low quality
(2) Avassetexportpresetmediumquality: Medium quality
(3) Avassetexportpresethighestquality: High quality
This setting means that the resulting video resolution is related to the specific shooting device. Like IPhone6 's video:
Using Avassetexportpresethighestquality, the video resolution is 1920x1080 (not compressed).
Avassetexportpresetmediumquality Video resolution is 568x320
Avassetexportpresetlowquality Video resolution is 224x128