regarding muxing .mp4 video only file + .aac file to create .mp4 file

Showing 1-24 of 24 messages
regarding muxing .mp4 video only file + .aac file to create .mp4 file satish MR 1/4/13 7:43 AM
Hi,
  I was trying to use latest isoviewer-2.0-RC-18.jar library in my demo android app and achieve below use-case,
Stream1 : Video (.h264 baseline) in .mp4 file (no Audio present in it)
Stream2 : Audio (.acc LC, with adts format) in .aac file.

I want to mux Stream1 & Stream2 and finally create .mp4. 
Is that usecase is achievable currently? 


Meanwhile I tried to mux a .h264 & .aac streams to form .mp4 file. but ended up with below error:

--------
E/AndroidRuntime(18600): Caused by: java.lang.RuntimeException: java.io.IOException
E/AndroidRuntime(18600): at com.googlecode.mp4parser.android.Mp4ParserPerformance.onCreate(Mp4ParserPerformance.java:111)
E/AndroidRuntime(18600): at android.app.Activity.performCreate(Activity.java:4465)
E/AndroidRuntime(18600): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
E/AndroidRuntime(18600): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
E/AndroidRuntime(18600): ... 11 more
E/AndroidRuntime(18600): Caused by: java.io.IOException
E/AndroidRuntime(18600): at java.io.InputStream.reset(InputStream.java:218)
E/AndroidRuntime(18600): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl$ReaderWrapper.reset(H264TrackImpl.java:556)
E/AndroidRuntime(18600): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.readSamples(H264TrackImpl.java:245)
E/AndroidRuntime(18600): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.parse(H264TrackImpl.java:87)
E/AndroidRuntime(18600): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.<init>(H264TrackImpl.java:76)
E/AndroidRuntime(18600): at com.googlecode.mp4parser.android.Mp4ParserPerformance.onCreate(Mp4ParserPerformance.java:88)
E/AndroidRuntime(18600): ... 14 more
------------------------------------
 
Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file satish MR 1/4/13 7:58 AM
Sorry missed download links for files,
AW: regarding muxing .mp4 video only file + .aac file to create .mp4 file Sebastian Annies 1/4/13 10:55 AM

Without having looked into the files I can say one thing: Don’t use isoviewer jars as they are an application, use the isoparser jars from the maven repositories as they are the library.

 

Von: mp4parser-...@googlegroups.com [mailto:mp4parser-...@googlegroups.com] Im Auftrag von satish MR
Gesendet: Freitag, 4. Januar 2013 16:58
An: mp4parser-...@googlegroups.com
Betreff: Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file

Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file satish MR 1/4/13 6:29 PM
Thanks for your reply. 

I tried using "isoparser-1.0-RC-15" from http://mvnrepository.com/artifact/com.googlecode.mp4parser/isoparser  But this library also behaving same.
I have extracted .h264 file from corresponding .mp4 file using YAMB.exe tool. 
AW: regarding muxing .mp4 video only file + .aac file to create .mp4 file Sebastian Annies 1/5/13 3:30 AM

Hi,

 

I could have seen this one on the first glance (but I didn’t … )

 

The H264TrackImpl requires the InputStream to support mark & reset. The plain FileInputStream doesn’t support it. Please wrap the raw H264 FileInputStream in a BufferedInputStream and everything will work just fine.

 

H264TrackImpl h264Track = new H264TrackImpl(new BufferedInputStream(new FileInputStream("m.h264")));

 

Mark&reset is just required due to a sloppy implementation. I’ll probably change it in the next releases but wrapping a FileInputStream in a BufferedInputStream doesn’t hurt ;)

 

Best Regards,

Sebastian

 

Von: mp4parser-...@googlegroups.com [mailto:mp4parser-...@googlegroups.com] Im Auftrag von satish MR
Gesendet: Samstag, 5. Januar 2013 03:30

Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file satish MR 1/6/13 4:02 AM
Hi,

