Need optimize solution for my problem

  • 1
  • Problem
  • Updated 3 years ago
  • (Edited)
I am not able to find some good solution, with problems I am facing:

Stopping OOM:
Having upto 5 minutes is possible but I require full length (which is variable), how to get it(is the issue)? Let say, I am taking  dividing the video into fixed length multiple clips of 30 seconds time(which will say Y)This media is previously recorded and saved in a tmp file. Loading the full file in buffer, will kill the memory.As it will require allot of memory while running in the virtual memory. So, it is not possible.Which is easy to do and also, at the end I can gather/concatenate using mp4 parse. 

If it is 1 hour video, I will have 120 30second(or 90 40second) clips.It is a good for the SD card(as you will have to burn through). Also, I don't know the time, it will take to concatenate thousand of files.

I am expecting the local sockets, to perform something like this:
MediaRecorder -> setOutputFile(LocalSocket.getFD())
LocalSocket -> FileOutputStream -> write(data, position, bufsiz) -> flush()

Meanwhile, a background thread is handling multiple things, in the whole scenario including position of the buffer. I'm only able to produce the pseudo code by now. What is your opinion of am I going to the correct direction or not .

From my point of view, this will be limited to the file, I am overwriting. After sometime(in this case it is Y), it will be updated. If this is the case, the IO overhead will be lowered. And it will good for RAM, as only 1 file is taking care of in 30 seconds. 

Issue of Video Length to current Buffer/Memory-In-Use Size
What do you think about buffer size, which the application is requesting from the video.If the Y size is decreased, there will be greater number of short clips(which will l and obviously big sizes are not possible.

There is not criteria for this (And I want to know it??). 

I haven't able to find the correct size, even if I know the video length and encoding technique, which is setup using the Media Recorder application.

I am looking for an example in this case, I know that the idea is not original.

Further, please don't suggest anything using Grafica. I am using screencast(and I only want to use products from techsmith). 

What I am trying to do:
Right now, I am working with a government N.G.O and I am training some veteran(or duly injured active personnel). I am teaching them with designing and programming(right now doing android). As the class length is 2 hours each day, they are continuously asking for video tutorials that they can take home and practice directly. As most of the students lie between 30 and 40 age range (and struggle with learning as they don't have any programming background). Right now, I am working at And after that, I have to go to multiple bases in New York, Texas, California and Florida. So, having something in video form will also help me (and eventually the students too). 

Complete Contact Information:
Kassandra Hefti - Design/Web/Android Teacher at a Government N.G.O
Address: 700 S Brookhurst St #3f, Anaheim, CA 92804, United States
Phone:+1 714-563-5643/47 | Fax: +1 714-563-5649
Personal Contact: +1 714-563-4857
Email: KassandraSagittarius@gmail
Photo of Kassandra Hefti

Kassandra Hefti

  • 1 Post
  • 0 Reply Likes

Posted 3 years ago

  • 1
Photo of Joe Morgan

Joe Morgan

  • 7238 Posts
  • 3939 Reply Likes
It sounds like you got a lot going on there. I cannot help you. However, come Monday you could contact tech support and run this all by them.
You can fill out a support ticket and/or contact them by phone.If it were me, I would want to speak to someone in person about it.Good Luck.

This is a Free Service. Submit a ticket at,

Or call, >>>

 Toll Free: 800.517.3001 (U.S. & Canada Only)

8:00 AM to 7:00 PM EST Monday through Friday

Regards, Joe

Photo of kurrykid

kurrykid, Champion

  • 759 Posts
  • 131 Reply Likes

I would suggest you take your personal information out of the post as soon as possible. Never good to post this kind of information on a public forum site.