System and method for correcting a progress indicator during playback of a video file
Methods and systems for correcting a progress indicator during playback of a video file. A request to playback the video file generated from a plurality of vehicle cameras is requested. A header associated with the video file to extract metadata is parsed. The metadata includes a frame count of the video file and a file size of the video file. The method includes determining that the header is corrupt based on the frame count being zero and generating a replacement frame count based on the file size of the video file, a frame size, and a scaling factor. The progress indicator during the playback based on the replacement frame count is displayed.
1 . A method for correcting a progress indicator during playback of a video file, the method comprising:
receiving a request to playback the video file generated from a plurality of vehicle cameras;
parsing a header associated with the video file to extract metadata, wherein the metadata includes a frame count of the video file and a file size of the video file;
determining that the header is corrupt based on the frame count being zero;
generating a replacement frame count based on the file size of the video file, a frame size, and a scaling factor; and
displaying the progress indicator during the playback based on the replacement frame count.
2 . The method of claim 1 , wherein the replacement frame count is calculated by dividing the file size of the video file by the frame size.
3 . The method of claim 1 , wherein the replacement frame count is calculated by a product of the scaling factor and a result of dividing the file size of the video file by the frame size.
4 . The method of claim 1 , wherein the frame size is an average size of a plurality of frames.
5 . The method of claim 1 , wherein the frame size is a predefined maximum encoded frame size of a plurality of frames.
6 . The method of claim 1 , wherein the method further comprises:
determining a total duration of the video file based on the replacement frame count;
determining a current playback position of the video file relative to a total duration of the video file; and
updating the progress indicator to reflect the current playback position.
7 . The method of claim 1 , wherein the progress indicator is displayed on a vehicle display.
8 . The method of claim 1 , wherein the progress indicator includes a numerical value.
9 . A system configured to correct a progress indicator during playback of a video file, the system comprising:
a plurality of vehicle cameras configured to generate the video file; and
a controller configured to
receive a request to playback the video file,
parse a header associated with the video file to extract metadata, wherein the metadata includes a frame count of the video file and a file size of the video file,
determine that the header is corrupt based on the frame count being zero,
generate a replacement frame count based on the file size of the video file, a frame size, and a scaling factor, and
display, on a vehicle display, the progress indicator during the playback based on the replacement frame count.
10 . The system of claim 9 , wherein the replacement frame count is calculated by dividing the file size of the video file by the frame size.
11 . The system of claim 9 , wherein the replacement frame count is calculated by a product of the scaling factor and a result of dividing the file size of the video file by the frame size.
12 . The system of claim 9 , wherein the frame size is an average size of a plurality of frames.
13 . The system of claim 9 , wherein the frame size is a predefined maximum encoded frame size of a plurality of frames.
14 . The system of claim 9 , wherein the controller is further configured to determine a total duration of the video file based on the replacement frame count;
determine a current playback position of the video file relative to a total duration of the video file; and
update the progress indicator to reflect the current playback position.
15 . A processor configured to execute instructions stored on a non-transitory computer-readable medium, wherein executing the instructions causes the processor to:
receive a request to playback a video file generated from a plurality of vehicle cameras;
parse a header associated with the video file to extract metadata, wherein the metadata includes a frame count of the video file and a file size of the video file;
determine that the header is corrupt based on the frame count being zero;
generate a replacement frame count based on the file size of the video file, a frame size, and a scaling factor; and
display a progress indicator during the playback based on the replacement frame count.
16 . The processor of claim 15 , wherein the replacement frame count is calculated by dividing the file size of the video file by the frame size.
17 . The processor of claim 15 , wherein the replacement frame count is calculated by a product of the scaling factor and a result of dividing the file size of the video file by the frame size.
18 . The processor of claim 15 , wherein the frame size is an average size of a plurality of frames.
19 . The processor of claim 15 , wherein the frame size is a predefined maximum encoded frame size of a plurality of frames.
20 . The processor of claim 15 , wherein the instructions further causes the processor to
determine a total duration of the video file based on the replacement frame count;
determine a current playback position of the video file relative to a total duration of the video file; and
update the progress indicator to reflect the current playback position.