Thanks a lot for the help.
I could move forward with that. But Still I felt I am missing something.

Case 1: For below streams I got,

E/AndroidRuntime( 6988): Caused by: java.lang.RuntimeException: too many PopLocalFrame calls
E/AndroidRuntime( 6988): at libcore.io.Posix.writev(Native Method)
E/AndroidRuntime( 6988): at libcore.io.BlockGuardOs.writev(BlockGuardOs.java:196)
E/AndroidRuntime( 6988): at java.nio.IoVec.doTransfer(IoVec.java:81)
E/AndroidRuntime( 6988): at java.nio.FileChannelImpl.transferIoVec(FileChannelImpl.java:327)
E/AndroidRuntime( 6988): at java.nio.FileChannelImpl.write(FileChannelImpl.java:505)
E/AndroidRuntime( 6988): at java.nio.channels.FileChannel.write(FileChannel.java:716)
E/AndroidRuntime( 6988): at com.googlecode.mp4parser.authoring.builder.DefaultMp4Builder$InterleaveChunkMdat.getBox(DefaultMp4Builder.java:475)
E/AndroidRuntime( 6988): at com.coremedia.iso.IsoFile.getBox(IsoFile.java:182)
E/AndroidRuntime( 6988): at com.googlecode.mp4parser.android.Mp4ParserPerformance.onCreate(Mp4ParserPerformance.java:99)
E/AndroidRuntime( 6988): at android.app.Activity.performCreate(Activity.java:4465)
E/AndroidRuntime( 6988): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
E/AndroidRuntime( 6988): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)

Case 2: for these 2 streams,

Error was,
E/AndroidRuntime( 7091): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 7091): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.readSamples(H264TrackImpl.java:283)
E/AndroidRuntime( 7091): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.parse(H264TrackImpl.java:87)
E/AndroidRuntime( 7091): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.<init>(H264TrackImpl.java:76)
E/AndroidRuntime( 7091): at com.googlecode.mp4parser.android.Mp4ParserPerformance.onCreate(Mp4ParserPerformance.java:90)
E/AndroidRuntime( 7091): at android.app.Activity.performCreate(Activity.java:4465)
E/AndroidRuntime( 7091): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
E/AndroidRuntime( 7091): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)

I used aspectjrt-1.6.6.jar also to avoid class not found exception.

Thanks again for your followup.
AW: regarding muxing .mp4 video only file + .aac file to create .mp4 file Sebastian Annies 1/6/13 4:31 AM

What you see is some bullshit android internal restriction on how many ByteBuffers you can write at once (I never traced the error to its root, I’d need to go to Android C sources for that). I think you use RC-15, please try RC-18 from  this repository: https://oss.sonatype.org/content/repositories/comgooglecodemp4parser-137/  in RC-18 it should be fixed.

 

Von: mp4parser-...@googlegroups.com [mailto:mp4parser-...@googlegroups.com] Im Auftrag von satish MR
Gesendet: Sonntag, 6. Januar 2013 13:03

Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file satish MR 1/6/13 5:07 AM
Hi,

Thats awesome. It worked like anything.
Moov atom is placed at beginning of the created .mp4 file. Thats really useful. Great work.

Meanwhile I faced beloe problem for these files.

E/AndroidRuntime(11763): Caused by: java.lang.NullPointerException
E/AndroidRuntime(11763): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.readSamples(H264TrackImpl.java:283)
E/AndroidRuntime(11763): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.parse(H264TrackImpl.java:87)
E/AndroidRuntime(11763): at com.googlecode.mp4parser.authoring.tracks.H264TrackImpl.<init>(H264TrackImpl.java:76)
E/AndroidRuntime(11763): at com.googlecode.mp4parser.android.Mp4ParserPerformance.onCreate(Mp4ParserPerformance.java:80)
E/AndroidRuntime(11763): at android.app.Activity.performCreate(Activity.java:4465)
E/AndroidRuntime(11763): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
E/AndroidRuntime(11763): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file Sebastian Annies 1/28/13 9:50 PM
Hi, 

I fixed the issue you are seeing. But I ran into a new issue: The video file you sent me has seemingly no fixed framerate. It has a variable framerate. This is typical for a low cost phone's h264-encoder. This is not yet supported and is not likely to be implemented by me. One would need to decode PTS/DTS for every frame to get the number of milliseconds each frame needs to be displayed and to construct the correct "time to sample"-box. 

Best Regards,
Sebastian
Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file Sebastian Annies 1/28/13 9:51 PM
BTW.: It is fixed in the trunk and it hasn't been released yet. You will need to build the trunk.
Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file satish MR 1/28/13 9:58 PM
Great. Thanks a lot. Please intimate once the build is ready.
I will go through the code and try to contribute for variable framerate elementary streams.
Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file Guillaume Lachaud 4/30/13 5:53 AM
Hi !

I think I am trying to achieve the exact same thing. I have used MediaCodec API in Android to produce raw h264 file and raw AAC file. Now I am trying to mux them altogether. Unfortunately, using the trunk version, I am facing an exception :

04-30 14:45:42.785: W/System.err(31755): java.io.IOException: Expected Start Word 0xfff
04-30 14:45:42.795: W/System.err(31755): at com.googlecode.mp4parser.authoring.tracks.AACTrackImpl.readADTSHeader(AACTrackImpl.java:290)
04-30 14:45:42.795: W/System.err(31755): at com.googlecode.mp4parser.authoring.tracks.AACTrackImpl.readSamples(AACTrackImpl.java:322)

It seems that my aac file is missing headers. Do any of you have tried to use the muxer with files created with MediaCodec API ? How can I add the correct headers to my file ?

Thanks

Le mardi 29 janvier 2013 06:58:43 UTC+1, satish MR a écrit :
Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file Lionel Carminati 4/30/13 6:34 AM
are you sure your raw AAC audio file remains on ADTS header ? LATM ? LOAS ?

Is mp4parser support LATM headers in both mode explicit and implicit ?

lC


2013/4/30 Guillaume Lachaud <guillaum...@backelite.com>

--
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-discussion+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file Guillaume Lachaud 4/30/13 7:20 AM
I don't think it has any header at all. The MediaCodec API just returns raw AAC frames from the encoder, it seems to be up to me to encapsulate this in a ADTS frame but I am looking for a tool to do so.


2013/4/30 Lionel Carminati <lionel.c...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "mp4parser-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mp4parser-discussion/a9RbWVs5Kgs/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to mp4parser-discussion+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--






Guillaume LACHAUD
Backelite - Développeur Android

7, rue de Bucarest - 75008 PARIS - FRANCE
Tel  : +33 1 73 00 28 36


                         

.

Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file Lionel Carminati 4/30/13 8:23 AM
what do u mean "no header at all" ?? How can you mux raw AAC file into MP4 without any information about frequency, channel number, bit depth, etc ?

try to open your file with mediainfo and have a look to general/format tab


regards


2013/4/30 Guillaume Lachaud <guillaum...@backelite.com>

Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file Guillaume Lachaud 5/2/13 1:09 AM
That's indeed the problem. I know it won't be possible and was wondering whether mp4parser would be able to add these headers. 

The problem is that the undocumented MediaCodec API just returns raw AAC frames so I don't have any headers. I am considering using FFMPEG to encapsulates these frames unless I find a better tool.

MediaInfo just displays the file size


2013/4/30 Lionel Carminati <lionel.c...@gmail.com>
Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file satish MR 5/2/13 3:30 AM

Hey generate your own adts headers and prepend it to each raw aac frame. Its easy. Its working for me

Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file Guillaume Lachaud 5/2/13 7:01 AM
Hi !

I am now generating my own adts headers using these specifications : 


The file is now playable but it doesn't sound good, it seems to play too fast. I am not sure how to implement Buffer fullness in the adts header (O).

