ffmpegで動画から音だけを削除する

backham
.hlsを作る時に音は入っていないのに音のコーデックでつまづく場合があるので、あらかじめ音のデータを削除しておく場合のコマンド ffmpeg -i movie.mp4 -vcodec copy -map 0:0

Google 360°VR動画「Pearl」

backham
アカデミー賞短編映画賞にノミネートされた「Pearl」 グーグルのVRアニメ『Pearl』 VR作品初のアカデミー賞ノミネート ミュージシャンの父

Unity Listからforeachを使ってremoveする

backham
foreach(Class item in Lists){ if(item.id == id){ Lists.remove(item); } } こんなかんじでやると、 InvalidOperationException: Collection was modified; enumeration operation may not execute. とエラーになるので、 List<Class> TmpList = Lists; foreach(Class item in Lists){ TmpList.Add(item ); } foreach(Class item in TmpList){ if(item.id == id){ Lists.remove(item); } } こうしてやる

Unity StreamingAssetsからファイルを読み出す

backham
Streaming Assets で iOSとAndroidの違いにハマったのでメモ。 string FilePath; #if UNITY_IPHONE FilePath = Application.dataPath + "/Raw/" + filename; #else string fullPath = "jar:file://" + Application.dataPath + "/!/assets/" + filename; WWW www = new WWW (fullPath); while (!www.isDone) { } FilePath = Application.persistentDataPath + filename; File.WriteAllBytes (toPath,www.bytes); #endif iOS

Unity の lookAt を おきかえる

backham
UnityのlookAtは便利ですが、回転をさらに細かく制御しようと思うと難しいので置き換えます。 Rot.transform.LookAt (Vector3.zero); こうするところを、 Vector3 relative = gameObject.transform.InverseTransformPoint(Vector3.zero);<br /> float angle = Mathf.Atan2(relative.x, relative.z)