Problem muxing an MP4 file (encoded via jcodec) and AAC with MP4Parser

341 views
Skip to first unread message

Ralph Damiano

unread,
Sep 2, 2015, 5:16:09 PM9/2/15
to mp4parser-discussion
I hope someone can point me in the right direction, really would appreciate it.

I have an MP4 file that I generate with jcodec.


I then have an AAC file I generate with Android's MediaCodec.


I want to mux them together into a single file and since I don't want to limit my Android API too high, I'm opting for MP4Parser.


Currently, I'm doing the standard:


H264TrackImpl h264Track = new H264TrackImpl(new FileDataSourceImpl("input.mp4"));
AACTrackImpl aacTrack = new AACTrackImpl(new FileDataSourceImpl("input.aac"));

Movie movie = new Movie(); movie.addTrack(h264Track); movie.addTrack(aacTrack);

Container mp4file = new DefaultMp4Builder().build(movie);

FileOutputStream fileOutputStream = new FileOutputStream(new File("output.mp4"));
FileChannel fc = fileOutputStream.getChannel();
mp4file
.writeContainer(fc);
fileOutputStream
.close();


However, the app crashes on this line:


H264TrackImpl h264Track
= new H264TrackImpl(new FileDataSourceImpl("input.mp4"));


With this as the stack trace:

09-01 18:46:40.611: E/AndroidRuntime(14115): FATAL EXCEPTION: GLThread 1260
09-01 18:46:40.611: E/AndroidRuntime(14115): Process: package.app, PID: 14115
09-01 18:46:40.611: E/AndroidRuntime(14115): java.lang.RuntimeException: Sequence parameter set extension is not yet handled. Needs TLC.
09-01 18:46:40.611: E/AndroidRuntime(14115): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.readSamples(H264TrackImpl.java:362)
09-01 18:46:40.611: E/AndroidRuntime(14115): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.parse(H264TrackImpl.java:108)
09-01 18:46:40.611: E/AndroidRuntime(14115): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.<init>(H264TrackImpl.java:90)
09-01 18:46:40.611: E/AndroidRuntime(14115): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.<init>(H264TrackImpl.java:96)
09-01 18:46:40.611: E/AndroidRuntime(14115): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.<init>(H264TrackImpl.java:100)
09-01 18:46:40.611: E/AndroidRuntime(14115): at ...


So I'm not really sure what that means? Does jcodec output an MP4 file (which works in all video players btw) that isn't compatible with MP4Parser?


What should I be looking into to fix this?


Appreciate any advice!


Sebastian Annies

unread,
Sep 3, 2015, 10:46:31 AM9/3/15
to mp4parser-...@googlegroups.com
Hi,
that means that I never had an input files that had a SPS extension. Could you please make this file available so that I can extend the mp4parser to support it?
Thanks!

--
You received this message because you are subscribed to the Google Groups "mp4parser-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mp4parser-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ralph Damiano

unread,
Sep 3, 2015, 4:13:01 PM9/3/15
to mp4parser-discussion
Ah, interesting.

I don't know much (read: any) about this type of MP4 encoding stuff, would that be a type of thing I can change when encoding an MP4 from jcodec (if you happen to know, that is). Or is that just how that particular library works?

In any case, I've attached a small MP4 generated with jcodec that gives the above error when imported into MP4Parser.

Thanks for the reply, though, really appreciate it.
jcodec-mp4.mp4
Reply all
Reply to author
Forward
0 new messages