Hi Tomer, if you're already around here... in addition to what Paulo already told you, there is another thing you could try:
I've been checking on the possibility to use MP4's ability to write the moov atom at the front of the file (aka. "Fast Start"). This means that headers and other metadata will be written first, instead of last, so an abrupt file ending will mean the file is still playable... contrary to what happens by default.
KMS uses the GStreamer "mp4mux" plugin to create MP4 files, and this plugin supports "fast start" mode:
And interestingly enough, KMS does already enable the fast start mode EXCEPT for file recordings!
I'm not sure about the reasoning for this, as the previous team who wrote this code has already left the project... but you could try enabling fast start also for file recordings and see if it works better.
if ((gst_element_factory_get_element_type (sink_factory) !=
gst_element_factory_get_element_type (file_sink_factory))) {
g_object_set (mux, "faststart", TRUE, NULL);
}
to this:
g_object_set (mux, "faststart", TRUE, NULL);
Please get in contact with me if you try this, as I'm trying to decide if adding this change in KMS, but need some feedback about what issued this may cause (for one, it will automatically generate temporary files in the hard disk, according to GStreamer's
faststart-file property description)