Last active
October 10, 2017 02:21
-
-
Save baobao/5d16e850ee65199142b26c5f47b2e6be to your computer and use it in GitHub Desktop.
UnityのVideoClipImporter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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