Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
UnityのVideoClipImporter
using UnityEditor;
public class VideoClipAssetImporter : AssetPostprocessor
{
static void OnPostprocessAllAssets (string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
{
foreach (string str in importedAssets) {
var importer = AssetImporter.GetAtPath (str) as VideoClipImporter;
if (importer == null)
continue;
importer.defaultTargetSettings = new VideoImporterTargetSettings () {
// トランスコードフラグ falseだとそもそもエンコードされない
enableTranscoding = true,
// 私が理解できていないプロパティ
spatialQuality = VideoSpatialQuality.MediumSpatialQuality,
// ビットレート指定
bitrateMode = VideoBitrateMode.Medium,
// コーデック指定
codec = VideoCodec.H264,
// リサイズ指定
resizeMode = VideoResizeMode.OriginalSize
};
// オーディオインポートフラグ
importer.importAudio = false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment