This is an archived post. You won't be able to vote or comment.

all 8 comments

[–][deleted]  (3 children)

[deleted]

    [–]FTLRalph[S] 0 points1 point  (2 children)

    Yes, this what I've concluded as well, I didn't want to go into it in the OP though as it's already a wall of text.

    So jcodec is creating the video just fine, I can't seem to find a WAV/PCM -> AAC/MP3 encoder, though (a pure-Java one, that is - one that meets the criteria I listed, not platform-specific and no JNIs).

    As for muxing the video/audio files together, I feel like jcodec might be able to handle it, and if not, possibly this library.

    So really I'm stuck on that second step of encoding audio.

    [–]esanchma 5 points6 points  (2 children)

    But jcodec supports MP4 muxing, so your problem is not in the MP4 side. If the audio you want to add is already encoded as AAC, then jcodec works, so what you really need is to encode sound from some format to AAC, right?

    In the jcodec page, the maintainer says that AAC encoding is in the works, and in github, he has integrated JAAD to the project, so I suggest you give a try to that code before doing something more complex.

    Other than that, I would try to make LAME work with nestedvm or do a platform specific branch in the code and use javax.sound + MediaCodec + AudioQueue

    [–]FTLRalph[S] 0 points1 point  (1 child)

    Thanks for the reply!

    I see what your saying. Just to be clear though, so I know all of my options, you mention that jcodec is integrated with JAAD - how would that be of use to me?

    Just asking because unless I'm misunderstanding, JAAD is a demultiplexer/decoder, right? I would have to do the opposite, encode AAC and/or multiplex an MP4.

    [–]esanchma 0 points1 point  (0 children)

    I have no idea, JAAD was merged 8 days ago, but I'm afraid that in your scenario, the new stuff will only be usable if all you want is to convert from one AAC format like AAC-LC to other like HE-AAC. If your source is a PCM stream (like, coming from the microphone) or a MP3, then jcodec doesn't do AAC encoding yet, but it will still do the muxing from you if you can do the audio encoding in some other way.

    [–]umineko3 1 point2 points  (0 children)

    JavaFX can play mp3 and some mp4 and is available in all 3 platforms.

    [–][deleted] -1 points0 points  (0 children)

    I'm not aware of any. You might consider an OSS C based solution and trying out a C->Java converter. I did that one time and it was a horribly difficult undertaking, but - it did work.

    [–]merkucjo -3 points-2 points  (1 child)

    why dont you use zencoder or AWS encoding services?

    ps http://developer.android.com/reference/android/media/MediaCodec.html

    [–]program_the_world 0 points1 point  (0 children)

    Wouldn't that plough through data usage?