3d0c / gmf

Go Media Framework
MIT License
885 stars 170 forks source link

Windows10, Resource temporarily unavailable #133

Open Leadrive opened 3 years ago

Leadrive commented 3 years ago

Hi, I tested the video-to-image.go example in Windows 10, https://github.com/flutter/plugins/blob/master/packages/video_player/video_player/example/assets/Butterfly-209.mp4

this video will report Resource temporarily unavailable error. the tests-sample.mp4 will work ok.

3d0c commented 3 years ago

I have tested your example right now and everything works fine. May be it's a codec issue. Check what encoders your library supported and try different ones.

Leadrive commented 3 years ago

Sorry I don't know how to change the codec.

I follow the ReadMe ./configure --prefix=/usr/local/ffmpeg --enable-shared make make install

and copy the all the dll files to example directory.

After run video-to-image, it will report Resource temporarily unavailable.

I search the issues, change Decode()=>Decode2() it will work with tests-sample.mp4, but did not work for other videos.


        frame, ret = ist.CodecCtx().Decode2(pkt)
        if ret < 0 {
            fmt.Printf("Unexpected error - %s\n", gmf.AvError(ret))
            break
        }

        frames, err = gmf.DefaultRescaler(swsctx, []*gmf.Frame{frame})
        if err != nil {
            fmt.Printf("Error scaling - %s\n", err)
            break
        }

I tested it in Windows7, it take error. the same code and same videos, In Ubuntu 18.02, it work fine.

3d0c commented 3 years ago

Well, possible issue might be the wrong destination path (in terms of Windows), default output path is ./tmp this is linux specific.

Leadrive commented 3 years ago

thanks your reply. run with tests-sample.mp4, In the ./tmp path, it have the many result image files.

debugger-zhang commented 8 months ago

I now found the potential issue, see here.