Creating Video material & Sound.
-
-
Save derofim/5007d0d7ac270aaab90de86ddde58500 to your computer and use it in GitHub Desktop.
Convert video file to unreal supportable mp4 format:
ffmpeg -i "input.mp4" -c:v libx264 -preset veryslow output.mp4
Extract audio from video file:
ffmpeg -i input.mp4 output.wav
Or Convert audio file to unreal supportable wav format:
ffmpeg -i input.mp3 -acodec pcm_s16le -ac 1 -ar 16000 output.wav
Import wav audio (as Sound Wave) and mp4 video (as Media Source).
Create new new Media Player asset as in https://docs.unrealengine.com/latest/INT/Engine/MediaFramework/HowTo/FileMediaSource/.
Open created Media Player.
Set "Play on Open" and Loop" to true.
Check Sound Wave and Video Texture.
Create Media Texture from Media Player.
Create Material from Media Texture.
Add Emmisive Color to Material.
Open Level Blueprint.
Add MediaPlayer variable of type Media Player.
Save All.
Set varible "Media Player" field to created Media Player.
"OnBeginPlay""->"OpenSource"->"Media Player"
Set "OpenSource" field "Media Source" to created "File Media Source".
Apply video material to game object. Save all and check in "Simulate" mode .
Drag imported "Sound Wave" to Game.
Set "Override Attenuation" and set proper "radius" and "falloff distance".
Set "Auto Activate" to true.
Click right mouse button at "Sound Wave" and choose "Edit" in Content Browser:
Install ffmpeg https://ffmpeg.org/download.html



You may need Microsoft Visual C++ (Redistributable Package) to install ffmpeg
Add ;c:\ffmpeg\bin to PATH (change to ffmpeg bin folder)