question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Video decoder null reference exception on startup

See original GitHub issue

Describe the crash: The OSU program crashes on initialization with the following error messages.

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at osu.Framework.Graphics.Video.VideoDecoder.GetConversionMatrix()
   at osu.Framework.Graphics.Video.VideoSprite.get_ConversionMatrix()
   at osu.Framework.Graphics.Video.VideoSpriteDrawNode..ctor(VideoSprite source)
   at osu.Framework.Graphics.Video.VideoSprite.CreateDrawNode()
   at osu.Framework.Graphics.Drawable.GenerateDrawNodeSubtree(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.addFromComposite(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode, Int32& j, CompositeDrawable parentComposite, List`1 target)
   at osu.Framework.Graphics.Containers.CompositeDrawable.GenerateDrawNodeSubtree(UInt64 frame, Int32 treeIndex, Boolean forceNewDrawNode)
   at osu.Framework.Platform.GameHost.UpdateFrame()
   at osu.Framework.Threading.GameThread.ProcessFrame()
   at osu.Framework.Threading.GameThread.runWork()
--- End of stack trace from previous location where exception was thrown ---
   at osu.Framework.Platform.GameHost.<>c__DisplayClass93_0.<handleException>b__0()
   at osu.Framework.Threading.ScheduledDelegate.RunTaskInternal()
   at osu.Framework.Threading.Scheduler.Update()
   at osu.Framework.Threading.GameThread.ProcessFrame()
   at osu.Framework.Platform.GameHost.handleInput()
   at osuTK.GameWindow.RaiseUpdateFrame(Stopwatch watch, Double elapsed, Double& timestamp)
   at osuTK.GameWindow.DispatchUpdateFrame(Stopwatch watch)
   at osuTK.GameWindow.Run(Double updates_per_second, Double frames_per_second)
   at osuTK.GameWindow.Run()
   at osu.Framework.Platform.GameWindow.Run()
   at osu.Framework.Platform.GameHost.Run(Game game)
   at osu.Desktop.Program.Main(String[] args) in /var/lib/buildkite-agent/builds/debian-gnu-linux-vm-1/ppy/osu/osu.Desktop/Program.cs:line 57
Aborted (core dumped)

It seems to be related to this PR since the bug does not exist before #7935 update-framework.

osu!lazer version: Commits after 000787a766582bd43fae3464908bcb05e3385b36.

Computer Specifications:

  • Ubuntu 18.04.4 LTS
  • Memory 15.6 GB
  • Processor Intel Core i7-4720HQ
  • Graphics GeForce GTX 965M

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
bdachcommented, Feb 21, 2020

While this crash should be better-handled framework-side, at least in my case it turned out that one of the issues was a missing libavformat.so. Therefore for the time being you could try to install the distribution-appropriate packages containing libavformat.

Confirmation that this is the case for you can be obtained by examining runtime logs (should have an entry about missing libraries right before the crash stack) or passing LD_DEBUG=libs.

For example, on my xenial 16.04, I got video fully working by installing ffmpeg 4 along with libavformat & co. from an external PPA. Note that installing ffmpeg pre-v4 might alleviate crashes, but not make video work as framework does not currently support those versions (the decoding process is missing av_register_all() calls at the start of decoding, which are no longer necessary and therefore deprecated with version 4).

Also please double-check that your symlinks in /usr/lib/x86_64-linux-gnu or similar are correctly hooked up. The root .sos should be pointing at new libavcodec/libavformat versions, not any old ones possibly leftover from the default ubuntu install.

2reactions
huupoke12commented, Feb 21, 2020

Maybe related to the ffmpeg version. I’m running Arch Linux with ffmpeg 4.2.2 and do not have this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Null Reference Exception when playing video
NullReferneceException mean you tried to use a null variable. My best bet is MyVideoPlayer = GetComponent<VideoPlayer> is not called, or you ...
Read more >
How can I fix the error: System.NullReferenceException
A NullReferenceException exception is thrown when you try to access a member on a type whose value is null. A NullReferenceException exception ...
Read more >
In Unity (C#), why am I getting a NullReferenceException ...
It's possible that you have something in Awake() or Start() that's negating the reference, and you'll see the inspector switch to None ....
Read more >
MediaCodec
Quickly bring your app to life with less code, using a modern declarative approach to UI, and the simplicity of Kotlin. ... Start...
Read more >
Object reference not set to an instance of an object.
This code is blowing up on me, on the last line. No other errors thrown. This is some generated code from a Blazor...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found