Method for filling blank recording
By presetting the recording clip duration and cross-over time during online ride-hailing trips, and marking and cache backup on the server, the incompleteness caused by the loss of recording clips is solved, the integrity and coherence of recordings are achieved, and the operation is improved Personnel’s ability to understand the details of the itinerary.
Patent Information
- Application Number
- CN202411529244.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-21
AI Technical Summary
During online ride-hailing trips, recording clips are lost due to majeure factors, resulting in incomplete recordings, affecting the operator's ability to understand the details of the trip.
By presetting the recording clip duration and cross-over time, the recording clip is recorded on the driver APP side, and the recording clip is marked and cached and backed up on the server side. When a recording is found to be vacant, use cache backup or generate blank recordings to supplement it, and use FFmpeg to splice and fade the recording clips to generate a complete recording.
It effectively solves the problem of poor recording coherence, ensures that operators can intuitively understand the recording content in the itinerary, and improves their ability to control the itinerary.
Smart Images

Figure CN119495330A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a recording method, in particular to a method for filling blank recordings, and belongs to the technical field of online car-hailing trip recording data processing. Background Art
[0002] As an important way for people to travel, online ride-hailing has become an indispensable part of many people's lives. As the business scale expands, more and more drivers join the online ride-hailing industry, and safety issues are also coming one after another. In order to ensure the safety of passengers and protect the rights and interests of passengers and drivers, the trip recording function is also launched. In the event of an unexpected situation, if the operator can download the complete recording and understand the whole story, they can better intervene in the incident and resolve unnecessary disputes.
[0003] During the pick-up and drop-off process, the driver-side APP will continuously record the sound inside the car and upload the recorded audio clips to the server. After the order is completed, the server will synthesize the audio and transcode it and upload it to the operation and maintenance system, providing the operation customer service personnel with the basic capabilities to ensure trip safety and dispute resolution.
[0004] However, in actual operation, in order to ensure the integrity of the recording, the recording is usually recorded and uploaded in segments throughout the entire journey. In this process, it is easy for some audio files to fail to be recorded due to force majeure (such as the driver making a phone call, APP process abnormalities, the vehicle passing through culverts, tunnels, etc.), resulting in incomplete audio uploaded to the server. There may be 60 clips during the journey, but only 30 are actually uploaded to the server. For example, there is only 2 minutes of recording in a 60-minute journey. The first minute occurs when the passenger just gets on the bus, and the second minute occurs when the passenger gets off the bus one hour later. The operator will feel confused when listening to it, and he is not sure when the conversation he heard took place, that is, the recording continuity is extremely poor. Therefore, a method of filling blank recordings is proposed. Summary of the invention
[0005] In view of this, the present invention provides a method for filling blank recordings to solve or alleviate the technical problems existing in the prior art and at least provide a beneficial option.
[0006] The technical solution of the embodiment of the present invention is implemented as follows: a method for filling blank recordings, comprising the following steps:
[0007] Preset recording segment duration and crossover duration;
[0008] Confirm the start of the trip on the driver's APP and start background recording;
[0009] Upload the recorded audio clips to the server and mark them according to the order information and time;
[0010] Cache and back up the uploaded and marked recording clips on the driver APP;
[0011] Continuously collect trip recordings through the server and store them in the file management system according to the order information;
[0012] When the trip is over, the server calculates the recording data based on the tags of the recording segments to determine whether there are any gaps;
[0013] When there is a gap, the driver's APP cache backup is retrieved according to the mark to supplement the missing part of the recording. If the retrieval or supplement fails, a corresponding blank recording is generated according to the mark information to fill the missing part of the recording;
[0014] When the recording gaps are filled or there are no gaps in the recording, the open source tool ffmpeg is used to splice the recording segments and fade the interleaved segments in and out to generate a complete recording, which is then transcoded.
[0015] Further preferably, the duration of the preset recording segment is 1-3 minutes, and the crossover duration is 5-10 seconds.
[0016] Further preferably, the trip starts when the driver APP confirms acceptance of the trip order. When confirming, the trip order information sends a SYN signal to the server, and the driver APP generates a cache folder based on the trip order information. The server replies with a SYN-ACK signal and sends a SYN signal from the server to the driver APP, and creates a folder in the file management system based on the trip order information. When the driver APP receives the SYN-ACK signal, the driver APP sends an ACK signal to the server to confirm the server's SYN request, completing the connection establishment, and the trip order starts.
[0017] Further preferably, the background recording is performed in segments according to a preset recording segment length in the background of the driver APP, and the next recording is started according to a preset crossover duration before each recording is completed.
[0018] Further preferably, the mark includes the itinerary order information, the start time and the end time of the recording segment;
[0019] The starting time of the recording segment = the actual starting time - the preset crossover duration.
[0020] Further preferably, the cache backup is to back up the uploaded and marked recording segments through the driver APP, and save the backup file in the cache folder.
[0021] Further preferably, the calculation of the recording data includes the time when the recording occurs during the trip, the total duration of the trip and the continuity of the recording;
[0022] The total duration of the trip is calculated based on the start time and end time of the trip;
[0023] The time when the recording occurs in the trip is calculated based on the start and end time of the recording segment in the mark and the total duration of the trip;
[0024] The recording continuity is calculated based on the total duration of the trip and the number of recording segments.
[0025] Further preferably, the determination of whether there is a gap is based on a result of recording continuity calculation, and when there is a gap, the position of the gap is determined based on the position of the time of occurrence of the recording in the trip within the total duration of the trip.
[0026] Further preferably, the missing part of the recording is supplemented by calculating the corresponding mark according to the determined missing position, and then retrieving the corresponding recording segment in the driver's APP cache backup according to the mark to supplement the missing part of the recording, so as to obtain a complete recording list;
[0027] The missing parts of the recording are filled in according to the determined vacant positions, the corresponding marks are calculated, and blank recording segments of the corresponding time period are generated according to the marks, and the missing parts of the recording are filled in to obtain a complete recording list.
[0028] Further preferably, the transcoding is to transcode the AMR recordings generated by splicing the open source tool ffmpeg into the MP3 format;
[0029] After the complete recording is generated, the server sends a CACHE-X command to the driver APP, and the driver APP deletes the cache folder according to the command;
[0030] Here, X is the name of the cache folder.
[0031] The embodiment of the present invention has the following advantages due to the adoption of the above technical solution:
[0032] 1. The present invention records the travel recording in segments and sets a crossover time between each recording segment to reduce the impact of recording loss. The crossover time can be used to make a smooth transition between each recording segment, reducing the abruptness or jump that may be caused by directly switching audio segments.
[0033] 2. The present invention marks each recorded recording by using order information and time, and backs up the marked recording segments on the driver APP side, so that the backup data can be used to supplement the gaps in the recording when the recording segments are spliced, and the gaps can be filled by generating blank recordings to solve the problem of recording continuity, ensuring that the operating personnel can intuitively understand when the recording content they are listening to occurs, and can have a better control over the overall trip situation, and ultimately can more easily intervene in and solve the problem.
[0034] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present invention will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0036] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0037] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present invention. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.
[0038] It should be noted that the terms "first", "second", "symmetrical", "array", etc. are only used to distinguish between description and position description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the definition of "first", "symmetrical", etc. can explicitly or implicitly include one or more of these features; similarly, when the number of certain features is not limited in the form of words such as "two" or "three", it should be noted that this feature also explicitly or implicitly includes one or more feature quantities.
[0039] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0040] Embodiment 1
[0041] like Figure 1As shown, an embodiment of the present invention provides a method for filling blank recordings, comprising the following steps:
[0042] S1, preset recording segment duration and crossover duration;
[0043] The preset recording segment duration is 1 minute, and the crossover duration is 10 seconds;
[0044] Reduce the impact of missing recording segments by reducing the duration of the recording segments and increasing the crossover duration;
[0045] Fading across clips to create smooth transitions between clips can be achieved with the acrossfade filter, which changes the volume to create a gradient between clips.
[0046] The specific examples are as follows
[0047] ffmpeg-i file1.amr-i file2.amr-filter_complex"[0:a]acrossfade=duration=10[a]"-c:a copy output.amr;
[0048] Among them, -i file1.amr: specifies the first input file file1.amr;
[0049] -i file2.amr: specifies the second input file file2.amr;
[0050] -filter_complex "[0:a]acrossfade=duration=10[a]": This part is the filter complex command, which is used to process two audio streams;
[0051] [0:a]: indicates the first audio stream;
[0052] Acrossfade=duration=10: Use the AcrossFade filter to create a cross-fade effect between two audio streams. Duration=10 specifies that the duration of the fade effect is 10 seconds.
[0053] [a]: indicates the processed audio stream;
[0054] -c:a copy: specifies the audio encoding mode as copy, that is, the audio is not re-encoded, so the quality of the original audio can be maintained;
[0055] output.amr: specifies the output file name;
[0056] S2. Confirm the start of the trip on the driver's APP and start background recording;
[0057] The trip starts when the driver APP confirms the acceptance of the trip order. When confirming, the trip order information sends a SYN signal to the server, and the driver APP generates a cache folder based on the trip order information. The server replies with a SYN-ACK signal and sends a SYN signal from the server to the driver APP. A folder is created in the file management system based on the trip order information. When the driver APP receives the SYN-ACK signal, it sends an ACK signal to the server to confirm the server's SYN request, completing the connection establishment, and the trip order starts;
[0058] The connection between the driver APP and the server is established by using the TCP protocol through a three-way handshake, so that both the driver APP and the server have the ability to communicate;
[0059] Among them, the first handshake: the driver APP sends a TCP segment with a SYN (synchronous sequence number) flag to the server and enters the SYN_SENT state, waiting for the server to confirm;
[0060] Second handshake: After receiving the SYN segment from the driver's APP, the server sends a TCP segment with a SYN-ACK (synchronization-acknowledgement) flag as a response and sets the connection state to SYN_RECEIVED. At the same time, the server also sends a SYN request of its own.
[0061] The third handshake: After the driver APP receives the SYN-ACK segment from the server, it will send a TCP segment with an ACK (acknowledgement) flag to confirm the server's SYN request and set the connection status to ESTABLISHED; at this point, the connection from the driver APP to the server is officially established;
[0062] S3, uploading the recorded audio clips to the server and marking them according to the order information and time;
[0063] The tags include the itinerary order information, the start time and the end time of the recording segment;
[0064] The starting time of the recording segment = the actual starting time - the preset crossover duration;
[0065] By using the itinerary order information, the start time and the end time of the recording segment to mark the recording segment, the location of the recording segment can be quickly locked using the marking information;
[0066] S4. Cache and back up the uploaded and marked recording clips on the driver's APP;
[0067] Cache backup is to back up the uploaded and marked recording clips through the driver APP and save the backup files to the cache folder;
[0068] By backing up the marked recording segments in the cache folder, when there are gaps in the recording, the backed-up recording segments can be used to supplement them to prevent the loss of the recording;
[0069] S5. Continuously collect the trip recording segments through the server and store them in the file management system according to the order information;
[0070] S6. When the trip is over, the server calculates the recording data according to the mark of the recording segment to determine whether there is a gap;
[0071] The recording data were calculated including the time when the recording occurred during the trip, the total duration of the trip, and the continuity of the recording;
[0072] The total duration of the trip is calculated based on the start time and end time of the trip;
[0073] The time when the recording occurs in the trip is calculated based on the start and end time of the recording segment in the mark and the total duration of the trip;
[0074] The recording continuity is calculated based on the total duration of the trip and the number of recording segments;
[0075] Whether there is a gap is determined based on the result of the recording continuity calculation. If there is a gap, the location of the gap is determined based on the time of occurrence of the recording in the trip within the total duration of the trip;
[0076] If the number of recording segments * (the duration of the preset recording segment - the crossover duration) / the total duration of the trip is ≥ 1, it means there is no gap, otherwise it is less than 1, it means there is a gap;
[0077] The gap position is determined based on the position of each recording segment within the total duration of the trip;
[0078] S7. When there is a gap, the driver's APP cache backup is retrieved according to the mark to supplement the missing part of the recording. If the retrieval or supplement fails, a corresponding blank recording is generated according to the mark information to fill the missing part of the recording;
[0079] To supplement the missing part of the recording, the corresponding mark is calculated according to the determined missing position, and then the corresponding recording segment in the cache backup of the driver's APP is retrieved according to the mark to supplement the missing part of the recording, so as to obtain a complete recording list;
[0080] Filling the missing parts of the recording is to calculate the corresponding marks according to the determined vacant positions, and generate blank recording segments of the corresponding time period according to the marks, fill the missing parts of the recording, and obtain a complete recording list;
[0081] By using the recording time corresponding to the vacant position, the mark corresponding to the position is reversed, and then the obtained mark is used to call the corresponding recording segment in the driver's APP cache backup or generate a blank recording segment of the corresponding time period to fill the vacant part and obtain a complete recording list to solve the problem of recording continuity and ensure that the operator can intuitively understand when the recording content they are listening to occurred.
[0082] S8. When the gaps in the recording are filled or there are no gaps in the recording, the open source tool ffmpeg is used to splice the recording segments and fade the interleaved segments to generate a complete recording, which is then transcoded;
[0083] Transcoding is to transcode the amr recordings generated by splicing with the open source tool ffmpeg into mp3 format;
[0084] After the complete recording is generated, the server sends a CACHE-X command to the driver APP, and the driver APP deletes the cache folder according to the command;
[0085] Where X is the name of the cache folder;
[0086] A deletion command is sent to the driver APP through the server to delete the cached data on the driver APP to prevent excessive cached data from affecting the normal use of the driver APP.
[0087] In one embodiment, the background recording is performed in segments according to the preset recording segment length in the background of the driver APP, and the next recording is started according to the preset crossover time before each recording is completed;
[0088] By utilizing the crossover duration, it can prevent the occurrence of blank or lost recordings during the switching of recording segments.
[0089] In one embodiment, FFmpeg is an open source project that provides a set of tools and libraries that can be used to record, convert digital audio and video recordings, and convert them into different formats. It supports a large number of audio and video formats. FFmpeg is maintained by the FFmpeg team and includes the libav* series of libraries and multiple command line tools.
[0090] The main components of FFmpeg include:
[0091] libavcodec: This is an audio and video codec library that contains a large number of codecs. Codecs are algorithms used to convert audio and video data from one format to another.
[0092] libavformat: This library contains packaging and stream processing code for handling various media formats (such as MP4, MOV, MKV, etc.).
[0093] libavfilter: Provides a series of filters for post-processing of audio and video, such as converting volume, applying sound effects, video scaling, watermark insertion, etc.
[0094] libavutil: This is a library that contains some common tools and utilities, such as mathematical calculations, random number generation, data structures, etc.
[0095] libswscale: for image scaling and color space conversion.
[0096] When using the open source tool ffmpeg to splice recording segments, use FFmpeg's concat function to splice the recording segment files in the complete recording list and transcode the amr recording into mp3 format. The specific command example is as follows:
[0097] ffmpeg-f amr-safe 0-i"concat:file1.mp3|file2.mp3|file3.mp3"-c:alibmp3lame-q:a 0 output.mp3;
[0098] Among them, -f amr: specifies the input file format as AMR;
[0099] -safe 0: turns off FFmpeg's safe mode, allowing it to handle corrupted input files;
[0100] -i"concat:file1.mp3|file2.mp3|file3.mp3": Use the concat filter to concatenate multiple files. Here, file1.mp3|file2.mp3|file3.mp3 is a separator used to specify the list of files to be concatenated;
[0101] -c:alibmp3lame: specifies the audio codec as MP3 and uses the libmp3lame library for encoding;
[0102] -q:a 0: Set the quality of MP3 audio, 0 means the highest quality;
[0103] output.mp3: Specifies the name of the output file.
[0104] Embodiment 2
[0105] An embodiment of the present invention also provides a method for filling blank recordings, comprising the following steps:
[0106] S1, preset recording segment duration and crossover duration;
[0107] S2. Confirm the start of the trip on the driver's APP and start background recording;
[0108] S3, uploading the recorded audio clips to the server and marking them according to the order information and time;
[0109] S4. Cache and back up the uploaded and marked recording clips on the driver's APP;
[0110] S5. Continuously collect the trip recording segments through the server and store them in the file management system according to the order information;
[0111] S6. When the trip is over, the server calculates the recording data according to the mark of the recording segment to determine whether there is a gap;
[0112] S7. When there is a gap, the driver's APP cache backup is retrieved according to the mark to supplement the missing part of the recording. If the retrieval or supplement fails, a corresponding blank recording is generated according to the mark information to fill the missing part of the recording;
[0113] S8. When the recording gaps are filled or there are no gaps in the recording, use the open source tool ffmpeg to splice the recording segments and fade the interleaved segments to generate a complete recording, which is then transcoded.
[0114] In one embodiment, the preset recording segment duration is 2 minutes, and the crossover duration is 8 seconds;
[0115] By controlling the duration and crossover duration of recording segments, the impact of recording segment loss can be reduced while avoiding server overload and ensuring data processing efficiency.
[0116] Fading across clips to create smooth transitions between clips can be achieved with the acrossfade filter, which changes the volume to create a gradient between clips.
[0117] The specific examples are as follows
[0118] ffmpeg-i file1.amr-i file2.amr-filter_complex"[0:a]acrossfade=duration=8[a]"-c:a copy output.amr;
[0119] Among them, -ifile1.amr: specifies the first input file file1.amr;
[0120] -i file2.amr: specifies the second input file file2.amr;
[0121] -filter_complex "[0:a]acrossfade=duration=8[a]": This part is the filter complex command, which is used to process two audio streams;
[0122] [0:a]: indicates the first audio stream;
[0123] acrossfade=duration=8: Use the acrossfade filter to create a cross-fade effect between the two audio streams. duration=5 specifies that the duration of the fade effect is 8 seconds.
[0124] [a]: indicates the processed audio stream;
[0125] -c:a copy: specifies the audio encoding mode as copy, that is, the audio is not re-encoded, so the quality of the original audio can be maintained;
[0126] output.amr: specifies the output file name.
[0127] In one embodiment, the trip starts when the driver APP confirms the acceptance of the trip order. When confirming, the trip order information sends a SYN signal to the server, and the driver APP generates a cache folder based on the trip order information. The server replies with a SYN-ACK signal and sends a SYN signal from the server to the driver APP. A folder is created in the file management system based on the trip order information. When the driver APP receives the SYN-ACK signal, the driver APP sends an ACK signal to the server to confirm the server's SYN request, completing the connection establishment, and the trip order starts.
[0128] The connection between the driver APP and the server is established by using the TCP protocol through a three-way handshake, so that both the driver APP and the server have the ability to communicate;
[0129] Among them, the first handshake: the driver APP sends a TCP segment with a SYN (synchronous sequence number) flag to the server and enters the SYN_SENT state, waiting for the server to confirm;
[0130] Second handshake: After receiving the SYN segment from the driver's APP, the server will send a TCP segment with a SYN-ACK (synchronization-acknowledgement) flag as a response and set the connection status to SYN_RECEIVED. At the same time, the server will also send a SYN request of its own.
[0131] The third handshake: After the driver APP receives the SYN-ACK segment from the server, it will send a TCP segment with an ACK (confirmation) flag to confirm the server's SYN request and set the connection status to ESTABLISHED. At this point, the connection from the driver APP to the server is officially established.
[0132] In one embodiment, the background recording is performed in segments according to the preset recording segment length in the background of the driver APP, and the next recording is started according to the preset crossover time before each recording is completed;
[0133] By utilizing the crossover duration, it can prevent the occurrence of blank or lost recordings during the switching of recording segments.
[0134] In one embodiment, the mark includes the trip order information, the start time and the end time of the recording segment;
[0135] The starting time of the recording segment = the actual starting time - the preset crossover duration;
[0136] By using the itinerary order information, the start time and the end time of the recording segment to mark the recording segment, the position of the recording segment can be quickly locked using the marking information.
[0137] In one embodiment, cache backup is to back up the uploaded and marked recording segments through the driver APP, and save the backup files to the cache folder.
[0138] By backing up the marked recording segments in the cache folder, when there are gaps in the recording, the backed-up recording segments can be used to supplement them to prevent the loss of the recording.
[0139] In one embodiment, the recording data is calculated including the time when the recording occurred during the trip, the total duration of the trip, and the continuity of the recording;
[0140] The total duration of the trip is calculated based on the start time and end time of the trip;
[0141] The time when the recording occurs in the trip is calculated based on the start and end time of the recording segment in the mark and the total duration of the trip;
[0142] The recording continuity is calculated based on the total duration of the trip and the number of recording segments.
[0143] Whether there is a gap is determined based on the result of the recording continuity calculation. When a gap exists, the position of the gap is determined based on the position of the time when the recording occurs in the trip within the total duration of the trip.
[0144] If the number of recording segments * (the duration of the preset recording segment - the crossover duration) / the total duration of the trip is ≥ 1, it means there is no gap, otherwise it is less than 1, it means there is a gap;
[0145] The gap position is determined based on the position of each recording segment within the total duration of the trip.
[0146] In one embodiment, the missing part of the recording is supplemented by calculating the corresponding mark according to the determined missing position, and then retrieving the corresponding recording segment in the cache backup of the driver's APP according to the mark to supplement the missing part of the recording, so as to obtain a complete recording list;
[0147] The missing parts of the recording are filled in according to the determined vacant positions, the corresponding marks are calculated, and the blank recording segments of the corresponding time period are generated according to the marks, the missing parts of the recording are filled in, and a complete recording list is obtained.
[0148] By using the recording time corresponding to the missing position, the mark corresponding to the position is reversed, and then the obtained mark is used to call the corresponding recording segment in the driver's APP cache backup or generate a blank recording segment of the corresponding time period to fill in the missing part and obtain a complete recording list to solve the problem of recording continuity and ensure that operators can intuitively understand when the recording content they are listening to occurred.
[0149] In one embodiment, transcoding is to transcode the amr recording generated by splicing with the open source tool ffmpeg into the mp3 format;
[0150] After the complete recording is generated, the server sends a CACHE-X command to the driver APP, and the driver APP deletes the cache folder according to the command;
[0151] Where X is the name of the cache folder;
[0152] A deletion command is sent to the driver APP through the server to delete the cached data on the driver APP to prevent excessive cached data from affecting the normal use of the driver APP.
[0153] Embodiment 3
[0154] An embodiment of the present invention also provides a method for filling blank recordings, comprising the following steps:
[0155] S1, preset recording segment duration and crossover duration;
[0156] S2. Confirm the start of the trip on the driver's APP and start background recording;
[0157] S3, uploading the recorded audio clips to the server and marking them according to the order information and time;
[0158] S4. Cache and back up the uploaded and marked recording clips on the driver's APP;
[0159] S5. Continuously collect the trip recording segments through the server and store them in the file management system according to the order information;
[0160] S6. When the trip is over, the server calculates the recording data according to the mark of the recording segment to determine whether there is a gap;
[0161] S7. When there is a gap, the driver's APP cache backup is retrieved according to the mark to supplement the missing part of the recording. If the retrieval or supplement fails, a corresponding blank recording is generated according to the mark information to fill the missing part of the recording;
[0162] S8. When the recording gaps are filled or there are no gaps in the recording, use the open source tool ffmpeg to splice the recording segments and fade the interleaved segments to generate a complete recording, which is then transcoded.
[0163] In one embodiment, the preset recording segment duration is 3 minutes, and the crossover duration is 5 seconds;
[0164] By increasing the length of recording segments and reducing the crossover time, the frequency of data transmission between the driver app and the server is reduced to reduce the server load, especially during high traffic periods. This helps ensure stable server operation and avoid performance degradation or service interruption due to overload;
[0165] Fading across clips to create smooth transitions between clips can be achieved with the acrossfade filter, which changes the volume to create a gradient between clips.
[0166] The specific examples are as follows
[0167] ffmpeg-i file1.amr-i file2.amr-filter_complex"[0:a]acrossfade=duration=5[a]"-c:a copy output.amr;
[0168] Among them, -i file1.amr: specifies the first input file file1.amr;
[0169] -i file2.amr: specifies the second input file file2.amr;
[0170] -filter_complex "[0:a]acrossfade=duration=5[a]": This part is the filter complex command, which is used to process two audio streams;
[0171] [0:a]: indicates the first audio stream;
[0172] acrossfade=duration=5: Use the acrossfade filter to create a cross-fade effect between two audio streams. Duration=5 specifies that the duration of the fade effect is 5 seconds.
[0173] [a]: indicates the processed audio stream;
[0174] -c:a copy: specifies the audio encoding mode as copy, that is, the audio is not re-encoded, so the quality of the original audio can be maintained;
[0175] output.amr: specifies the output file name.
[0176] In one embodiment, the trip starts when the driver APP confirms the acceptance of the trip order. When confirming, the trip order information sends a SYN signal to the server, and the driver APP generates a cache folder based on the trip order information. The server replies with a SYN-ACK signal and sends a SYN signal from the server to the driver APP. A folder is created in the file management system based on the trip order information. When the driver APP receives the SYN-ACK signal, the driver APP sends an ACK signal to the server to confirm the server's SYN request, completing the connection establishment, and the trip order starts.
[0177] The connection between the driver APP and the server is established by using the TCP protocol through a three-way handshake, so that both the driver APP and the server have the ability to communicate;
[0178] Among them, the first handshake: the driver APP sends a TCP segment with a SYN (synchronous sequence number) flag to the server and enters the SYN_SENT state, waiting for the server to confirm;
[0179] Second handshake: After receiving the SYN segment from the driver's APP, the server will send a TCP segment with a SYN-ACK (synchronization-acknowledgement) flag as a response and set the connection status to SYN_RECEIVED. At the same time, the server will also send a SYN request of its own.
[0180] The third handshake: After the driver APP receives the SYN-ACK segment from the server, it will send a TCP segment with an ACK (confirmation) flag to confirm the server's SYN request and set the connection status to ESTABLISHED. At this point, the connection from the driver APP to the server is officially established.
[0181] In one embodiment, the background recording is performed in segments according to the preset recording segment length in the background of the driver APP, and the next recording is started according to the preset crossover time before each recording is completed;
[0182] By utilizing the crossover duration, it can prevent the occurrence of blank or lost recordings during the switching of recording segments.
[0183] In one embodiment, the mark includes the trip order information, the start time and the end time of the recording segment;
[0184] The starting time of the recording segment = the actual starting time - the preset crossover duration;
[0185] By using the itinerary order information, the start time and the end time of the recording segment to mark the recording segment, the position of the recording segment can be quickly locked using the marking information.
[0186] In one embodiment, cache backup is to back up the uploaded and marked recording segments through the driver APP, and save the backup files to the cache folder.
[0187] By backing up the marked recording segments in the cache folder, when there are gaps in the recording, the backed-up recording segments can be used to supplement them to prevent the loss of the recording.
[0188] In one embodiment, the recording data is calculated including the time when the recording occurred during the trip, the total duration of the trip, and the continuity of the recording;
[0189] The total duration of the trip is calculated based on the start time and end time of the trip;
[0190] The time when the recording occurs in the trip is calculated based on the start and end time of the recording segment in the mark and the total duration of the trip;
[0191] The recording continuity is calculated based on the total duration of the trip and the number of recording segments.
[0192] Whether there is a gap is determined based on the result of the recording continuity calculation. When a gap exists, the position of the gap is determined based on the position of the time when the recording occurs in the trip within the total duration of the trip.
[0193] If the number of recording segments * (the duration of the preset recording segment - the crossover duration) / the total duration of the trip is ≥ 1, it means there is no gap, otherwise it is less than 1, it means there is a gap;
[0194] The gap position is determined based on the position of each recording segment within the total duration of the trip.
[0195] In one embodiment, the missing part of the recording is supplemented by calculating the corresponding mark according to the determined missing position, and then retrieving the corresponding recording segment in the cache backup of the driver's APP according to the mark to supplement the missing part of the recording, so as to obtain a complete recording list;
[0196] The missing parts of the recording are filled in according to the determined vacant positions, the corresponding marks are calculated, and the blank recording segments of the corresponding time period are generated according to the marks, the missing parts of the recording are filled in, and a complete recording list is obtained.
[0197] By using the recording time corresponding to the missing position, the mark corresponding to the position is reversed, and then the obtained mark is used to call the corresponding recording segment in the driver's APP cache backup or generate a blank recording segment of the corresponding time period to fill in the missing part and obtain a complete recording list to solve the problem of recording continuity and ensure that operators can intuitively understand when the recording content they are listening to occurred.
[0198] In one embodiment, transcoding is to transcode the amr recording generated by splicing with the open source tool ffmpeg into the mp3 format;
[0199] After the complete recording is generated, the server sends a CACHE-X command to the driver APP, and the driver APP deletes the cache folder according to the command;
[0200] Where X is the name of the cache folder;
[0201] A deletion command is sent to the driver APP through the server to delete the cached data on the driver APP to prevent excessive cached data from affecting the normal use of the driver APP.
[0202] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of various changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for filling blank recordings, characterized in that: The following steps are involved: Preset recording segment duration and crossover duration; Confirm the start of the trip on the driver's APP and start background recording; Upload the recorded audio clips to the server and mark them according to the order information and time; Cache and back up the uploaded and marked recording clips on the driver APP; Continuously collect trip recordings through the server and store them in the file management system according to the order information; When the trip is over, the server calculates the recording data based on the tags of the recording segments to determine whether there are any gaps; When there is a gap, the driver's APP cache backup is retrieved according to the mark to supplement the missing part of the recording. If the retrieval or supplement fails, a corresponding blank recording is generated according to the mark information to fill the missing part of the recording; When the recording gaps are filled or there are no gaps in the recording, the open source tool ffmpeg is used to splice the recording segments and fade the interleaved segments in and out to generate a complete recording, which is then transcoded.
2. The method for filling blank recording according to claim 1, characterized in that: The duration of the preset recording segment is 1-3 minutes, and the crossover duration is 5-10 seconds.
3. The method for filling blank recording according to claim 1, characterized in that: The trip starts when the driver APP confirms acceptance of the trip order. When confirming, the trip order information sends a SYN signal to the server, and the driver APP generates a cache folder based on the trip order information. The server replies with a SYN-ACK signal and sends a SYN signal from the server to the driver APP. A folder is created in the file management system based on the trip order information. When the driver APP receives the SYN-ACK signal, the driver APP sends an ACK signal to the server to confirm the server's SYN request, completing the connection establishment, and the trip order starts.
4. The method for filling blank recording according to claim 2, characterized in that: The background recording is performed in segments according to the preset recording segment length in the background of the driver APP, and the next recording is started according to the preset crossover time before each recording is completed.
5. The method for filling blank recording according to claim 2, characterized in that: The mark includes the itinerary order information, the start time and the end time of the recording segment; The starting time of the recording segment = the actual starting time - the preset crossover duration.
6. The method for filling blank recording according to claim 5, characterized in that: The cache backup is to back up the uploaded and marked recording clips through the driver APP, and save the backup file in the cache folder.
7. The method for filling blank recording according to claim 5, characterized in that: The calculation of the recording data includes the time when the recording occurred during the trip, the total duration of the trip and the continuity of the recording; The total duration of the trip is calculated based on the start time and end time of the trip; The time when the recording occurs in the trip is calculated based on the start and end time of the recording segment in the mark and the total duration of the trip; The recording continuity is calculated based on the total duration of the trip and the number of recording segments.
8. The method for filling blank recording according to claim 7, characterized in that: The determination of whether there is a gap is based on the result of recording continuity calculation. When there is a gap, the position of the gap is determined based on the position of the occurrence time of the recording in the trip within the total duration of the trip.
9. The method for filling blank recording according to claim 8, characterized in that: The missing part of the recording is supplemented by calculating the corresponding mark according to the determined missing position, and then retrieving the corresponding recording segment in the driver's APP cache backup according to the mark to supplement the missing part of the recording, so as to obtain a complete recording list; The missing parts of the recording are filled in according to the determined vacant positions, the corresponding marks are calculated, and blank recording segments of the corresponding time period are generated according to the marks, and the missing parts of the recording are filled in to obtain a complete recording list.
10. The method for filling blank recording according to claim 1, characterized in that: The transcoding is to transcode the amr recording generated by splicing the open source tool ffmpeg into mp3 format; After the complete recording is generated, the server sends a CACHE-X command to the driver APP, and the driver APP deletes the cache folder according to the command; Here, X is the name of the cache folder.