Muxing large video(100 Mb) file and audio file in Xuggler - xuggler

I am muxing video and audio together using xuggler. Since the video file is large (100 mb) I am getting "java.lang.OutOfMemoryError: out of native memory". I increased the heap size as well, but still getting the same error
Also I added the JNIMemoryModel before the operation begins.
JNIMemoryManager.setMemoryModel(MemoryModel.JAVA_STANDARD_HEAP);

I was able solve this issue in a different way. I was getting this issue, not sure what was the reason, when I was combing mp4 and .wav file using "JCodec" and Xuggler framework.
Now I stopped using JCodec and used xuggler only and this issue is not happening any more!!
Thanks

Related

Force GPU usage with copying video sample buffers via AVAssetReader/AVSampleBufferDisplayLayer

I am looping 1 second mp4/h264 videos with no audio on an M1 Mac Mini. AVPlayer was causing hitches with scrolling.
Now I read videos using AVAssetReader and feed those CMSampleBuffers into a AVSampleBufferDisplayLayer.
To get it to seamlessly loop without having to create a new AVAssetReader, I just cache all of those samples in an array and create copies with new timing via CMSampleBufferCreateCopyWithNewTiming. These are short videos so it's not a lot of data.
It all works pretty great now with no hitches. However the VTDecoderXPCService is going nuts on the CPU. I was expecting the GPU to be doing most of the work for decoding.
Is copying those samples from memory via CMSampleBufferCreateCopyWithNewTiming causing it? Is there a better way?

Netstream() progressive download of internal file

Hello All I have been working on a project for a while:
I have a non standard MP4 video file I want to play off a server in a IPhone App (I am using Flash builder to create it).
Due to a combination of server problems (not correctly identifying MIME type and cant be changed) and IPhone limitations (e.g. not being able to force the iplayer to play files with wrong extension), I have had to setup a process that reads the file in, saves it locally and then point the video player at the local file.
Although this sort of works, i am having an issue with some of the files that are large (94mb for a 17 min video) and a slow server - which takes 120 seconds to transfer the whole file.
I thought that if you started playing the video, then the transfer rate would be faster than the playback rate so the video would play ok.
However sometimes the video just crashes, which i am guessing is a result of the video reading beyond what has been written.
If the video played the internal file using progressive download I think it would probably not crash but resume once more date had been read but understand that progressive download is triggered by a url extension beginning with HTTP://
Can you make an internal file play using progressive download ? I know this would not normally be expected as logically the system would expect a local file to already be download ?
Any help appreciated
Thanks
Toby
try this to know download file is complete or not
HCDownload
it is very easy to use only write its delegate method.
Edit
also see StitchedStreamPlayer

How to reduce the size of my iPhone application which has more high quality audio files?

I am developing application related to meditation.
In that there is lots of high quality .mp3 files, that's why application size increases much more nearer to 2GB. I have searched for compression but i can't found it for audio files, but xcode supports only for .png file.
If anyone know anything about it then please suggest me.
Thanks in advance,
MP3 is lossy compression. If you are willing to accept lossy files, MP3 is much better compression than you will get with a regular data compression algorithm, such as gzip.
What I would suggest would be getting the original files and re-compressing with AAC, down to a bitrate that makes the size of your application acceptable. AAC sounds better at lower bitrates, and compressing from the original means you won't have any artifacts from the already lossy-compressed MP3 files.

Which audio format would be the best?

I was using AVAudioPlayer to play multiple audio clips back to back but there was always a small silence between tracks and then i came to know of Finch, a library which uses OpenAL to play audio. with this the silence problem seems to be solved theoretically but then i found that it doesn't play m4a or any other compressed formats.
Now i am looking for an uncompressed audio format which would have relatively less file size (though uncompressed means that all of them should have almost same size) and a method to convert, i am also googling on afconvert in a mean while.
CAF files work great for this. I've built an application that loops audio files, and I was impressed with the relatively small file size.
Check out this question for more info on converting to CAF.

How can I reduce the size of .wav audio files for iPhone apps?

I have some music that loops. The .wav file size is about 8 meg. I load this and just loop it... everything was working fine until I added another 4 meg .wav file. Now the game crashes... removing the additional audio file fixed the crashing.
So how can I reduce the size of these .wav files? I thought about releasing the memory after I'm done with the 4 meg file but what I tried didn't work (and I'd rather the game itself be a smaller file size so it's easier to download).
Thanks!
If you're only playing one sound file at a time, just use mp3 or aac. That way you also get hardware decoding, for improved performance and battery life.
Unfortunately, the iPhone can only play one hardware decoded sound file at a time. So if you're looking to ever play more than one at once, you'll need to do your own decoding of the second file; IMA 4:1 is recommended, though you'll have to find or implement your own decoder, Apple doesn't give you one.
This is all based off of this blog post, which goes into a bit more detail.
Actually .WAV is a container. The contents can be compressed or uncompressed, it all depends on the WAVEFORMATEX structure contained in the first "fmt " tag in the .WAV file.
For instance, in Windows 7 all of the built-in sounds are .WAV files that contain MP3 data.
You can just author your .WAV files as MP3 files and (assuming that the iPhone correctly handles the .WAV container) they should work.
Wav in a uncompressed format will inevitably take up tons of space. 8 Megs is not really big for an uncompressed wav.
You should consider an alternate, compressed format such as mp3 or aac. You might need to link in a decoding library though.
Check out this link on including mp3 files in your iphone app:
If your WAV files are stereo, you could try making them mono. This would basically half the file size. The disadvantage would obviously be that your sound is now mono.
I wouldn't use WAV. Take a look at ffmpegx. It's free, runs on the mac and will convert your waves files to MP3 or a host of other formats.