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

A cast to int has gone wrong. Please contact the mp4parser discussion group (2332179761) #216

Open
grennis opened this issue Jul 14, 2016 · 9 comments

Comments

@grennis
Copy link

grennis commented Jul 14, 2016

Hi, I got this error trying to combine MP4s that had just been recorded by the MediaRecorder.

This worked fine on my galaxy S5 (Android 6) and also on nexus 4 (Android 5.1),

But using phone Motorola X (XT1053) with Android 5.1 I get this exception every time. Any ideas what might be the issue?

Using latest version 1.1.21.

07-14 15:12:45.112 10854-10894/? W/System.err: java.lang.RuntimeException: A cast to int has gone wrong. Please contact the mp4parser discussion group (3878608261)
07-14 15:12:45.120 10854-10867/? W/art: Suspending all threads took: 6.012ms
07-14 15:12:45.125 10854-10894/? W/System.err: at com.googlecode.mp4parser.util.CastUtils.l2i(CastUtils.java:30)
07-14 15:12:45.125 10854-10894/? W/System.err: at com.googlecode.mp4parser.AbstractBox.parse(AbstractBox.java:110)
07-14 15:12:45.125 10854-10894/? W/System.err: at com.coremedia.iso.AbstractBoxParser.parseBox(AbstractBoxParser.java:107)
07-14 15:12:45.125 10854-10894/? W/System.err: at com.googlecode.mp4parser.BasicContainer.next(BasicContainer.java:185)
07-14 15:12:45.125 10854-10894/? W/System.err: at com.googlecode.mp4parser.BasicContainer.hasNext(BasicContainer.java:161)
07-14 15:12:45.131 10854-10894/? W/System.err: at com.googlecode.mp4parser.util.LazyList.blowup(LazyList.java:30)
07-14 15:12:45.132 10854-10894/? W/System.err: at com.googlecode.mp4parser.util.LazyList.size(LazyList.java:77)
07-14 15:12:45.132 10854-10894/? W/System.err: at com.googlecode.mp4parser.BasicContainer.getBoxes(BasicContainer.java:80)
07-14 15:12:45.132 10854-10894/? W/System.err: at com.googlecode.mp4parser.authoring.samples.DefaultMp4SampleList.(DefaultMp4SampleList.java:36)
07-14 15:12:45.132 10854-10894/? W/System.err: at com.coremedia.iso.boxes.mdat.SampleList.(SampleList.java:33)
07-14 15:12:45.132 10854-10894/? W/System.err: at com.googlecode.mp4parser.authoring.Mp4TrackImpl.(Mp4TrackImpl.java:64)
07-14 15:12:45.132 10854-10894/? W/System.err: at com.googlecode.mp4parser.authoring.container.mp4.MovieCreator.build(MovieCreator.java:57)
07-14 15:12:45.132 10854-10894/? W/System.err: at com.googlecode.mp4parser.authoring.container.mp4.MovieCreator.build(MovieCreator.java:38)

@followthemoney1
Copy link

same

@nolawnchairs
Copy link

This happens when I try to parse a file > 2GB. The "cast to int" is the clue, if the file size is larger than what a signed 32-bit int can hold. Perhaps wherever this happens, should use long instead?

@kishanverma26
Copy link

same issue with me but file size is less the 10 MB

@AllwinJohnson
Copy link

AllwinJohnson commented Aug 20, 2020

I have found this issue in two phones Moto g5 plus and Moto z2 play, other devices are fine. The crash occurs in
Movie m = MovieCreator.build(video);
where video is the path to the video file in internal memory.
Error log

E/UncaughtException: java.lang.RuntimeException: A cast to int has gone wrong. Please contact the mp4parser discussion group (2982292332)

@Lapinou42
Copy link

Hello,
I have exactly the same exception sometimes with short videos.
Do you have any solutions to this ?

@Lapinou42
Copy link

Well, for someone who have the same error (I'm on Xamarin Android but it's the same on Android):

I use the 1.1.8 version that seems to fix the Cast to int error.
Then, I check if a file exists at the same path used in the MovieCreator.build(path) and if it exists, I delete it.
This resolves the OOM exception.

See => #139 (comment)

@charneykaye
Copy link

I'm experiencing this error in a test trying to parse a container I just wrote. Here's my StackOverflow question and a public GitHub project I made specifically to reproduce this issue.

@r4lly99
Copy link

r4lly99 commented Jan 3, 2022

Is there a new update for this issue?

@febinmathew
Copy link

Any updates?

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

9 participants