stride icon indicating copy to clipboard operation
stride copied to clipboard

Video with FFMpeg cannot be played multiple times

Open vdvman1 opened this issue 3 years ago • 1 comments

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:

  1. Follow the steps in the setup video manual
  2. Ensure the video is set to loop
  3. 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();
        }
    }
  1. Add <StrideGraphicsApi>Vulkan</StrideGraphicsApi> to the <project>.Windows.csproj inside the <PropertyGroup>
  2. Run the windows project, the video will start after 10 seconds and when it loops it will throw the exception
  3. 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: test-image

vdvman1 avatar Jun 15 '21 00:06 vdvman1

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.

vdvman1 avatar Jun 07 '22 23:06 vdvman1