mp4parser icon indicating copy to clipboard operation
mp4parser copied to clipboard

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

Open grennis opened this issue 8 years ago • 9 comments

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)

grennis avatar Jul 14 '16 19:07 grennis

same

followthemoney1 avatar Jul 05 '17 12:07 followthemoney1

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?

nolawnchairs avatar Apr 09 '18 07:04 nolawnchairs

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

kishanverma26 avatar Jun 22 '20 04:06 kishanverma26

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)

AllwinJohnson avatar Aug 20 '20 08:08 AllwinJohnson

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

Lapinou42 avatar Apr 16 '21 08:04 Lapinou42

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 => https://github.com/sannies/mp4parser/issues/139#issuecomment-240029219

Lapinou42 avatar Apr 16 '21 13:04 Lapinou42

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.

charneykaye avatar Oct 19 '21 08:10 charneykaye

Is there a new update for this issue?

r4lly99 avatar Jan 03 '22 00:01 r4lly99

Any updates?

febinmathew avatar Jul 21 '22 11:07 febinmathew