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.

Null Pointer Exception

See original GitHub issue

I am getting java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference error while compressing a 4K video with details:

Video track:

  • Codec: H264-MPEG-4 AVC(part 10)
  • Resolution: 3840*2160
  • Frame rate: 30.010

Audio track

  • Sample rate: 44100 Hz
  • Codec: MPEG AAC Audio
  • 1 channel

I have used simple transformation api as: mediaTransformer.transform( requestId, inputUri, outputFilePath, targetVideoFormat, null, transformationListener, MediaTransformer.GRANULARITY_DEFAULT, null)

targetVideoFormat is generated as: `MediaFormat targetVideoFormat = new MediaFormat()

targetVideoFormat.setString(MediaFormat.KEY_MIME, “video/avc”); targetVideoFormat.setInteger(MediaFormat.KEY_WIDTH, 1920); targetVideoFormat.setInteger(MediaFormat.KEY_HEIGHT, 1080); targetVideoFormat.setInteger(MediaFormat.KEY_BIT_RATE, targetBitrate); targetVideoFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 5); targetVideoFormat.setInteger(MediaFormat.KEY_FRAME_RATE, 30); targetVideoFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);`

Is there anything I am missing?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
NischalManandharcommented, Sep 17, 2020

Thanks for the quick update. New version of LiTr (1.4.0) fixed the crash issue.

0reactions
izzytwoshedscommented, Sep 16, 2020

I also just released the new version of LiTr (1.4.0) which has this fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - What is a NullPointerException, and how do I fix it?
NullPointerException s are exceptions that occur when you try to use a reference that points to no location in memory ...
Read more >
NullPointerException (Java Platform SE 7 ) - Oracle Help Center
Thrown when an application attempts to use null in a case where an object is required. These include: ... Applications should throw instances...
Read more >
Null Pointer Exception In Java - GeeksforGeeks
NullPointerException is a RuntimeException. In Java, a special null value can be assigned to an object reference. NullPointerException is thrown ...
Read more >
How to Fix and Avoid NullPointerException in Java - Rollbar
The NullPointerException occurs due to a situation in application code where an uninitialized object is attempted to be accessed or modified.
Read more >
Java NullPointerException - Detect, Fix, and Best Practices
NullPointerException is a runtime exception, so we don't need to catch it in the program. NullPointerException is raised in an application ...
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 Reddit Thread

No results found

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