Method for Saving GPS Information in Video File and Related Device
By storing video data, audio data and GPS data into a single MP4 format file, the management inconvenience caused by separate storage in the prior art is solved, and the effect of unified management and use is achieved and storage space is saved.
Patent Information
- Application Number
- CN202111011968.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-31
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-08-31
AI Technical Summary
In the prior art, the storage of video and audio data separately from GPS information leads to inconvenience in management and use.
The video data, audio data and GPS data are stored as a single MP4 format file, and the video, audio description information and GPS data are stored using the ftype box, moov box, mdat box and free box structure of the MP4 file.
It realizes the unified management and use of video data, audio data and GPS data, saves storage space and does not affect the playback of MP4 videos.
Smart Images

Figure CN115914516B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of driving recorders, and in particular to a method for saving GPS information in a video file and related devices. Background Art
[0002] With the gradual popularization of driving recorders, more and more users choose to install a driving recorder on their vehicles. It can record the video and audio of the whole process of vehicle driving, and at the same time, it can also record the Global Positioning System (GPS) information of vehicle driving.
[0003] In the prior art, the video and audio content is compressed and saved as a video file in MP4 format, while the GPS information is saved in another file. Since the two are saved separately, it is inconvenient to manage and use. Summary of the Invention
[0004] An object of the present application is to provide a method for saving GPS information in a video file and related devices, and its advantage lies in that the GPS coordinate data is saved into the MP4 file, so that the video data, audio data and GPS data are saved in the same MP4 file for convenient management and use.
[0005] Another object of the present application is to provide a method for saving GPS information in a video file and related devices, and its advantage lies in that the MP4 format flag, video data and audio data, video and audio description information are written into other parts, and the GPS data is written into the free box, which can not only realize the writing and playing of the MP4 file, but also save the GPS data.
[0006] Another object of the present application is to provide a method for saving GPS information in a video file and related devices, and its advantage lies in that the description information of the video and audio is stored by the first sub-unit and the second sub-unit respectively, which is beneficial to the indexing of the video and audio files.
[0007] Another object of the present application is to provide a method for saving GPS information in a video file and related devices, and its advantage lies in that the third sub-unit, the fourth sub-unit and the fifth sub-unit are used to establish the GPS data storage format, which is convenient for the storage and indexing of the GPS data.
[0008] Another object of the present application is to provide a method for saving GPS information in a video file and related devices, and its advantage lies in that the GPS data is written in sequence according to the acquisition time, which is convenient for finding and managing the GPS data information in the later stage.
[0009] Another object of the present application is to provide a method and related device for saving GPS information in a video file. The advantage lies in writing GPS data into the fifth subunit to achieve the purpose of saving GPS data in an MP4 file.
[0010] Another object of the present application is to provide a method and related device for saving GPS information in a video file. The advantage lies in stopping the writing of GPS data when the vehicle speed is zero to achieve the purpose of saving storage space.
[0011] Another object of the present application is to provide a method and related device for saving GPS information in a video file. The advantage lies in stopping the writing of GPS data when the GPS signal is lost to achieve the purpose of saving storage space.
[0012] In a first aspect, an embodiment of the present application provides a method for saving GPS information in a video file, including the steps of:
[0013] Collecting video data and audio data around the vehicle in real time;
[0014] Collecting GPS data of the vehicle in real time;
[0015] Storing the video data, the audio data, and the GPS data as a single MP4 format file.
[0016] According to the first aspect, in a possible implementation, the MP4 format file includes: ftype box, moov box, mdat box, free box; the GPS data includes capacity information, type information, and GPS sentence data. The step of storing the video data, the audio data, and the GPS data as a single MP4 format file includes:
[0017] Writing the MP4 format flag into the ftype box;
[0018] Writing the video data and the audio data into the mdat box;
[0019] Writing the video description information and the audio description information into the moov box;
[0020] After the writing of the MP4 format flag, the video data, the audio data, the video description information, and the audio description information is completed, writing the GPS data into the free box.
[0021] According to a first aspect, in a possible implementation, the moov box includes a first subunit and a second subunit, the video data includes a video track, the audio data includes an audio track, and the step of writing video description information and audio description information into the moov box includes:
[0022] Writing at least one of the following items through the first subunit: acquisition time, modification time, time metric scale, playable duration information;
[0023] Writing the data of the video track and the audio track through the second subunit.
[0024] According to a first aspect, in a possible implementation, the free box includes: a third subunit, a fourth subunit, and a fifth subunit, the GPS data includes capacity information, type information, and GPS sentence data, and the step of writing the GPS data into the free box includes:
[0025] Writing the capacity information into the third subunit;
[0026] Writing the type information into the fourth subunit;
[0027] Writing the GPS sentence data into the fifth subunit.
[0028] According to a first aspect, in a possible implementation, the step of writing the GPS sentence data into the fifth subunit includes:
[0029] Writing the GPS sentence data into the fifth subunit in the order of acquisition time.
[0030] According to a first aspect, in a possible implementation, the GPS data includes an identifier and at least one of latitude data, longitude data, and altitude data, and the step of writing the GPS sentence data into the fifth subunit includes:
[0031] Writing the GPS data corresponding to the acquisition time of the video data and the audio data, first writing the identifier, and then writing at least one of the latitude data, longitude data, and altitude data.
[0032] According to a first aspect, in a possible implementation, obtain the real-time vehicle speed, and when the real-time vehicle speed is zero, stop writing the GPS data.
[0033] According to a first aspect, in a possible implementation, obtain the real-time GPS signal, and when the real-time GPS signal is lost, stop writing the GPS data.
[0034] In a second aspect, an embodiment of the present application provides at least one memory and at least one processor. The memory is configured to store computer instructions, and the processor is configured to execute the computer instructions to perform the method as described above.
[0035] In a third aspect, an embodiment of the present application provides a computer storage medium storing a computer program, and when the computer program is executed by a processor, the method as described above is implemented. Description of the Drawings
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background art, the drawings required to be used in the embodiments of the present application or the background art will be described below.
[0037] Figure 1 It is an application scenario diagram for recording video and audio and receiving GPS data provided by an embodiment of the present application;
[0038] Figure 2 It is a schematic flowchart of a method for saving GPS information in a video file provided by an embodiment of the present application;
[0039] Figure 3 It is a flowchart of a method for generating an MP4 file provided by an embodiment of the present application;
[0040] Figure 4 It is a structural diagram of an MP4 file provided by an embodiment of the present application;
[0041] Figure 5 It is a composition diagram of a moov box file provided by an embodiment of the present application;
[0042] Figure 6 It is a composition diagram of a free box file provided by an embodiment of the present application;
[0043] Figure 7 It is a schematic diagram of the structural units of an electronic device provided by an embodiment of the present application. Detailed Embodiments
[0044] The embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
[0045] The term "including" and any variations thereof in the description, claims, and the above-mentioned drawings of this application are intended to cover non-exclusive inclusion. The terms "first", "second", "third", "fourth", "fifth", etc. in the description, claims, and the said drawings of this application are used to distinguish different objects, rather than to describe a specific order. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally also include steps or units not listed, or may optionally also include other steps or units inherent to these processes, methods, products, or devices.
[0046] Reference to "embodiments" herein means that the specific features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of this application. The phrase appears in various places in the description and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0047] In the prior art, video and audio content are compressed and saved as a video file in MP4 format, while GPS information is saved in another file. Since the two are saved separately, it is inconvenient to manage and use. In response to this, the embodiments of this application provide a method and related device for saving GPS information in a video file, aiming to solve the problem that it is inconvenient for users to manage and use GPS information when saving it. For the convenience of understanding the present invention, the MP4 file format will be introduced appropriately first.
[0048] An MP4 file refers to a file that conforms to the ISO / IEC 14496-12 standard and consists of several containers box (where each box has a structure of 4-byte size, 4-byte type, and some data data) encapsulating data. Specifically, an MP4 file has exactly one box of the "ftyp" type, which serves as the MP4 format flag and contains some information about the file; then there will be exactly one box of the "moov" type (Movie Box), which is a content container containerbox that does not contain specific media data but contains the macroscopic description information of all media data in this file. The media data of the MP4 file is contained in boxes of the "mdat" type (Media Data Box), and this type of box is also a container box, which can have multiple or none (when all media data references other files); there is also a free box in MP4, which is mainly used to reserve storage space and improve the performance of generating MP4 files.
[0049] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Please refer to Figure 1 , Figure 1 FIG. Figure 1 is an application scenario diagram for recording video and audio and receiving GPS data provided by an embodiment of the present application. The application scenario diagram includes a vehicle 101 and an artificial earth satellite 102.
[0050] During the driving process of the vehicle 101, the in-vehicle device collects video data and audio data of the surrounding conditions of the vehicle in real time and receives GPS positioning data sent by the artificial earth satellite 102. For example, when the vehicle 101 is driving on a certain road, the on-board computer obtains from the sensor that the driving speed of the vehicle is not zero and the vehicle maintains a driving state. At this time, video data and audio data of the surrounding conditions of the vehicle are collected, such as video data of roads, roadside trees, houses, etc. in the figure, and audio data near the vehicle interior and the road surface. At the same time, a GPS signal sent by the artificial earth satellite 102 is obtained. When it is confirmed that the GPS signal exists, the vehicle 101 receives the GPS data sent by the artificial earth satellite 102.
[0051] Please refer to Figure 2 , Figure 2 FIG. Figure 2 is a schematic flowchart of a method for saving GPS information in a video file provided by an embodiment of the present application. The execution subject of the method may be one or more of a driving recorder processor, a memory, a camera, and a microphone. The method includes but is not limited to the following steps:
[0052] S201, collect video data and audio data of the surrounding of the vehicle in real time.
[0053] Specifically, taking the driving recorder as the execution subject of the method as an example, after the driving recorder receives a start instruction, the camera collects video data and audio data of the surrounding of the vehicle in real time. The surrounding video data and audio data include: when the vehicle is driving, real-time video of the front road surface and video of some perspectives inside the vehicle, and real-time sounds inside the vehicle and on the road surface collected. During this process, the collected video data and audio data are submitted to the processor for processing.
[0054] S202, collect GPS data of the vehicle in real time.
[0055] The GPS module of the dash cam receives GPS data from satellites. The content of the GPS data can include information such as latitude, longitude, altitude, speed, date, time, heading, and satellite status. By sending corresponding command statements to the dash cam through a dedicated GPS setting software or a common serial port debugging software, the GPS module sets the sending program to send a certain communication statement or several communication statements every several milliseconds. Then, the dash cam writes these setting parameters into the memory. After that, according to these settings, after receiving the GPS data, the dash cam sends out one or several GPS output statements every corresponding preset number of milliseconds. After the GPS module of the dash cam recognizes the start symbol of the GPS statement, it recognizes the detailed data content of this data frame.
[0056] S203, store the video data, the audio data, and the GPS data as a single MP4 format file.
[0057] The dash cam stores the video data, the audio data, and the GPS data as a single MP4 format file in real time. When the vehicle speed is not zero, the video data, the audio data, and the GPS data are written. When the vehicle speed is zero, the writing of the GPS data stops. The camera of the dash cam collects the video data around the vehicle, and the microphone collects the audio data. At this time, the video data and the audio data are written. For example, when the vehicle stops at the roadside, at a traffic light intersection, in a parking lot, etc., the vehicle is not in a driving state. The vehicle computer obtains from the sensor that the driving speed of the vehicle is zero. Since the vehicle remains stationary, at this time, the GPS data of the vehicle does not change. At this time, the writing of the GPS data stops. The camera collects the video data around the vehicle, and the microphone collects the audio data. The video data and the audio data are written.
[0058] During the driving of the vehicle, the GPS module of the driving recorder obtains real-time GPS signals. When it can receive the GPS signals sent by artificial earth satellites, the video data, the audio data, and the GPS data are written. For example, when the vehicle travels to a certain downtown area A, at this time, it can receive the GPS signals sent by artificial earth satellites. After the signal confirmation is completed by the response system, the vehicle receives the GPS data sent by artificial earth satellites: the latitude is data A, the longitude is data B, and the altitude is data C. At the same time, the video data and audio data around the vehicle are collected, and the video data, the audio data, and the GPS data are written. When the vehicle travels to an area where the GPS signal is lost, at this time, the video data and the audio data are written. After continuously writing the GPS data of the current position for 1 second, the writing of the GPS data is stopped. For example, when the vehicle travels to locations such as caves, tunnels, and remote mountainous areas without GPS signals, the vehicle cannot receive the GPS signals sent by artificial earth satellites. At this time, the video data and audio data around the vehicle are collected, the writing of the GPS data is stopped, and the video data and the audio data are written.
[0059] Through the method of the embodiment of the present application, the GPS data, the video data, and the audio data can be saved in the same MP4 file, which is convenient for management and use.
[0060] Please refer to Figure 3 , Figure 3 which is a flowchart of a method for generating an MP4 file provided by the embodiment of the present application.
[0061] Step S301, first write the MP4 format flag, the video and audio data, and the video and audio description information into the MP4 file.
[0062] To ensure the integrity and high quality of the video data and the audio data, the video data and the audio data are written first. Therefore, the storage space is first handed over to the writing of the video data and the audio data. After ensuring that the video data and the audio data can be completely written, the free box is used to write the GPS data.
[0063] Step S302, write the GPS data into the free box. After the MP4 format flag, the video data, the audio data, the video description information, and the audio description information are written, the GPS data is written into the free box.
[0064] Please refer to Figure 4 , Figure 4It is a structural diagram of an MP4 file provided by an embodiment of the present application. The MP4 format file includes an ftype box, a moov box, an mdat box, and a free box. When writing data to the MP4 format file, the MP4 format flag is written into the ftype box, and the ftype box can describe the MP4 specification and version that the file complies with. The processor writes video and audio data into the mdat box. When writing data, the data stream of each frame is first stored in a linked list cache. When the number of frames reaches a certain value, the track thread will pack these frame data into chunks and notify the write thread to write to the encapsulated file. After receiving the notification that the chunk is ready, the write thread immediately executes the step of searching the chunk linked list (note: the chunk linked list stores several previously packed chunks, and the number of chunk linked lists is related to the number of track threads, generally there are 2, one for each of the audio and video track threads), and writes the first found chunk into the encapsulated file. The video and audio description information is written into the moov box, and the moov box contains the macroscopic description information of all media data in this file and the specific information of each media track. After the MP4 format flag, the video data, the audio data, the video description information, and the audio description information are written, the GPS data is written into the free box. Since the free box is mainly used to reserve storage space and improve the performance of generating the MP4 file, writing the GPS data into the free box does not affect the playback of the MP4 video.
[0065] Through the method of the embodiment of the present application, video data, audio data, and GPS data can be saved in the MP4 video file, which not only does not affect the playback of the MP4 video, but also can completely save the GPS data.
[0066] Please refer to Figure 5 , Figure 5 is an organizational structure diagram of the moov box. The moov box includes a first subunit and a second subunit. Specifically, there can be multiple video tracks for video and multiple audio tracks for audio. The first subunit can write the following items: acquisition time, modification time, time measurement scale, and playable duration information. The acquisition time is the time when this segment of video data and audio data is created, which is the start time when the dash cam camera records this segment of video or audio, and the playable duration information indicates the time when this segment can be played. The second subunit can write the data of the video track and the audio track.
[0067] Through the method of the embodiment of the present application, video data and audio data media information can be saved in the MP4 video file.
[0068] Please refer toFigure 6 , Figure 6 is the organizational structure diagram of the free box. The free box includes a third sub-unit, a fourth sub-unit, and a fifth sub-unit. The GPS data includes capacity information, type information, and GPS sentence data. The third sub-unit, the fourth sub-unit, and the fifth sub-unit are capacity boxes for writing content. The third sub-unit can store the capacity information, the fourth sub-unit can store the type information, and the fifth sub-unit can store the GPS sentence data.
[0069] Through the method of the embodiments of the present application, the capacity information, type information, and data of the GPS can be written into the MP4 video file.
[0070] Please refer to Figure 7 , Figure 7 is an internal structure diagram of an electronic device, including at least one memory 702 and at least one processor 701. The memory 702 is configured to store computer instructions, and the processor 701 is configured to execute the computer instructions to process the collected data.
[0071] In a possible implementation, the processor 701 issues instructions to collect video data and audio data of the vehicle's surrounding conditions. The camera collects the video data of the vehicle's surrounding conditions, and the microphone collects the audio data. At the same time, the processor 701 issues instructions to collect the GPS data of the vehicle, the GPS module collects the GPS data, and the memory 702 stores the video data, audio data, and GPS data as an MP4 file.
[0072] In a possible implementation, the memory 702 writes the MP4 format flag into the ftype box, writes the video and audio data into the mdat box, writes the video and audio description information into the moov box, and writes the GPS data into the freebox.
[0073] In a possible implementation, the memory 702 writes at least one of the following items through the first sub-unit: acquisition time, modification time, time scale, and playable duration information. Writes the data of each media track through the second sub-unit.
[0074] In a possible implementation, the memory 702 writes the capacity information into the third sub-unit, writes the type information into the fourth sub-unit, and writes the GPS data into the fifth sub-unit.
[0075] In a possible implementation, the memory 702 writes the at least one set of GPS data into the fifth sub-unit in the order of the acquisition time of the GPS data.
[0076] In a possible implementation, the memory 702 writes GPS data corresponding to the acquisition time of each set of video data and audio data. First, an identifier is written, and then at least one of latitude data, longitude data, and altitude data is written.
[0077] In a possible implementation, the processor 701 issues an instruction to obtain the real-time vehicle speed. When the real-time vehicle speed is zero, the memory 702 stops writing GPS data.
[0078] In a possible implementation, the processor 701 issues an instruction to obtain the real-time GPS signal. When the real-time GPS signal is lost, the memory 702 stops writing GPS data.
[0079] In a possible implementation, when the processor 701 recognizes that the data storage in the memory 702 is full, the processor 701 issues a "storage full" reminder at this time. Then, the user can select a processing mode according to the need. If the "autonomous deletion" mode is selected, the deletion time period is then selected. This time period consists of a start time and an end time. The start time is the starting time of deletion, and the end time is the ending time of deletion. After selection, the data during this period is deleted. If there is a subjective intention of the user to save data for multiple time periods, avoidance deletion can be performed, that is, save the data for multiple time periods subjectively retained by the user, and delete the other data that does not need to be saved in multiple segments. The start time and end time are selected multiple times to ensure that there is no data intended to be saved by the user within the start time and end time period each time. If the "all data retention" mode is selected, all data is saved, and the processor 701 issues an instruction to stop writing new data.
[0080] Those skilled in the art can understand that for the sake of convenience of description, Figure 7 only one memory 702 and one processor 701 are shown in the figure. In an actual terminal or server, there may be multiple processors and memories. The memory can also be referred to as a storage medium or a storage device, etc. The embodiments of the present application do not limit this.
[0081] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU for short), and the processor may also be other general-purpose processors, digital signal processors (DSP for short), application specific integrated circuits (ASIC for short), field-programmable gate arrays (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor may also adopt a general-purpose microprocessor, a graphics processing unit (GPU), or one or more integrated circuits to execute relevant programs to implement the functions required to be executed in the embodiments of the present application.
[0082] The processor 701 may also be an integrated circuit chip with the ability to process signals. In the implementation process, each step of the present application may be completed by the integrated logic circuit in the hardware of the processor 701 or the instructions in the form of software. The above-mentioned processor 701 may implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The steps of the method disclosed in combination with the embodiments of the present application may be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by the combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 702, and the processor 701 reads the information in the memory 702 and combines its hardware to complete the functions required to be executed by the units included in the method and related device for saving GPS information in the video file in the embodiments of the present application.
[0083] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchlink dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM). The memory may also be a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or any other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor through a bus. The memory may also be integrated with the processor. The memory may store a program, and when the program stored in the memory is executed by the processor, the processor is used to execute each step of the determination method in the above embodiments of the present application.
[0084] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA, or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components, the memory (storage module) is integrated in the processor.
[0085] It should be noted that the memory described herein is intended to include but not limited to these and any other suitable types of memory.
[0086] In addition to the data bus, the bus may further include a power bus, a control bus, a status signal bus, etc. However, for the sake of clear illustration, all kinds of buses are labeled as buses in the figure.
[0087] It should be understood that the term "and / or" in this article is merely an association relationship describing associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.
[0088] In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor or instructions in the form of software. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware processor, or executed and completed by a combination of the hardware and software modules in the processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.
[0089] Those of ordinary skill in the art can realize that the various illustrative logical blocks (ILBs) and steps described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but this implementation should not be considered to exceed the scope of this application.
[0090] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer-programmed program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the dashcam processor, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.), or can be transmitted from a website, computer, server, or data center to the dashcam processor by wire. The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state drive), etc.
[0091] As described above, the foregoing are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present application, and all of them should be covered by the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for saving GPS information in a video file, characterized in that, Including the steps of: Real-time collecting video data and audio data around the vehicle; Real-time collecting GPS data of the vehicle; Storing the video data, the audio data and the GPS data as a single MP4 format file; The MP4 format file includes: ftype box, moov box, mdat box, free box; the step of storing the video data, the audio data and the GPS data as a single MP4 format file includes the steps of: Writing an MP4 format flag into the ftype box; Writing the video data and the audio data into the mdat box; Writing video description information and audio description information into the moov box; Writing the GPS data into the free box.
2. The method according to claim 1, wherein the moov box includes a first sub-unit and a second sub-unit, the video data includes a video track, the audio data includes an audio track, and the step of writing the video description information and the audio description information into the moov box includes the steps of: Writing at least one of the following items through the first sub-unit: acquisition time, modification time, time measurement scale, playable duration information; Writing the video track and the audio track through the second sub-unit.
3. The method according to claim 1, wherein the free box includes a third sub-unit, a fourth sub-unit and a fifth sub-unit, the GPS data includes capacity information, type information, GPS sentence data, and the step of writing the GPS data into the free box includes the steps of: Writing the capacity information into the third sub-unit; Writing the type information into the fourth sub-unit; Writing the GPS sentence data into the fifth sub-unit.
4. The method according to claim 3, wherein the step of writing the GPS sentence data into the fifth sub-unit includes the steps of: Sequentially writing the GPS sentence data into the fifth sub-unit in the order of acquisition time.
5. The method according to claim 4, wherein the GPS data includes an identifier and at least one of latitude data, longitude data, and altitude data, and the step of writing the GPS sentence data into the fifth sub-unit includes the steps of: Writing the GPS data corresponding to the acquisition time of the video data and the audio data, first writing the identifier, and then writing at least one of the latitude data, the longitude data, and the altitude data.
6. The method according to any one of claims 1-5, obtaining the real-time vehicle speed, and when the real-time vehicle speed is zero, stopping writing the GPS data.
7. The method according to any one of claims 1-5, obtaining the real-time GPS signal, and when the real-time GPS signal is lost, stopping writing the GPS data.
8. An electronic device, characterized in that, Including at least one memory and at least one processor, the memory is configured to store computer instructions, and the processor is configured to execute the computer instructions to perform the method according to any one of claims 1-7.
9. A computer storage medium, characterized in that, The computer storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the above claims 1-7 is implemented.
Citation Information
Patent Citations
File generation method and file generation device
CN101887412A
Video recording method, video recording device and mobile terminal
CN105681713A