'Frame.frameDuration' is null
See original GitHub issueNew Issue Checklist
- I have searched for a similar issue in the project and found none
Issue Info
Info | Value | |
---|---|---|
Device Info | Redmi Note 7 Pro | |
System Version | 10.0 | |
APNG4Android Library Version | 2.23.0 | |
Repro rate | (100%) | |
Repro with our demo project | - | |
Demo project link | - |
Issue Description and Steps
Although the first frame is saved as file properly. But the frameCount is 0 and cannot get Frame.frameDuration for first frame at least.
I wanted to iterate through each frame but framecount is 0 so stuck here.
Exception: Attempt to read from field 'int com.github.penfeizhou.animation.decode.Frame.frameDuration' on a null object reference
WebPDecoder decoder = new WebPDecoder(new FileLoader(path),null);
if (decoder != null){
Bitmap bm = decoder.getFrameBitmap(0);
// saveBitmap(bm);
// first frame is saved succefully...
// but here getFrameCount is 0 and invoking getFrame() causes error
int frameCount = decoder.getFrameCount();
int frameDuration = decoder.getFrame(0).frameDuration;
}
also tried this way. But still zero frame count and null getFrame()
FrameSeqDecoder decoder = WebPDrawable.fromFile(path).getFrameSeqDecoder();
WebPDecoder decoder = WebPDrawable.fromFile(path).getFrameSeqDecoder();
Issue Analytics
- State:
- Created a year ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to tell if an AVAssetTrack has a variable framerate?
I'm aware I can decode every frame and check that the frame duration doesn't change each frame but this is costly, I've had...
Read more >Storing a position value from the previous frame - 3745574
frameDuration. an expression that would display the x position of a null in the previous frame would look like this. nl = thisComp.layer("Null...
Read more >frameDuration Method in After Effects Expression - YouTube
Learn how to use the frame duration method and print out the frame rate, frame count and reset frames based off seconds.
Read more >minFrameDuration | Apple Developer Documentation
A track's minimum frame duration is the reciprocal of its maximum frame rate. ... is invalid if the track can't calculate its minimum...
Read more >How to set correct frameRate or frameDuration when writing ...
Use webm-writer-js to add frames from multiple input video tracks potentially containing different pixel dimensions. Commented lines in this.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The render listener‘s timing is precise.
Is there synchronised way. Because I can’t get Frame Bitmap and and Frame info togather. Either I will get frame count in OnStart() or get Bitmaps outside of render listener.
I tried invoking decoder.stop in OnStart like this
But this is very slow for large number of frames. Takes 1 second for each iteration