- Newest
- Most votes
- Most comments
Hi @REDACTEDUSER
This is a cross-post from your question about render targets that is also relevant to this question.
I believe the problem may be that the video playback gem does not find the webm video file in the level .pak - to fix this try placing your .webm file outside the .pak file with the same folder path it had before.
For example if your .webm file is in
c:\Amazon\Lumberyard\1.4.0.1\dev\MyProject\Levels\test\MyMovie.webm
and your folder with all the built PAK files is
c:\Amazon\Lumberyard\1.4.0.1\dev\MyProjectPaks_PC
place the file in
c:\Amazon\Lumberyard.1.4.0.1\dev\MyProjectPaks_PC\MyProject\Levels\test\MyMovie.webm
@REDACTEDUSER
Thank you for taking the time to track down this problem and answer this question. I just tried this on the 1.13 build for Lumberyard and it worked! Hopefully this saves everyone else a lot of hassle.
@REDACTEDUSER
Is this issue remaining in 1.27.1.0? I heard this caused by ffmpeg can not access to inside pak, but Lumberyard passing the video file path to ffmpeg even its in the pak.
Anyway, My situation is similar to this topic, I need to deliver the release build to my customer with video playback in the 3D and I want to encript the video in the pak file instead of regular file for contents protection purpose. But I get black screen on release build.
Any suggestions?
Hi @REDACTEDUSER
AZ::u64 fileSize;
if (!AZ::IO::FileIOBase::GetInstance()->Size(filename, fileSize))
{
m_LastError.Format("Failed to retrieve file size for '%s'", filename);
return false;
}
char *buffer = new char[fileSize];
AZ::IO::FileIOStream stream(filename, AZ::IO::OpenMode::ModeRead);
if (stream.Read(fileSize, buffer) != fileSize)
{
m_LastError.Format("Failed to read %u bytes from file '%s'", fileSize, filename);
return false;
}
... use the buffer for video playback ...
Here's an example which shows how to use libav to read from memory: https://riptutorial.com/ffmpeg/example/30955/reading-from-memory
Currently the Decoder loads the file using avformat_open_input given the filename path https://github.com/aws/lumberyard/blob/master/dev/Gems/VideoPlayback/Code/Source/Decoder.cpp#L70
I hope this helps, if you're successful , it'd make a nice pull request :slight_smile:
Thank you for pointing me to information, I will take a look and try to implement it. If it will go well then I will send a pull request.
Basically, this approach seems working, with additional issues.
I could load the AVI in the pak with release client, but failed to load MP4. It requires more research for ffmpeg codec handlings, but AVI is enough for us at this moment.
Additionally, LoadVideo function is called at the component Activate timing, that results memory issue on our target platform, so I need to modify VideoPlaybackGameComponent to implement the delay video load eventually.
Thank you.
This post is closed: Adding new answers, comments, and votes is disabled.
Relevant content
- asked a year ago
- asked 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago