Magic Lantern Forum

Using Magic Lantern => Raw Video => Topic started by: Thomas Worth on June 29, 2014, 12:54:19 AM

Title: When recording stops prematurely, nine garbage files get written inexplicably
Post by: Thomas Worth on June 29, 2014, 12:54:19 AM
Check this out:

(http://www.mediafire.com/convkey/2324/p4gijcb8rplvjo74g.jpg) (http://www.mediafire.com/view/p4gijcb8rplvjo7/Screen%20Shot%202014-06-28%20at%203.41.29%20PM.png)

This happened when recording stopped (on its own). I don't know if this was due to a card issue or something else, but there ya go.
Title: Re: When recording stops prematurely, nine garbage files get written inexplicably
Post by: beauchampy on June 29, 2014, 03:22:02 PM
This happens to me too when I encounter 'card full'.
Title: Re: When recording stops prematurely, nine garbage files get written inexplicably
Post by: Midphase on June 29, 2014, 07:49:52 PM
Same here when recording stops unexpectedly.
Title: Re: When recording stops prematurely, nine garbage files get written inexplicably
Post by: Midphase on July 14, 2014, 05:54:26 PM
Happened again yesterday when shooting on the 5D3 on my May 16th build. I got the error "Are you sure Card is ExFAT?" and in this case I am 100% sure the card was formatted as ExFAT.

Thankfully it appears the file integrity is fine.
Title: Re: When recording stops prematurely, nine garbage files get written inexplicably
Post by: dmilligan on July 14, 2014, 11:08:37 PM
have a look at raw_video_rec_task() in mlv_rec.c

All these files are always created before recording starts (so that they can be used as soon as needed during recording). At the end of recording they are cleaned up if not used, but if recording stops unexpectedly they are not. This appears to be by design.


        /* delete all empty files */
        mlv_rec_precreate_cleanup(mlv_movie_filename, MAX_PRECREATE_FILES);


is before:

cleanup:
    /* signal that we are stopping */
    raw_rec_cbr_stopped();

    /*
    if(DISPLAY_REC_INFO_DEBUG)
    {
        NotifyBox(5000, "Frames captured: %d", frame_count - 1);
    }
    */
   
    if(show_graph)
    {
        take_screenshot(SCREENSHOT_FILENAME_AUTO, SCREENSHOT_BMP);
    }
    trace_flush(raw_rec_trace_ctx);

    free_buffers();

    /* count up take number */
    if(raw_tag_take)
    {
        raw_tag_take++;
    }

    hack_liveview(1);
    redraw();
    raw_recording_state = RAW_IDLE;
}

Title: Re: When recording stops prematurely, nine garbage files get written inexplicably
Post by: Frank7D on July 17, 2014, 02:08:31 AM
I was shooting mlv with 7D on 64 GB card
June 27, 2014 build
3x crop mode 1792x1008
mlv sound enabled
After 9 min 22 sec, recording stopped with the message "unable to open file."
Plenty of room left on card, so that's not the cause.

There were .MLV plus .M00-.M08 for a total of 10 spanned files (all more than 4 GB each).
This is the same number of files I see when I fill the card up completely, but in that case some are usually empty.

Given what dmilligan said above, I hypothesize that I ran out of "placeholder" files so the recording had to stop.
If that is the case, can we either increase the number of initial placeholder files to allow longer recording, or else create them as needed on the fly?
Title: Re: When recording stops prematurely, nine garbage files get written inexplicably
Post by: Frank7D on July 17, 2014, 02:58:05 AM
Looking through mlv_rec, I see MAX_PRECREATE_FILES (a variable?), but I don't see where it is defined. Outside the module? Sorry if this is off base, I'm not a C guy...

Edit: Here's something from mlv_rec.c

/* pre-create that number of files befroe recording starts so that file catalog doesnt have to get updated while recording */
#define MAX_PRECREATE_FILES 10

Is it as simple as bumping that 10 up to something higher?
Title: Re: When recording stops prematurely, nine garbage files get written inexplicably
Post by: Frank7D on July 17, 2014, 06:13:44 PM
Can someone confirm my understanding of this situation is correct? I'd like to create a feature request if so.
Title: Re: When recording stops prematurely, nine garbage files get written inexplicably
Post by: dmilligan on July 17, 2014, 08:17:46 PM
Quote from: Frank7D on July 17, 2014, 02:58:05 AM
Is it as simple as bumping that 10 up to something higher?
Yes
Title: Re: When recording stops prematurely, nine garbage files get written inexplicably
Post by: Frank7D on July 17, 2014, 08:27:01 PM
Quote from: dmilligan on July 17, 2014, 08:17:46 PM
Yes

Thanks! Maybe I'll take a whack at it...
Title: Re: When recording stops prematurely, nine garbage files get written inexplicably
Post by: Thomas Worth on July 26, 2014, 09:20:38 AM
Quote from: dmilligan on July 14, 2014, 11:08:37 PM
have a look at raw_video_rec_task() in mlv_rec.c

All these files are always created before recording starts (so that they can be used as soon as needed during recording). At the end of recording they are cleaned up if not used, but if recording stops unexpectedly they are not. This appears to be by design.
Thanks. I'll have RAWMagic check for these files and ignore them if it finds them.