-
Notifications
You must be signed in to change notification settings - Fork 12
LanSongSDK—AE Template design specification
AE designer design specification. (update time :209200721. sdk version:4.2.6)
In the AE project, each picture can only correspond to one layer, and one picture cannot be used on multiple layers.
In the AE project, the width and height of the picture are multiples of 16. If the picture is vertical, it is recommended to use 720x1280; if it is horizontal, it is recommended to use 1280x720; if it is square: it is recommended to use 544x544 or 640x640, or 720x720 if it must be another size , It is recommended that the width and height of the picture be a multiple of 32, such as 544x32; the width and height of the picture must not be greater than the final synthesized width and height;
The composite width and height derived from the AE template is a multiple of 16, and the recommended value is 720x1280; if it is horizontal, it is 1280x720; the width and height of the picture must not be greater than the composite width and height;
Each picture can be displayed for a maximum of 10 seconds, and the duration of each picture cannot exceed 10 seconds; it is recommended to be equal to the effective display time of the picture, and cannot be zoomed to 0 or other forms are not displayed, but the picture is still valid; the duration of the picture cannot be greater than the duration of the composition; Currently, only the picture animations in AE that need to be replaced by the user are supported: position/zoom/rotation/transparency 4 kinds of animation, and the anchor point of the layer is at the center of the layer.
The parts that do not need to be replaced, such as the various decorations of the bottom layer, and the various decorations of the upper layer of the picture; the bottom layer is exported as a background video, and the upper layer is exported as a MV transparent video; the current largest is 3 files, one background video + one json+ an mv, where background video and mv are optional; If it is not necessary, try to avoid setting the start time of multiple pictures at the same time. For example, avoid that multiple pictures start at 3.5 seconds, because the SDK will refer to the start time when sorting and playing pictures; if the start time is necessary If the points are the same, try not to overlap;
Developers use Template class: LSOAexAeModule and LSOAexImage LSOAexText The LSOAexModule class is used to set various materials of a template. For example, when a template is exported, it will export background video files, transparent mv videos, sounds and other materials. After loading, you will get the width, height, and number of replaceable pictures of the template. , And the start time and display duration of each picture.
The lsoaeximage class is used to manipulate the pictures in the AE template. When we are parsing, we have sorted each picture in the order of time. The first index you get is the first picture displayed. You need to replace the video If the picture is a video or picture, call updapathXXX(), you can call it at the start time, or add it to the preview player in the template; there is an “option” option when replacing, currently supports setting the zoom form and start time, option Enumerate zoom, support cropping to full screen, full zoom, and video type zoom; updatePath replacement returns a boolean type, indicating success or failure of replacement. Can be called multiple times. If it is a video, you can asynchronously obtain the required thumbnail through getThumbnailAsync.
AE playback class: LSOAexplayerView is used to play an AE template (LSOAexModule), supports playback progress callback, playback completion callback, export progress callback, export completion callback, positioning to time, positioning to AexImage, pause, resume, resume, start playback, start When exporting, there is a callback for executing errors, a callback for playing AexImage changes, and gestures are supported. When the playing screen is clicked, it will return which LSOAexImage the user has clicked currently. When the user wants to replace the material during the playback process, it can be replaced by the updatePath method of AexImage. iOS needs to execute the updateAexImage of aexComposition after calling updateWithUrl; after we internally check that you replace it, the replaced screen will be displayed and rendered to In the current module. The API of the iOS version is composed of two classes: LSOAexComposition and LSOAexDisplayView, one is composition and the other is playback window. Gesture description: During playback, when the user clicks on the screen, the player will pause and return to the AexImage object selected by the user. You can directly change the video or picture in the AexImage. After the change, the player will play the replaced video or image. When the user picture or video width and height are not equal to the picture width and height in the AE template, when replacing, it will be zoomed by default according to the zoom type of the option and displayed from the center of the screen; when the user clicks the play screen, it can be adjusted by moving with one finger To display which part of the screen, you can also use two fingers to zoom and rotate to adjust the displayed screen. The adjusted screen is the final screen to be generated. If your two pictures overlap during AE production, it is possible that when you click on the picture, another picture will be selected instead of the one you want. It is recommended not to overlap during production;
AexImage change callback method description: We internally find which aexImage has the smallest difference between the start time point and the current time, and which aexImage to return. If you have multiple pictures overlapping at the time point, it is possible that the returned aexImage is not the result you want. This is normal Circumstances, you can discuss with the AE designer how to avoid them;
web: www.lansongtech.com
demo app download :
ios (app store): https://apps.apple.com/cn/app/%E8%93%9D%E6%9D%BE%E8%A7%86%E9%A2%91%E7%BC%96%E8%BE%91%E4%BD%93%E9%AA%8C/id1512903172
android (Google Play) : https://play.google.com/store/apps/details?id=com.lansong.sdk
sdk demo code project: ios https://github.com/LanSoSdk/video-edit-sdk-ios