stride
stride copied to clipboard
Video with FFMpeg cannot be played multiple times
Release Type: Release
Version: 4.1.0.1459-beta
Platform(s): Windows with <StrideGraphicsApi>Vulkan</StrideGraphicsApi>
Describe the bug
The first time a video is played (if delayed, see note) it works as expected, however, if the video loops or is played again sometime after the first playthrough has completed an exception is thrown. Specifically private FrameExtractionStatus ExtractNextImage(StreamInfo streamInfo, AVPacket* pPacket, AVStream* pStream, byte_ptrArray4 dstData, int_array4 dstLinesize)
throws an ApplicationException("Couldn't transfer frame data from GPU to CPU");
on line 401
Note: If first time the video is played is not delayed (i.e. played in the Start
method of a StartupScript
or immediately in the Execute
method of an AsyncScript
) the exception will be thrown immediately rather than when it loops
To Reproduce Steps to reproduce the behavior:
- Follow the steps in the setup video manual
- Ensure the video is set to loop
- Use the following script instead of the
StartupScript
that the manual suggests, in order to delay the startup of the video
public class PlayVideoScript : AsyncScript
{
public override async Task Execute()
{
await Task.Delay(10 * 1000);
Entity.Get<VideoComponent>()?.Instance.Play();
}
}
- Add
<StrideGraphicsApi>Vulkan</StrideGraphicsApi>
to the<project>.Windows.csproj
inside the<PropertyGroup>
- Run the windows project, the video will start after 10 seconds and when it loops it will throw the exception
- If it does not throw the exception try using specifically the video file attached to this issue
Expected behavior The video to play successfully every time and for it to loop
Screenshots
Log and callstacks video-crash.txt
Additional context
Video used during testing: https://user-images.githubusercontent.com/2172023/121974554-fd2f0a00-cdc2-11eb-9aa0-b83f289bc51a.mp4
Target texture used during testing:
Is anyone working on this yet? We can't use the DirectX implementation in our application as we need to be able to run at non-realtime, and the DirectX implemention doesn't appear to utilise the delta time. As such, this is a blocking bug for us.