Here is what mplayer says about my aac file :


aac @ 0x101818a00] Reserved bit set.

[aac @ 0x101818a00] Input buffer exhausted before END element found

[aac @ 0x101818a00] channel element 0.1 is not allocated

[aac @ 0x101818a00] Input buffer exhausted before END element found

[aac @ 0x101818a00] channel element 0.14 is not allocated

[aac @ 0x101818a00] Input buffer exhausted before END element found


Le jeudi 2 mai 2013 12:30:09 UTC+2, satish MR a écrit :

Hey generate your own adts headers and prepend it to each raw aac frame. Its easy. Its working for me

Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file Lionel Carminati 5/2/13 8:26 AM
send me ur aac file i will check it with interra vega TSA (audio/video analyser)

don't forget to specify audio characteristic you want to apply

regards

lC


2013/5/2 Guillaume Lachaud <guillaum...@backelite.com>

--
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-discussion+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file Guillaume Lachaud 5/2/13 9:48 AM
It might not be related to buffer fullness after all.

"Also the standard ISO IEC 13818-7 and ISO IEC 14496-3 are not clear about what a decoder can do with the buffer fullness. The open source faad decoder ignores it. The open source faac always set it to VBR (all ones) even if it has been configured to do constant bitrate."


2013/5/2 Lionel Carminati <lionel.c...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "mp4parser-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mp4parser-discussion/a9RbWVs5Kgs/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to mp4parser-discussion+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--






Guillaume LACHAUD
Backelite - Développeur Android

7, rue de Bucarest - 75008 PARIS - FRANCE
Tel  : +33 1 73 00 28 36


                         

.

AW: regarding muxing .mp4 video only file + .aac file to create .mp4 file Sebastian Annies 5/2/13 1:31 PM

Can you send a raw AAC that plays to fast when muxed into MP4? I’ll have a look.

 

Von: mp4parser-...@googlegroups.com [mailto:mp4parser-...@googlegroups.com] Im Auftrag von Guillaume Lachaud
Gesendet: Donnerstag, 2. Mai 2013 18:49


An: mp4parser-...@googlegroups.com
Betreff: Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file

 

It might not be related to buffer fullness after all.

 



 

                         

.

 

--
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-discussion+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file Guillaume Lachaud 5/2/13 11:51 PM
Please find attached a sample. It should last 10 seconds.

It plays fine in mplayer at good speed now but I am still unable to mux it.

05-03 08:46:09.750: W/System.err(4547): java.io.IOException: Expected Start Word 0xfff
05-03 08:46:09.755: W/System.err(4547): at com.googlecode.mp4parser.authoring.tracks.AACTrackImpl.readADTSHeader(AACTrackImpl.java:291)

The first iteration is good, with 0xfff but it seems that second header is not and then throws an exception.



2013/5/2 Sebastian Annies <sebastia...@gmail.com>



--






                         

.

Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file Guillaume Lachaud 5/3/13 12:21 AM
Well, I have found something weird.

If I write the bit length of the frame in headers, mplayer will play the file fine but not vlc.
If I write the byte length of the frame in the header, mplayer won't play it correctly but vlc will, after muxing it (using Subler on Mac)

From what I can see in AACTrackImpl.readSamples, this size should be in bytes. But still I am having the issue of my previous message with mp4parser. Muxing is perfect when using Subler.


2013/5/3 Guillaume Lachaud <guillaum...@backelite.com>
Re: regarding muxing .mp4 video only file + .aac file to create .mp4 file Bill Gockeler 5/13/13 9:17 AM
Satish,

I am trying to do the same thin you are and came across this post looking for some direction on how to generate the ADTS headers. You said you are doing this and have it working. Can you provided some information as to how you do this? Thanks
Bill


On Thursday, May 2, 2013 6:30:09 AM UTC-4, satish MR wrote:

Hey generate your own adts headers and prepend it to each raw aac frame. Its easy. Its working for me

More topics »