Due to a limitation in the video library used for overlaying, both raw and overlaid videos must not exceed a size of approximately 2 GB on Android. Although I work on this issue for quite some time already, I could not work around this limitation so far. It is possible to record and handle videos larger than 2 GB, but once you start applying an overlay, you will run into issues.
A size of 2 GB roughly means 11 minutes for FullHD videos and 25 minutes for HD videos. This means recording a single video lap will mostly not be a problem. Opposed to this, full session recordings will mostly exceed this limit for FullHD and sometimes for HD.
Workaround: I strongly recommend to use HD in general. This is both beneficial for the size needed and for overlay processing times. LapTimer comes with a standard video resolution setting of "HD". Changing it to "FullHD" in Video View will bring up an additional warning. As a more general recommendation, please consider limiting video recording to dedicated video sessions only and use lap timing / data recording for standard operation.
What to do if the video exceeds 2GB?
As LapTimer does not limit the video size to 2 GB when recording, you may run into situations you find your video to show a size bigger than 2 GB (and get an error message when overlaying). As long as the limitation is not fixed, there is actually only one option to work around: reduce video size "after the fact".
To work around, you actually create a smaller version of the video (options below). For the remainder of this post I assume you have your video stored on an external SD card - which makes it accessible on your desktop. In case your smartphone comes with an "internal / emulated" SD card, access differs by manufacturer and is typically supported by some proprietary tools. Furthermore, we assume the (big) video's filename is LapTimer-XXXXXXXX-XXXXXX.mp4. Directory / folder names are omitted in the samples but may need to be added depending on your storage scheme (both SD card and desktop).
- Reduce video resolution by converting it to HD: the following command transforms the original video to HD size, sets a standard quality, qualifies the audio stream to be copied and stores the result in a file with postfix "-HD". As the video frames are decoded, resized, and encoded again, this command will require some time to complete.
Code: Select all
ffmpeg -i LapTimer-XXXXXXXX-XXXXXX.mp4 -s hd720 -c:v libx264 -crf 23 -c:a copy LapTimer-XXXXXXXX-XXXXXX-HD.mp4
- Remove footage from the end of the video: the following command cuts the video length to 4 minutes and stores the result in a file with postfix "-4mins". This command is executed very fast and will not loss quality due to decoding / encoding cycles. This approach will certainly not allow you to overlay laps in the scope cut off. Choosing 4 minutes is a sample and needs to be selected as appropriate.
Please note that removing footage from the beginning is possible too, but will void all time offsets in LapTimer's data recordings. This in turn requires you to re-sync all laps manually.
Code: Select all
ffmpeg -i LapTimer-XXXXXXXX-XXXXXX.mp4 -t 00:04:00 -c copy LapTimer-XXXXXXXX-XXXXXX-4mins.mp4
- Copy the changed file using the original file name: this will overwrite the original video but keep the relation between lap data recordings and the video. Once the SD card is entered again, LapTimer should see the updated video immediately and the overlay can be started. It is certainly possible (and recommended) to store a copy of the original file on the desktop for later use.
- Copy the changed file using the new name (i.e. with "-HD" etc postfix) to the same folder the original video is stored in: once back in LapTimer, the laps will still reference the big video. To re-link the laps to the new (smaller) video, in Lap List / Lap Details, tap the video preview row first. This will bring you to the (big) video's "Video Details". Press the "+Video" button in the top right of the screen and select the new video from the list. This will re-link all lap references going to LapTimer-XXXXXXXX-XXXXXX.mp4 so far to use LapTimer-XXXXXXXX-XXXXXX-HD.mp4 (or -4mins) now.