Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MacOS] AVPixelFormat crash #184

Open
JulienDev opened this issue Nov 25, 2024 · 5 comments
Open

[MacOS] AVPixelFormat crash #184

JulienDev opened this issue Nov 25, 2024 · 5 comments

Comments

@JulienDev
Copy link

Describe the bug
I noticed a few crashes on MacOS related to AVPixelFormat. All MacOS versions are impacted and I'm using fvp 0.28.0 and mdk 0.3.0 with Flutter 3.24.3

Expected behavior
The app should not crash

Log
I can't reproduce on my Mac so I can share with you the Crashlytics stacktrace:

Crash : mdk.vdec0@0x700004c26000
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000
Crashed: mdk.vdec0@0x700004c26000
0  mdk                            0xb3712 mdk::abi::ffmpeg::to(mdk::abi::VideoFormat&, AVPixelFormat) + 1724 (__hash_table:1724)
1  mdk                            0xb65a1 mdk::abi::ffmpeg::to(mdk::abi::VideoFrame&, AVFrame const*, AVRational const&) + 173 (VideoFrameGlue.cpp:173)
2  mdk                            0xc3486 mdk::abi::VideoDecoderFFmpegBase::from(AVFrame*) + 167 (VideoDecoderFFmpegBase.cpp:167)
3  mdk                            0xc3c59 mdk::abi::VideoDecoderAVCodec::from(AVFrame*) + 379 (VideoDecoderAVCodec.cpp:379)
4  mdk                            0xc3549 std::__1::__function::__func<mdk::abi::VideoDecoderFFmpegBase::decode(mdk::abi::Packet const&)::$_3, std::__1::allocator<mdk::abi::VideoDecoderFFmpegBase::decode(mdk::abi::Packet const&)::$_3>, double (AVFrame*)>::operator()(AVFrame*&&) + 60 (VideoFrame.h:60)
5  mdk                            0xbf70c mdk::abi::AVCoderBase::decodePacket(AVCodecContext*, mdk::abi::Packet const&, std::__1::function<double (AVFrame*)>&&) + 139 (AVCoderBase.cpp:139)
6  mdk                            0xc340e mdk::abi::VideoDecoderFFmpegBase::decode(mdk::abi::Packet const&) + 138 (VideoDecoderFFmpegBase.cpp:138)
7  mdk                            0x22cdd bool mdk::abi::FrameReaderImpl::decodeLoop<(mdk::abi::MediaType)0>(int, int) + 2500 (FrameReader.cpp:2500)
8  mdk                            0x1dfd2 void* std::__1::__thread_proxy[abi:nn180100]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, mdk::abi::FrameReaderImpl::startDecodeThread(mdk::abi::FrameReaderImpl::DecLoopState&, mdk::abi::MediaType, int)::$_0>>(void*) + 2732 (FrameReader.cpp:2732)
9  libsystem_pthread.dylib        0x64e1 _pthread_start + 125
10 libsystem_pthread.dylib        0x1f6b thread_start + 15
        
@wang-bin
Copy link
Owner

when does it crash? what decoders do you set? a log will be helpful

@JulienDev
Copy link
Author

Unfortunately, I have no idea when it's happening as I didn't add enough tracking information. I will add more in the future!
I'm not setting any decoder so it's probably using the default ones. Also, I'm using the Backend Player API.

@wang-bin
Copy link
Owner

if you are using backend api, then software decoder is used, less efficient. you have to set via player videoDecoders, see video_player_mdk.dart

@JulienDev
Copy link
Author

Ah ok good to know, I'll make the changes.
Actually, the only reason why I'm using the backend API is because in the past it was not possible to control tracks. I'll check if thanks to your latest additions I can move to VideoPlayerPlatform implementation.

@wang-bin
Copy link
Owner

now you can use videoplayercintroller with extensions, see controller.dart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants