Magic Lantern Forum

Developing Magic Lantern => Feature Requests => Topic started by: silvertonesx24 on February 17, 2014, 08:50:17 PM

Title: remaining card space update frequency
Post by: silvertonesx24 on February 17, 2014, 08:50:17 PM
Is there any way at some point to more frequently update the space remaining after each raw take? Or maybe even calculate the actual time remaining roughly based on the average data rate for the selected resolution.

I know if you cycle the camera sometimes it'll update but right now I've been working blind and dumping the card anytime I suspect that a take may be interrupted due to running out or having a supervisor track the space for each take.
Title: Re: remaining card space update frequency
Post by: pascal on February 18, 2014, 02:07:09 PM
If you turn off/on the camera the space meter is correct. It would be indeed a nifty addition if the card space was updated on Save Finish. You can request this as a feature. Is probably just 1 line of code.
Title: Re: remaining card space update frequency
Post by: a1ex on February 18, 2014, 02:09:39 PM
Quote from: pascal on February 18, 2014, 02:07:09 PM
Is probably just 1 line of code.

If so, feel free to submit a pull request.
Title: Re: remaining card space update frequency
Post by: pascal on February 18, 2014, 04:29:53 PM
Quote from: pascal on February 18, 2014, 02:07:09 PM
Is probably just 1 line of code.
If the original implementation was well designed that is.
Title: Re: remaining card space update frequency
Post by: a1ex on February 18, 2014, 04:31:20 PM
You forgot about this: http://en.wikipedia.org/wiki/Reverse_engineering
Title: Re: remaining card space update frequency
Post by: pascal on February 18, 2014, 07:15:17 PM
Quote from: a1ex on February 18, 2014, 04:31:20 PM
You forgot about this: http://en.wikipedia.org/wiki/Reverse_engineering
Ok I see. That is unfortunate. When opening the format card menu I think it shows the free card capacity. Is probably a starting point.
Title: Re: remaining card space update frequency
Post by: silvertonesx24 on February 18, 2014, 10:39:58 PM
Might there be a way to run a small process to continuously track the used space? Maybe through the file manager? I don't think we need accuracy down to the second/megabite, just a rough approximation of how much we can shoot until a card swap is needed.
Title: Re: remaining card space update frequency
Post by: a1ex on February 18, 2014, 10:54:06 PM
Yes, that's the solution I have in mind: tracking all the FIO_WriteFile calls.
Title: Re: remaining card space update frequency
Post by: arrinkiiii on February 18, 2014, 11:51:27 PM

Would be a good function to have  :)
Title: Re: remaining card space update frequency
Post by: jose_ugs on March 09, 2014, 05:45:14 PM
...or at least refresh the value after the last shot? This way you'll know how much you have left before you start the next take...
@a1ex, is tracking going to affect write speed?
Title: Re: remaining card space update frequency
Post by: marekk on March 09, 2014, 06:44:59 PM
a1ex, it should be something like LVINFO_UPDATE_FUNC in bitrate.c ?

static LVINFO_UPDATE_FUNC(indicator)
{
    LVINFO_BUFFER(8);
   
    if(!RECORDING_H264)
    {
        /* Hide this LVINFO item if not recording H264 */
        return;
    }
   
    int elapsed_time = get_seconds_clock() - movie_start_timestamp;
    int bytes_written_32k = MVR_BYTES_WRITTEN / 32768;
    int remaining_time = get_free_space_32k(get_shooting_card()) * elapsed_time / bytes_written_32k;
    int avg_bitrate = MVR_BYTES_WRITTEN / 1024 * 8 / 1024 / elapsed_time;

    switch(rec_indicator)
    {
        case 0: // elapsed
            snprintf(
                buffer,
                sizeof(buffer),
                "%3d:%02d",
                elapsed_time / 60,
                elapsed_time % 60
            );
            return;
        case 1: // remaining
            snprintf(
                buffer,
                sizeof(buffer),
                "%d:%02d",
                remaining_time / 60,
                remaining_time % 60
            );
            if (remaining_time < time_indic_warning)
            {
                item->color_bg = COLOR_WHITE;
                item->color_fg = COLOR_RED;
            }
            return;
        case 2: // avg bitrate
            snprintf(
                buffer,
                sizeof(buffer),
                "%dMb/s",
                avg_bitrate
            );
            return;
        case 3: //instant bitrate
            snprintf(
                buffer,
                sizeof(buffer),
                "%dMb/s",
                measured_bitrate
             );
    }
}
Title: Re: remaining card space update frequency
Post by: a1ex on March 09, 2014, 06:56:15 PM
@marekk: frontend != backend ;)

@jose_ugs: yes; whether that would be 1e-5% or 1%, I can't tell without implementing it first.
Title: Re: remaining card space update frequency
Post by: tuckertota on November 23, 2015, 11:51:55 PM
Would be great if this could be implemented in some way. Even a ballpark figure would be helpful. I use the Canon format menu to check space and that's a little dangerous, one small click from accidentally formatting my card.
Title: Re: remaining card space update frequency
Post by: ariaelf on January 08, 2021, 11:50:49 AM
Quote from: tuckertota on November 23, 2015, 11:51:55 PM
Would be great if this could be implemented in some way. Even a ballpark figure would be helpful. I use the Canon format menu to check space and that's a little dangerous, one small click from accidentally formatting my card.

I second this motion.

I'm surprised there's been no solution since it was first brought up years ago, but to reboot your camera constantly to know how much space is left on the card. That's bananas!  :o

"Time remaining" indicator is critical for film work. Trust me, there's nothing worse then telling your actors "....OOOPS.... CARD RAN OUT..." in the middle of a brilliant, emotional take.