WO2024021999A1 - Synchronization method, system, and electronic device - Google Patents

Synchronization method, system, and electronic device Download PDF

Info

Publication number
WO2024021999A1
WO2024021999A1 PCT/CN2023/104098 CN2023104098W WO2024021999A1 WO 2024021999 A1 WO2024021999 A1 WO 2024021999A1 CN 2023104098 W CN2023104098 W CN 2023104098W WO 2024021999 A1 WO2024021999 A1 WO 2024021999A1
Authority
WO
WIPO (PCT)
Prior art keywords
ipc
image frame
time
information corresponding
image
Prior art date
Application number
PCT/CN2023/104098
Other languages
French (fr)
Chinese (zh)
Inventor
罗鹏
林霖
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024021999A1 publication Critical patent/WO2024021999A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/236Assembling of a multiplex stream, e.g. transport stream, by combining a video stream with other content or additional data, e.g. inserting a URL [Uniform Resource Locator] into a video stream, multiplexing software data into a video stream; Remultiplexing of multiplex streams; Insertion of stuffing bits into the multiplex stream, e.g. to obtain a constant bit-rate; Assembling of a packetised elementary stream
    • H04N21/23602Multiplexing isochronously with the video sync, e.g. according to bit-parallel or bit-serial interface formats, as SDI
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/172Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/20Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video object coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/236Assembling of a multiplex stream, e.g. transport stream, by combining a video stream with other content or additional data, e.g. inserting a URL [Uniform Resource Locator] into a video stream, multiplexing software data into a video stream; Remultiplexing of multiplex streams; Insertion of stuffing bits into the multiplex stream, e.g. to obtain a constant bit-rate; Assembling of a packetised elementary stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/242Synchronization processes, e.g. processing of PCR [Program Clock References]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen

Definitions

  • Embodiments of the present application relate to the field of communications, and in particular, to a synchronization method, system and electronic device.
  • IPC IP Camera
  • servers such as MP (Media Process, media processing terminal) equipment, MEP (Multi-access Edge Platform, multi-access edge platform) equipment, etc.
  • MP Media Process, media processing terminal
  • MEP Multi-access Edge Platform, multi-access edge platform
  • multiple IPCs collect original images and encode the original images into image frames and send them to the server; then the server selects one image frame from the image frames sent by each IPC for video splicing and FVV (Free-Viewpoint Video, Free-angle video) video production and other processing.
  • FVV Free-Viewpoint Video, Free-angle video
  • the existing technology uses data lines to connect two IPCs, and then the hardware control circuit controls the encoded video frame time of the IPCs so that all IPCs output video frame times are consistent.
  • Frame time synchronization The disadvantage of using hardware to achieve frame time synchronization of multiple IPCs is that it requires additional hardware and is costly; and the use of data lines to connect is not conducive to IPC deployment; in addition, if the hardware line contact is poor, it will cause the frame time to be out of synchronization and have poor robustness. etc.
  • this application provides a synchronization method, system and electronic device.
  • frame time synchronization between multiple IPCs can be achieved without resorting to hardware through data interaction between the server and the IPC. It has good robustness and can reduce costs and facilitate the deployment of multiple IPCs.
  • embodiments of the present application provide a synchronization method.
  • the method includes: first, the server receives image frames sent by multiple network cameras IPC, and time information corresponding to the image frames, where the image frames are obtained by processing the original images. From the encoding, the multiple IPCs include the first IPC and the second IPC.
  • the second IPC is a reference for whether the frame times of the first IPC and the second IPC are synchronized; then, when the server sends time information based on the image frame sent by the first IPC , and the time information corresponding to the image frame sent by the second IPC.
  • the server sends a coding adjustment instruction to the first IPC.
  • the coding adjustment instruction is used to trigger the first IPC to perform encoding. Adjust so that the time for the first IPC to read the next frame of the original image to be encoded is adjusted.
  • the server triggers the first IPC to perform one or more encoding adjustments by sending encoding adjustment instructions to the first IPC one or more times, so that the first IPC reads the time of the next frame of the original image to be encoded one or more times.
  • the adjustment occurs to achieve synchronization of the frame time of the first IPC and the second IPC; thereby avoiding time differences in the pictures captured by multiple image frames received by the server in the same time period, and achieving frame time synchronization of multiple IPCs.
  • this application can achieve frame time synchronization between multiple IPCs without using hardware through data interaction between the server and the IPC, and is robust. Good; and can reduce costs and facilitate the deployment of multiple IPCs.
  • the plurality of IPCs include at least a first IPC and a second IPC.
  • the original image may refer to an image collected by the photoreceptor of the IPC, that is, a RAW (unprocessed) image.
  • the server may refer to a single server or a server cluster (such as a cloud server). This application does not make restrictions.
  • the server can be an MP device, a MEP device, etc.
  • an image frame may also be called a code stream.
  • the image frame may be a video frame.
  • the server sends a coding adjustment instruction to the first IPC, including: the server sends a coding control message to the first IPC; wherein the coding control message includes an offset time, and the offset time is an image frame sent by the server according to the first IPC
  • the corresponding time information is determined by the time difference between the time information corresponding to the image frame sent by the second IPC; the encoding control message is used to trigger the first IPC to obtain the next frame of the original image to be encoded based on the offset time. Adjustment.
  • the first IPC when the first IPC receives the encoding control message, it can move the time to obtain the next frame of the original image to be encoded by the offset time in the encoding control message; and then the first IPC can achieve the same result as the first IPC through one encoding adjustment.
  • Two IPC frame time synchronization when the first IPC receives the encoding control message, it can move the time to obtain the next frame of the original image to be encoded by the offset time in the encoding control message; and then the first IPC can achieve the same result as the first IPC through one encoding adjustment. Two IPC frame time synchronization.
  • the offset time may be the time difference between the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC.
  • the offset time may be the time difference between the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC, and the sum or difference between the preset period.
  • the preset period may refer to a preset encoding period such as 30 ms, which can be specifically set according to requirements, and this application does not limit this.
  • the server sends an encoding adjustment instruction to the first IPC, including: the server sends an encoding restart message to the first IPC, and the encoding restart message is used to trigger the first IPC to perform encoding. Restart.
  • the server sends an encoding restart message to the first IPC, and the encoding restart message is used to trigger the first IPC to perform encoding. Restart.
  • the server sends a coding adjustment instruction to the first IPC, including: the server sends a coding refresh message to the first IPC, and the coding refresh message is used to trigger the first IPC to frame refresh.
  • the first IPC receives the encoding refresh message, it can refresh the frame and start the next encoding. It will also read the original image to be encoded in the next frame, and encode the original image to be encoded in the next frame. This causes the time for the first IPC to read the next frame of the original image to be encoded to be adjusted.
  • the first IPC can achieve frame time synchronization with the second IPC through one or more frame refreshes.
  • determining that the frame time of the first IPC and the second IPC is not synchronized includes: the server determines synchronization time information corresponding to the image frame sent by the first IPC, and The time difference between the synchronization time information corresponding to the image frames sent by the two IPCs is greater than the threshold.
  • the time difference between the synchronization time information corresponding to the image frame sent by the first IPC and the synchronization time information corresponding to the image frame sent by the second IPC is less than or equal to the threshold, it can be determined that the first IPC and the second IPC Frame time synchronization.
  • the time information corresponding to the image frame sent by each IPC in the plurality of IPCs is the time for each IPC to read the next frame of the original image to be encoded.
  • the time information corresponding to each image frame sent by each IPC is closer to the actual time of the picture captured by each image frame, so that the time information corresponding to the image frame sent by the first IPC determined by the server corresponds to the image frame sent by the second IPC
  • the time difference between the time information is more accurate, and the server sends fewer encoding adjustment instructions to the first IPC, which can achieve frame time synchronization between the first IPC and the second IPC and reduce the time required to synchronize the first IPC and the second IPC.
  • the duration of the frame time is the duration of the frame time.
  • embodiments of the present application provide a synchronization method.
  • the method includes: first, the first IPC reads the original image to be encoded; then, the first IPC encodes the original image into an image frame, and the first IPC determines the image Time information corresponding to the frame; subsequently, the first IPC sends the image frame and time information corresponding to the image frame.
  • the first IPC can receive the encoding adjustment instruction.
  • the encoding adjustment instruction is based on the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC. It is generated and sent when the frame time of the first IPC and the second IPC is not synchronized.
  • the second IPC is a reference for whether the frame time of the first IPC and the second IPC is synchronized; then, the first IPC performs coding adjustment according to the coding adjustment instruction. , so that the time for the first IPC to read the next frame of the original image to be encoded is adjusted.
  • the first IPC implements one or more encoding adjustments according to one or more encoding adjustment instructions sent by the server, so that the time to read the next frame of the original image to be encoded is adjusted one or more times to achieve the same goal.
  • the outgoing frame time of the second IPC is synchronized; thereby avoiding time differences in pictures captured by multiple image frames received by the server within the same time period, and achieving frame time synchronization of multiple IPCs.
  • this application can achieve frame time synchronization between multiple IPCs without using hardware through data interaction between the server and the IPC, and is robust. Good; and can reduce costs and facilitate the deployment of multiple IPCs.
  • the second IPC can perform the following steps: first, the second IPC reads the original image to be encoded; then, the second IPC encodes the original image into an image frame, and the second IPC determines the time information corresponding to the image frame; Subsequently, the second IPC sends the image frame and time information corresponding to the image frame.
  • the original image may refer to an image collected by the photoreceptor of the IPC, that is, a RAW (unprocessed) image.
  • an image frame may also be called a code stream.
  • the image frame may be a video frame.
  • the first IPC determines the time information corresponding to the image frame, including: the first IPC determines the time information corresponding to the image frame based on the time when the original image to be encoded is read.
  • the time information corresponding to each image frame sent by each IPC is closer to the time when the picture captured by each image frame actually occurred, so that the time information corresponding to the image frame sent by the first IPC determined by the server is consistent with the image frame sent by the second IPC.
  • the time difference between the corresponding time information is more accurate, and the first IPC performs fewer encoding adjustments to achieve frame time synchronization with the second IPC, reducing the length of time to synchronize the frame time of the first IPC and the second IPC.
  • the time information can be determined based on any time before the image frame is sent.
  • the time information corresponding to the image frame can be determined based on the time when the original image is read.
  • the time information corresponding to the image frame is determined based on the time at which the image frame is obtained by encoding.
  • the time information corresponding to the image frame is determined based on the time of various coding steps (such as coding prediction, quantization, entropy coding, etc.) performed during the coding process; etc., this application does not limit this.
  • the first IPC sends the image frame and the time information corresponding to the image frame, including: the first IPC encapsulates the time information corresponding to the image frame into the extension field of the image frame , send the encapsulated image frame.
  • the first IPC may first encapsulate the image frame according to the video encoding protocol, and when encapsulating the image frame according to the video encoding protocol, encapsulate the time information into the first extension field of the image frame (that is, the first extension field of the video encoding protocol). extension field). Then, the first IPC performs a second encapsulation on the first encapsulated image frame according to the network transmission protocol, and sends the second encapsulated image frame.
  • the first IPC can perform the first encapsulation of the image frame according to the video encoding protocol; then, perform the second encapsulation of the first encapsulated image frame according to the network transmission protocol, and when encapsulating the image frame according to the network transmission protocol, The time information is encapsulated into the second extension field of the image frame (that is, the extension field of the network transmission protocol); the first IPC then sends the second encapsulated image frame.
  • the encoding adjustment indication is a encoding control message
  • the encoding control message includes an offset time
  • the offset time is time information corresponding to the image frame sent by the server based on the first IPC.
  • the time difference between the time information corresponding to the image frame sent by the second IPC is determined; the first IPC performs encoding adjustment according to the encoding adjustment instruction, including: the first IPC reads the original image to be encoded in the next frame according to the offset time time to adjust. In this way, the first IPC can achieve frame time synchronization with the second IPC through one encoding adjustment.
  • the encoding adjustment indication is a encoding restart message
  • the first IPC performs encoding adjustment according to the encoding adjustment instruction, including: the first IPC performs encoding restart according to the encoding restart message. Since the first IPC will perform encoding immediately after restarting encoding, after the encoding restarts successfully, the next frame of the original image to be encoded can be read, and then the next frame of the image to be encoded can be encoded. In this way, the first IPC can also read the original image to be encoded in the next frame.
  • the time is adjusted that is, the time for the first IPC to read the next frame of the original image to be encoded can be adjusted to the encoding restart success time.
  • the first IPC can achieve frame time synchronization with the second IPC through one or more encoding restarts.
  • the coding adjustment indication is a coding refresh message
  • the first IPC performs coding adjustment according to the coding adjustment instruction, including: the first IPC performs frame refresh according to the coding refresh message.
  • the frame refresh starts the next encoding.
  • the first IPC can read the original image to be encoded in the next frame, and then encode the original image to be encoded in the next frame.
  • the time for the first IPC to read the next frame of the original image to be encoded can also be adjusted, that is, the time for the first IPC to read the next frame of the original image to be encoded is adjusted to the current time.
  • the first IPC can achieve frame time synchronization with the second IPC through one or more frame refreshes.
  • the second aspect and any implementation manner of the second aspect respectively correspond to the first aspect and any implementation manner of the first aspect.
  • the technical effects corresponding to the second aspect and any implementation manner of the second aspect may be referred to the technical effects corresponding to the above-mentioned first aspect and any implementation manner of the first aspect, which will not be described again here.
  • inventions of the present application provide a synchronization system.
  • the system includes: multiple network camera IPCs and a server.
  • the multiple IPCs include a first IPC and a second IPC.
  • the second IPC is a link between the first IPC and the second IPC. Reference for frame time synchronization;
  • the first IPC is used to read the first original image to be encoded; encode the first original image into a first image frame, and determine the time information corresponding to the first image frame; send the first image frame and the first image to the server Time information corresponding to the frame; and receiving a coding adjustment instruction; performing coding adjustment according to the coding adjustment instruction, so that the time for reading the first original image to be encoded in the next frame is adjusted;
  • the second IPC is used to read the second original image to be encoded; encode the second original image into a second image frame, and determine the time information corresponding to the second image frame; send the second image frame and the second image to the server The time information corresponding to the frame;
  • the server is configured to receive the first image frame sent by the first IPC and the time information corresponding to the first image frame, and to receive the second image frame sent by the second IPC and the time information corresponding to the second image frame; when according to the first IPC
  • a coding adjustment instruction is sent to the first IPC.
  • the third aspect and any one implementation manner of the server of the third aspect respectively correspond to the first aspect and any one implementation manner of the first aspect.
  • the technical effects corresponding to the third aspect and any implementation of the server of the third aspect can be found in the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be described again here.
  • any implementation of the third aspect and the first IPC of the third aspect corresponds to the second aspect and any implementation of the second aspect respectively.
  • the technical effects corresponding to any implementation of the third aspect and the first IPC please refer to the technical effects corresponding to the above-mentioned second aspect and any implementation of the first IPC, and will not be described again here.
  • embodiments of the present application provide a network camera IPC, which can be used to implement the second aspect and any implementation manner of the second aspect.
  • embodiments of the present application provide an electronic device, including: a memory and a processor, the memory is coupled to the processor; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the first aspect or A synchronized method in any possible implementation of the first aspect.
  • the fifth aspect and any implementation manner of the fifth aspect respectively correspond to the first aspect and any implementation manner of the first aspect.
  • the technical effects corresponding to the fifth aspect and any implementation manner of the fifth aspect may be referred to the technical effects corresponding to the above-mentioned first aspect and any implementation manner of the first aspect, and will not be described again here.
  • embodiments of the present application provide an electronic device, including: a memory and a processor, the memory is coupled to the processor; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the second aspect or
  • the second aspect is optional synchronization method in the possible implementation.
  • the sixth aspect and any implementation manner of the sixth aspect respectively correspond to the second aspect and any implementation manner of the second aspect.
  • the technical effects corresponding to the sixth aspect and any implementation manner of the sixth aspect please refer to the technical effects corresponding to the above-mentioned second aspect and any implementation manner of the second aspect, which will not be described again here.
  • embodiments of the present application provide a chip, including one or more interface circuits and one or more processors; the interface circuit is used to receive signals from the memory of the electronic device and send signals to the processor, and the signals include the memory computer instructions stored in; when the processor executes the computer instructions, the electronic device is caused to execute the synchronization method in the first aspect or any possible implementation of the first aspect.
  • the seventh aspect and any implementation manner of the seventh aspect respectively correspond to the first aspect and any implementation manner of the first aspect.
  • the technical effects corresponding to the seventh aspect and any implementation manner of the seventh aspect may be referred to the technical effects corresponding to the above-mentioned first aspect and any implementation manner of the first aspect, and will not be described again here.
  • embodiments of the present application provide a chip, including one or more interface circuits and one or more processors; the interface circuit is used to receive signals from the memory of the electronic device and send signals to the processor, and the signals include the memory computer instructions stored in; when the processor executes the computer instructions, the electronic device is caused to execute the synchronization method in the second aspect or any possible implementation of the second aspect.
  • the eighth aspect and any implementation manner of the eighth aspect respectively correspond to the second aspect and any implementation manner of the second aspect.
  • the technical effects corresponding to the eighth aspect and any implementation manner of the eighth aspect please refer to the technical effects corresponding to the above-mentioned second aspect and any implementation manner of the second aspect, which will not be described again here.
  • embodiments of the present application provide a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the computer program When the computer program is run on a computer or processor, it causes the computer or processor to execute the first aspect or the second aspect.
  • a synchronized method in any possible implementation on the one hand.
  • the ninth aspect and any one implementation manner of the ninth aspect respectively correspond to the first aspect and any one implementation manner of the first aspect.
  • the technical effects corresponding to the ninth aspect and any implementation manner of the ninth aspect may be referred to the technical effects corresponding to the above-mentioned first aspect and any implementation manner of the first aspect, and will not be described again here.
  • embodiments of the present application provide a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the computer program When the computer program is run on a computer or processor, it causes the computer or processor to execute the second aspect or the second aspect. Synchronization methods in any possible implementation of both aspects.
  • the tenth aspect and any one implementation manner of the tenth aspect respectively correspond to the second aspect and any one implementation manner of the second aspect.
  • the technical effects corresponding to the tenth aspect and any one of the implementation methods of the tenth aspect please refer to the technical effects corresponding to the above-mentioned second aspect and any one implementation method of the second aspect, which will not be described again here.
  • inventions of the present application provide a computer program product.
  • the computer program product includes a software program.
  • the software program When executed by a computer or a processor, it causes the computer or processor to execute the first aspect or any possibility of the first aspect.
  • the synchronization method in the implementation When the software program is executed by a computer or a processor, it causes the computer or processor to execute the first aspect or any possibility of the first aspect.
  • the eleventh aspect and any implementation manner of the eleventh aspect respectively correspond to the first aspect and any implementation manner of the first aspect.
  • the technical effects corresponding to the eleventh aspect and any implementation manner of the eleventh aspect please refer to the technical effects corresponding to the above-mentioned first aspect and any implementation manner of the first aspect, which will not be described again here.
  • inventions of the present application provide a computer program product.
  • the computer program product includes a software program.
  • the software program When executed by a computer or a processor, it causes the computer or processor to execute the second aspect or any possibility of the second aspect.
  • the synchronization method in the implementation When the software program is executed by a computer or a processor, it causes the computer or processor to execute the second aspect or any possibility of the second aspect.
  • the twelfth aspect and any one implementation manner of the twelfth aspect respectively correspond to the second aspect and any one implementation manner of the second aspect.
  • the technical effects corresponding to the twelfth aspect and any one of the implementation methods of the twelfth aspect please refer to the technical effects corresponding to the above-mentioned second aspect and any one implementation method of the second aspect, which will not be described again here.
  • Figure 1a is a schematic diagram of an exemplary application scenario
  • Figure 1b is a schematic diagram of an exemplary application scenario
  • Figure 1c is a schematic diagram of an exemplary application scenario
  • Figure 1d is a schematic diagram illustrating an exemplary IPC deployment manner
  • Figure 1e is a schematic structural diagram of an exemplary IPC
  • Figure 1f is a schematic structural diagram of an exemplary synchronization component
  • Figure 2 is a schematic diagram of an exemplary synchronization process
  • Figure 3a is a schematic diagram of an exemplary synchronization process
  • Figure 3b is a schematic diagram of the frame structure of an encapsulated image frame
  • Figure 3c is a schematic diagram of the frame structure of an encapsulated image frame
  • Figure 3d is a schematic diagram of the frame structure of an encapsulated image frame
  • Figure 3e is a schematic diagram of the message structure of an exemplary encoded control message
  • Figure 4 is a schematic diagram of an exemplary synchronization process
  • Figure 5 is a schematic diagram of an exemplary synchronization process
  • Figure 6 is a schematic diagram of an exemplary synchronization system
  • Figure 7 is a schematic structural diagram of an exemplary device.
  • a and/or B can mean: A exists alone, A and B exist simultaneously, and they exist alone. B these three situations.
  • first and second in the description and claims of the embodiments of this application are used to distinguish different objects, rather than to describe a specific order of objects.
  • first target object, the second target object, etc. are used to distinguish different target objects, rather than to describe a specific order of the target objects.
  • multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
  • Figure 1a is a schematic diagram of an exemplary application scenario.
  • n is an integer greater than 1 IPCs are connected to the same MP device via a router.
  • each IPC can collect the original image of the target object (that is, RAW (unprocessed) image), then encode the original image into an image frame, and send the image frame to the router; the router converts the image frame Forwarded to MP device.
  • the MP device can process the n image frames sent by IPC, such as video splicing, FVV video production, etc. This application does not limit this. Subsequently, the MP device can send the processed image frames to terminal devices such as mobile phones, tablets, etc.
  • Figure 1b is a schematic diagram of an exemplary application scenario.
  • n IPCs are connected to the same MEP device via a base station and a core network.
  • each IPC can collect the original image of the target object, then encode the original image into an image frame, and send the image frame to the base station.
  • the base station can send the n image frames sent by IPC to the core network.
  • the UPF (User Plane Function) network element of the core network will send the n image frames sent by IPC.
  • the MEP device can process the n image frames sent by IPC, such as video splicing, FVV video production, etc. This application does not limit this. Subsequently, the MEP device can send the processed image frames to terminal devices such as mobile phones, tablets, etc.
  • Figure 1c is a schematic diagram of an exemplary application scenario.
  • n IPCs are connected to the same MP device through communication satellites.
  • each IPC can collect the original image of the target object, then encode the original image into an image frame, and send the image frame to the communication satellite.
  • the communication satellite After the communication satellite receives n image frames sent by IPC, it can send n image frames sent by IPC to the MP device.
  • the MP device After receiving n image frames sent by IPC, the MP device can process the n images sent by IPC, such as video splicing, FVV video production, etc. This application does not limit this. Subsequently, the MP device can send the processed image frames to terminal devices such as mobile phones, tablets, etc.
  • MP devices and MEP devices may be servers, and the server may refer to a single server or a server cluster (for example, a cloud server, etc.), which is not limited in this application.
  • the IPC can continuously send multiple image frames to the MP device/MEP device.
  • multiple image frames sent continuously can form a video.
  • the image frames can also be called video frames.
  • Figure 1d is a schematic diagram illustrating an exemplary IPC deployment manner. In Figure 1d, the deployment manner of multiple IPCs relative to the target object is shown.
  • the application scenarios using the deployment method shown in Figure 1d(1) can include a variety of applications, such as artistic dance performances, sports competitions, film and television variety shows, Internet celebrity performances, scenic spots, live broadcasts, and exhibition traffic. Movement teaching, etc.
  • the MP device/MEP device performs FVV video production on n image frames sent by IPC, it can provide users with a variety of different viewing angles.
  • Figure 1d(2) is only an example of multiple IPC deployment methods. This application takes the user location as the center and the number of IPCs deployed in a fan shape toward the target object can be greater than that shown in Figure 1d(2). More or less, this application does not limit this.
  • application scenarios using the deployment method of Figure 1d(2) may include a variety of scenarios, such as VR (Virtual Reality, virtual reality) scenarios, AR (Augmented Reality, augmented reality) scenarios, etc.
  • VR Virtual Reality, virtual reality
  • AR Augmented Reality, augmented reality
  • Figure 1e is a schematic structural diagram of an exemplary IPC.
  • an IPC may include a photoreceptor, an image cache, an encoding component, and a communication component. It should be understood that Figure 1e is only an example of the present application, and the IPC may include more components than shown in Figure 1e, which is not limited by this application.
  • an exemplary photoreceptor is a light sensor that receives an optical signal through external exposure and converts it into an electrical signal.
  • the photoreceptor and the image buffer can be connected through a cable, which is photoelectrically converted into image data (hereinafter referred to as the original image) and output to the image buffer in real time.
  • the encoding component can read the original image to be encoded from the image cache according to the preset cycle, encode the original image, and output the image frame; the encoded image frame is packaged in the communication component and sent to the MP device or MEP via the network equipment.
  • interval at which the IPC continuously sends image frames to the MP device/MEP device may be equal to the preset period.
  • MP equipment/MEP equipment Before MP equipment/MEP equipment performs video splicing or FVV video production, it needs to synchronize the frame times of multiple image frames sent by multiple IPCs (that is, synchronize the frame times within the same time period (such as 8:10:22 of the day) 10 milliseconds to 20 milliseconds time period) to ensure that there is no time difference in the pictures captured by multiple image frames in the same group for video splicing or FVV video production.
  • the frame times of multiple image frames sent by multiple IPCs that is, synchronize the frame times within the same time period (such as 8:10:22 of the day) 10 milliseconds to 20 milliseconds time period) to ensure that there is no time difference in the pictures captured by multiple image frames in the same group for video splicing or FVV video production.
  • the frame time of multiple IPCs is not synchronized (that is, the server receives multiple image frames sent by multiple IPCs within the same time period (such as the time period of 8:10:22, 10 milliseconds to 20 milliseconds of the day)
  • the server receives multiple image frames sent by multiple IPCs within the same time period (such as the time period of 8:10:22, 10 milliseconds to 20 milliseconds of the day)
  • different IPC encoding start times that is, the time when the original image to be encoded is read from the image cache for the first time
  • this application proposes a synchronization method. This method sends the time information corresponding to the image frame while the IPC sends the image frame; then, the MP device/MEP device determines based on the time information corresponding to the image frame sent by each IPC.
  • coding adjustment instructions can be sent to some IPCs to trigger some IPCs to adjust their coding, thereby controlling the frame outgoing times of some IPCs, so that multiple IPC outgoing frame time synchronization, thereby achieving frame time synchronization of multiple IPCs.
  • Figure 1f is a schematic structural diagram of an exemplary synchronization component.
  • Figure 1f shows the synchronization component in the server (such as MP device, MEP device), which is used to ensure that the server side implements the synchronization method of the present application.
  • the server such as MP device, MEP device
  • the synchronization component in the MP device may include a time comparison module, a decision-making module and a control module.
  • the time comparison module is used to compare the time information corresponding to the two image frames sent by the two IPCs to determine the time difference;
  • the decision-making module is used to decide whether to send a coding adjustment instruction based on the time difference;
  • the control module is used to send a coding adjustment instruction.
  • Figure 1f is only an example of this application, and the synchronization component may include more or fewer modules than shown in Figure 1f, which is not limited by this application.
  • FIG. 2 is a schematic diagram illustrating an exemplary synchronization process.
  • the number of IPCs is n, and the n IPCs are all connected to the same server.
  • the server can refer to a single server or a server cluster; the server can be an MP device or a MEP device.
  • IPC reads the original image to be encoded.
  • n IPCs may include 1 second IPC and (n-1) first IPCs, where the second IPC is a reference for whether the frame times of the first IPC and the second IPC are synchronized, and the first IPC It is the IPC except the second IPC among the n IPCs.
  • n IPCs may negotiate with each other to determine the first IPC and the second IPC among the n IPCs.
  • the server can determine the first IPC and the second IPC among the n IPCs when starting to synchronize the frame times of multiple IPCs.
  • the server may determine the first IPC and the second IPC among the n IPCs according to preset rules.
  • the preset rules can be set according to requirements, such as random selection, selection according to a preset order, etc. This application does not limit this.
  • these n IPCs can perform system time synchronization. For example, after each IPC is started, it can interact with the time server and then synchronize with the system time of the time server; in this way, the system time of these n IPCs can be synchronized.
  • S201 includes S201a and S201b:
  • the first IPC reads the original image to be encoded.
  • the second IPC reads the original image to be encoded.
  • the photoreceptor in the first IPC can receive the optical signal and convert the optical signal into an electrical signal; and then output the original image obtained through photoelectric conversion to the image cache in real time.
  • the image cache can store multiple frames of the original image.
  • the encoding component is also started; after the encoding component is started, the original image to be encoded can be read from the image cache according to a preset cycle.
  • each of the (n-1) first IPCs can read the original image to be encoded from the corresponding image cache.
  • the encoding component can read a frame of the original image to be encoded from the image cache in a preset cycle.
  • the encoding component in the second IPC can also read the original image to be encoded from the image cache according to a preset cycle.
  • IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
  • S202 includes S202a and S202b:
  • the first IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
  • the second IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
  • the encoding component can encode the original image and output the image frame (that is, the code stream).
  • the encoding method of the original image by the first IPC can be determined according to the requirements.
  • the original image can be encoded by encoding protocols such as H.264, H.265, H.266, etc. This application does not limit this.
  • the encoding component or the communication component can determine the time information corresponding to the image frame.
  • the time information corresponding to the image frame can be used by the server to synchronize the frame times of multiple IPCs.
  • the time information can be used to identify the time.
  • the time information can be a timestamp, which is not limited in this application.
  • the encoding component can determine the time information corresponding to the image frame based on the time when the encoding component reads the original image to be encoded from the image cache. For example, the time when the encoding component reads the original image to be encoded from the image cache can be used as the time information corresponding to the image frame; for another example, the time when the encoding component reads the original image to be encoded from the image cache can be used , the difference from the preset time (such as 0:00:00:10 milliseconds on January 1, 1970) is used as the time information corresponding to the image frame; this application does not limit this.
  • the unit of the time information corresponding to the image frame may be ms (millisecond).
  • the encoding component can determine the time information corresponding to the image frame based on the time when the image frame is obtained by encoding the encoding component.
  • the coding component can be coded to obtain the time of the image frame as the time information corresponding to the image frame; for another example, the coding component can be coded to obtain the difference between the time of the image frame and the preset time as the time information corresponding to the image frame; This application does not limit this.
  • the encoding component can determine the time information corresponding to the image frame based on the time of various encoding steps (such as encoding prediction, quantization, entropy encoding, etc.) performed by the encoding component during the encoding process. For example, the encoding component uses the time when the encoding component starts to perform coding prediction as the time information for determining the image frame correspondence; for another example, the encoding component uses the time when the encoding component starts to perform quantization as the time information for determining the image frame correspondence; and so on. There are no restrictions on applications.
  • the communication component can determine the time information corresponding to the image frame based on the time when the image frame is received. For example, the time when the communication component receives the image frame is used as the time information corresponding to the image frame; for another example, the difference between the time when the communication component receives the image frame and the preset time is used as the time information corresponding to the image frame.
  • any time before sending the image frame to the server can be used as the time information corresponding to the image frame, and this application does not limit this.
  • each of the (n-1) first IPCs can obtain the image frame and the time information corresponding to the image frame.
  • the encoding component of the second IPC can refer to the above method to obtain the image frame and the time information corresponding to the image frame.
  • the IPC sends the image frame and the time information corresponding to the image frame to the server.
  • S203 includes S203a and S203b:
  • S203a The first IPC sends the image frame and time information corresponding to the image frame to the server.
  • S203b The second IPC sends the image frame and time information corresponding to the image frame to the server.
  • each of the (n-1) first IPCs can send the obtained image frame and the time information corresponding to the image frame to the same server.
  • the second IPC may also send the obtained image frame and the time information corresponding to the image frame to the server.
  • the server Based on the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC, the server determines that the frame time of the first IPC and the second IPC are not synchronized, and sends the code to the first IPC. Adjustment instructions.
  • the server can use the time information corresponding to the image frame sent by the second IPC as a reference, and determine whether the frame time of each first IPC and the second IPC is synchronized based on the time information corresponding to the image frame sent by each first IPC. .
  • the server may determine the time difference between the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC. If the time difference is greater than the threshold, it may be determined that the frame times of the first IPC and the second IPC are not synchronized. If the time difference is less than or equal to the threshold, the frame time of the first IPC and the second IPC can be determined. Synchronize.
  • the threshold can be set according to requirements, and this application does not limit this.
  • the server can serially determine whether the frame times of the (n-1) first IPC and the second IPC are synchronized, or it can also determine in parallel the frames of the (n-1) first IPC and the second IPC. Whether the time is synchronized; this application does not limit this.
  • the server determines that the first IPC and the second IPC frame time are not synchronized, the first IPC needs to be synchronized. At this time, a coding adjustment instruction can be generated; and then the coding adjustment Instructions are sent to the first IPC. If the server determines that the first IPC and the second IPC frame time are synchronized, the synchronization adjustment of the first IPC can be ended, and there is no need to generate a coding adjustment instruction at this time.
  • the first IPC performs encoding adjustment according to the encoding adjustment instruction, so that the time for the first IPC to read the original image of the next frame is adjusted.
  • any first IPC can perform encoding adjustment according to the encoding adjustment instruction, so that the first IPC reads the next frame to be processed.
  • the encoding of the original image is adjusted in time. In this way, when it is time to read the next frame of the original image to be encoded, you can return to execute the above-mentioned S201 to S205, and so on until the frame times of (n-1) first IPCs and second IPCs are all synchronized. .
  • the IPC sends a coding adjustment indication (not shown in Figure 2).
  • the frame times of the (n-1) first IPCs and the second IPCs are not synchronized.
  • the server can send coding adjustment instructions to the (n-1) first IPCs (as shown in Figure 2 shown).
  • frame time synchronization with the second IPC may be achieved after receiving a coding adjustment instruction sent by the server once and performing coding adjustment according to the coding adjustment instruction; that is, the The first IPC can achieve frame time synchronization with the second IPC by performing one coding adjustment. It is also possible that frame time synchronization with the second IPC can be achieved only after receiving the encoding adjustment instructions sent multiple times by the server and performing encoding adjustments according to the encoding adjustment instructions sent multiple times; that is, the first IPC performs multiple encoding time adjustments. Only then can frame time synchronization with the second IPC be achieved.
  • the first IPC performs one or more encoding conditions according to the encoding adjustment instructions sent one or more times by the server to adjust the time of reading the next frame of the original image to be encoded one or more times.
  • this application can achieve frame time synchronization between multiple IPCs without using hardware through data interaction between the server and the IPC, and is robust. Good; and can reduce costs and facilitate the deployment of multiple IPCs.
  • Figure 3a is a schematic diagram illustrating an exemplary synchronization process.
  • the coding adjustment indication is a coding control message.
  • IPC reads the original image to be encoded.
  • S301 includes S301a and S301b:
  • the first IPC reads the original image to be encoded.
  • S301b The second IPC reads the original image to be encoded.
  • IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
  • S302 includes S302a and S302b:
  • the first IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
  • S302b The second IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
  • the IPC sends the image frame and the time information corresponding to the image frame to the server.
  • S303 includes S303a and S303b:
  • S303a The first IPC sends the image frame and time information corresponding to the image frame to the server.
  • S303b The second IPC sends the image frame and time information corresponding to the image frame to the server.
  • the first IPC may encapsulate the time information corresponding to the image frame and the image frame together, and then send the encapsulated image frame and the time information corresponding to the image frame to the server.
  • the following takes a first IPC as an example to describe the process of the first IPC sending image frames and time information corresponding to the image frames.
  • Figure 3b is a schematic diagram of the frame structure of an encapsulated image frame.
  • the time information corresponding to the image frame can be encapsulated into the extension field of the image frame; and then the encapsulated image frame is sent to the server.
  • an information header (header) and an extension field can be encapsulated for the image frame; and the time information corresponding to the image frame can be encapsulated in the extension field; as shown in Figure 3b.
  • Figure 3c is a schematic diagram of the frame structure of an encapsulated image frame.
  • this application encapsulates the time information corresponding to the image frame in the extension field of the video coding protocol.
  • the image frame can be first encapsulated according to a video encoding protocol (such as H.264, H.265, H.266 and other encoding protocols); While first encapsulating the image frame according to the video encoding protocol, time information corresponding to the image frame is encapsulated into the first extension field of the image frame.
  • a video encoding protocol such as H.264, H.265, H.266 and other encoding protocols
  • time information corresponding to the image frame is encapsulated into the first extension field of the image frame.
  • the image frame may be encapsulated with the information header (header) of the video encoding protocol (hereinafter referred to as information header 1 (header1)) and the first extension field. (That is, the extension field of the video coding protocol); and the time information corresponding to the image frame is encapsulated in the first extension field; as shown in Figure 3c (1).
  • the time information corresponding to the image frame can be determined based on any time before the image frame is obtained by encoding, such as the time when the encoding component reads the original image to be encoded from the image cache, or various various tasks performed by the encoding component during the encoding process.
  • the time of the encoding step such as the time of encoding the image frame, etc., is not limited in this application.
  • the encoding component can send the first encapsulated image frame to the communication component, and the communication component performs a second encapsulation on the first encapsulated image frame according to the network transmission protocol to obtain a second encapsulated image frame.
  • the first encapsulated image frame may be encapsulated with a header of the network transmission protocol (hereinafter referred to as the information header). 2 (header2)) and the extension field of the network transmission protocol (hereinafter referred to as the second extension field); as shown in Figure 3c(2).
  • the second encapsulated image frame is sent to the server.
  • Figure 3d is a schematic diagram of the frame structure of an encapsulated image frame.
  • this application encapsulates the time information corresponding to the image frame in the extension field of the network transmission protocol.
  • the image frame can be first encapsulated according to the video encoding protocol to obtain the first encapsulated image frame.
  • the image frame may be encapsulated with the information header (header) of the video encoding protocol (hereinafter referred to as information header 1 (header1)) and the first extension field. (That is, the extension field of the video encoding protocol); as shown in Figure 3d(1).
  • the encoding component can send the first encapsulated image frame to the communication component, and the communication component performs a second encapsulation on the first encapsulated image frame according to the network transmission protocol, and performs a third encapsulation on the first encapsulated image frame.
  • the time information corresponding to the image frame is encapsulated into the second extension field of the image frame.
  • the image frame may be encapsulated with a header (header) of the network transmission protocol (hereinafter referred to as header 2 (header2)).
  • the second extension field that is, the extension field of the network transmission protocol
  • the time information corresponding to the image frame is encapsulated in the second extension field; as shown in Figure 3d(2).
  • the second encapsulated image frame is sent to the server.
  • the time information corresponding to the image frame can be determined based on any time before the second encapsulation of the first encapsulated image frame, such as the time when the encoding component reads the original image from the image cache, or the encoding process of the encoding component
  • the time of various coding steps performed in the process such as the time of encoding to obtain the image frame, the time of first encapsulation of the image frame, etc., are not limited by this application.
  • the second IPC may also send the image frame and the time information corresponding to the image frame to the server by encapsulating the time information corresponding to the image frame in the extension field of the image frame in the above manner, which will not be described again here.
  • S304 The server determines whether the first IPC and the second IPC are synchronized based on the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC.
  • S304 may refer to the description of S204 above, which will not be described again here.
  • the time information corresponding to the image frame sent by the first IPC can be compared with the time information corresponding to the image frame sent by the second IPC.
  • the time difference between time information generates a coded control message (Control Message).
  • the encoded control message may include a message header and a time offset field, as shown in Figure 3e.
  • the time offset field is used to carry the offset time.
  • the offset time can be determined based on the time difference between the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC.
  • the offset time may be the time difference obtained by subtracting the time information corresponding to the image frame sent by the first IPC from the time information corresponding to the image frame sent by the first IPC. At this time, the offset time may be a positive number or a negative number.
  • the time information corresponding to the image frame sent by the second IPC is less than the time information corresponding to the image frame sent by the second IPC, then the time information corresponding to the image frame sent by the second IPC is minus the first
  • the time information corresponding to the image frame sent by IPC is a negative number.
  • the sum of the time difference plus the preset period can be calculated, and the sum is used as the offset time.
  • the time information corresponding to the image frame sent by the second IPC is greater than the time information corresponding to the image frame sent by the second IPC, then the time information corresponding to the image frame sent by the second IPC is subtracted from the time information corresponding to the image frame sent by the first IPC.
  • Time information, the resulting time difference is a positive number.
  • the time difference can be used as the offset time. In other words, in this way, the offset times obtained are all positive numbers.
  • the time information corresponding to the image frame sent by the second IPC is greater than the time information corresponding to the image frame sent by the second IPC, then the time information corresponding to the image frame sent by the second IPC is minus the first
  • the time information corresponding to the image frame sent by IPC is a positive number.
  • the time difference minus the preset period can be calculated, and the difference can be used as the offset time.
  • the time information corresponding to the image frame sent by the second IPC is less than the time information corresponding to the image frame sent by the second IPC, then the time information corresponding to the image frame sent by the second IPC is subtracted from the time information corresponding to the image frame sent by the first IPC.
  • Time information, the resulting time difference is a negative number.
  • the time difference can be used as the offset time. In other words, in this way, the offset times obtained are all negative numbers.
  • S306 The first IPC adjusts the time for reading the original image to be encoded in the next frame according to the offset time.
  • the first IPC can parse the encoding control message and obtain the offset time carried in the encoding control message. Then, the first IPC determines the time to read the next frame of the original image to be encoded according to the preset period; then, the time to read the next frame of the original image to be encoded is moved by the offset time. In this way, there will be no time difference between the next image frame sent by the first IPC and the next image frame sent by the second IPC, thereby achieving frame time synchronization between the first IPC and the second IPC.
  • the first IPC after the first IPC receives an encoding control message sent by the server once and adjusts the time to read the original image to be encoded in the next frame according to the offset time in the encoding control message, it can realize communication with the second IPC.
  • Frame time synchronization That is to say, in the embodiment of Figure 3a, for each first IPC, frame time synchronization with the second IPC can be achieved through one encoding adjustment.
  • the time information corresponding to each image frame sent by each IPC is closer to the time when the picture captured by each image frame actually occurred; in this way, The time difference between the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC determined by the server is more accurate, and then the server sends fewer encoding adjustment instructions to the first IPC, and the third
  • the frame time synchronization of the first IPC and the second IPC can be achieved, and the duration of synchronizing the frame time of the first IPC and the second IPC can be reduced.
  • Figure 4 is a schematic diagram illustrating an exemplary synchronization process.
  • the coding adjustment indication is a coding restart message.
  • IPC reads the original image to be encoded.
  • S401 includes S401a and S401b:
  • the first IPC reads the original image to be encoded.
  • S401b The second IPC reads the original image to be encoded.
  • IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
  • S402 includes S402a and S402b:
  • the first IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
  • the second IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
  • the IPC sends the image frame and the time information corresponding to the image frame to the server.
  • S403 includes S403a and S403b:
  • S403a The first IPC sends the image frame and time information corresponding to the image frame to the server.
  • S403b The second IPC sends the image frame and time information corresponding to the image frame to the server.
  • S403 may refer to the description of S303 above, which will not be described again here.
  • S404 The server determines whether the first IPC and the second IPC are synchronized based on the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC.
  • S404 may refer to the description of S204 above, which will not be described again here.
  • the encoding restart message (Restart Message) is used to trigger the first IPC to restart encoding, that is, to restart the encoding component.
  • S406 The first IPC performs encoding restart according to the encoding restart message.
  • the first IPC can restart the encoding component; after the encoding component restarts successfully, it can start to obtain the next frame of original image to be encoded from the image cache, and then execute the above S402-S403. In this way, the time for the first IPC to read the next frame of the original image to be encoded from the image cache is adjusted to the encoding restart success time.
  • one situation may be that after the first IPC restarts encoding, the time when it reads the next frame of the original image to be encoded from the image cache is the same as the time when the second IPC reads the next frame from the image cache.
  • the time of the original image to be encoded is the same; in this way, after the first IPC completes S401a to S403a again, and the second IPC completes S401b to S403b again, the server can receive the next image frame and image frame sent by the first IPC
  • the corresponding time information, as well as the next image frame sent by the second IPC and the time information corresponding to the image frame, and the frame time synchronization of the first IPC and the second IPC can be determined without generating a coding restart message.
  • the first IPC can achieve frame time synchronization with the second IPC after a coding restart.
  • One situation may be that after the first IPC restarts encoding, the time when it reads the next frame of the original image to be encoded from the image cache is the same as the time when the second IPC reads the next frame of the original image to be encoded from the image cache. The times are still different; in this way, after the first IPC finishes executing S401a ⁇ S403a again, and the second IPC finishes executing S401b ⁇ S403b again, the server can receive the next image frame and the time corresponding to the image frame sent by the first IPC information, as well as the next image frame and the time information corresponding to the image frame sent by the second IPC; and it can be determined that the frame time of the first IPC and the second IPC is not synchronized.
  • the server can send the encoding restart message to the first IPC again. , and then the first IPC performs coding restart according to the coding restart message again. This cycle repeats until the frame times of the first IPC and the second IPC are synchronized. In other words, the first IPC needs to undergo multiple encoding restarts before it can achieve frame time synchronization with the second IPC.
  • the first IPC needs to undergo one or more encoding restarts before it can achieve frame time synchronization with the second IPC.
  • Figure 5 is a schematic diagram illustrating an exemplary synchronization process.
  • the encoding adjustment indication is a encoding refresh message.
  • S501 includes S501a and S501b:
  • the first IPC reads the original image to be encoded.
  • the second IPC reads the original image to be encoded.
  • IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
  • S502 includes S502a and S502b:
  • the first IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
  • S502b The second IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
  • the IPC sends the image frame and the time information corresponding to the image frame to the server.
  • S503 includes S503a and S503b:
  • S503a The first IPC sends the image frame and time information corresponding to the image frame to the server.
  • S503b The second IPC sends the image frame and time information corresponding to the image frame to the server.
  • S503 may refer to the description of S303 above, which will not be described again here.
  • S504 The server determines whether the first IPC and the second IPC are synchronized based on the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC.
  • S504 may refer to the description of S204 above, which will not be described again here.
  • the encoding refresh message (Refresh Messgae) is used to trigger the first IPC to perform frame refresh, and is also used to trigger the encoding component in the first IPC to perform frame refresh.
  • S506 The first IPC performs frame refresh according to the coding refresh message.
  • the first IPC can trigger the encoding component to perform frame refresh, that is, trigger the encoding component to immediately encode an image frame.
  • the encoding component can immediately obtain the next frame to be encoded from the image cache. original image, and then execute the above S502 ⁇ S503. In this way, the time when the first IPC reads the next frame of the original image to be encoded from the image buffer is adjusted to the current time.
  • one situation may be that after the first IPC performs this encoding refresh, the time when it reads the next frame of the original image to be encoded from the image cache is the same as the time when the second IPC reads the next frame from the image cache.
  • the time of the original image to be encoded is the same; in this way, after the first IPC completes S501a ⁇ S503a again, and the second IPC completes S501b ⁇ S503b again, the server can receive the next image frame and image frame sent by the first IPC
  • the corresponding time information, as well as the next image frame sent by the second IPC and the time information corresponding to the image frame can be determined, and the frame time synchronization of the first IPC and the second IPC can be determined without generating a coding refresh message.
  • the first IPC can achieve frame time synchronization with the second IPC after one frame refresh.
  • One situation may be that after the first IPC performs this encoding refresh, the time when it reads the next frame of original image to be encoded from the image cache is the same as the time when the second IPC reads the next frame of original image to be encoded from the image cache. The times are still different; in this way, after the first IPC finishes executing S501a ⁇ S503a again, and the second IPC finishes executing S501b ⁇ S503b again, the server can receive the next image frame and the time corresponding to the image frame sent by the first IPC information, as well as the next image frame sent by the second IPC and the time information corresponding to the image frame; and it can be determined that the frame time of the first IPC and the second IPC is not synchronized.
  • the server can send a coding refresh message to the first IPC again. , and then the first IPC performs encoding refresh according to the encoding refresh message again. This cycle repeats until the frame times of the first IPC and the second IPC are synchronized. In other words, the first IPC can achieve frame time synchronization with the second IPC after multiple frame refreshes.
  • the first IPC needs one or more frame refreshes to achieve frame time synchronization with the second IPC.
  • the existing IPC has a coding restart function and a coding refresh function, so S406 in the embodiment of FIG. 4 and S506 in the embodiment of FIG. 5 can be executed.
  • multiple IPCs cooperate with the server according to the steps in the embodiment of Figure 4, or cooperate with the server according to the steps in the embodiment of Figure 5, so that frame time synchronization can be achieved.
  • the server can periodically synchronize the frame times of multiple IPCs according to a set time period.
  • the set time period can be set according to requirements and can be greater than the preset period. This application does not limit this.
  • Figure 6 is a schematic diagram of an exemplary synchronization system.
  • the synchronization system in Figure 6 may include multiple IPCs and servers.
  • the multiple IPCs may include at least a first IPC and a second IPC.
  • the second IPC is a combination of the first IPC and the second IPC. Reference for frame time synchronization; where,
  • the first IPC is used to read the first original image to be encoded; encode the first original image into a first image frame, and determine the time information corresponding to the first image frame; send the first image frame and the first image to the server Time information corresponding to the frame; and receiving coding adjustment instructions; performing coding adjustments according to the coding adjustment instructions;
  • the second IPC is used to read the second original image to be encoded; encode the second original image into a second image frame, and determine the time information corresponding to the second image frame; send the second image frame and the second image to the server The time information corresponding to the frame;
  • the server is configured to receive the first image frame sent by the first IPC and the time information corresponding to the first image frame, and to receive the second image frame sent by the second IPC and the time information corresponding to the second image frame; when according to the first IPC
  • a coding adjustment instruction is sent to the first IPC.
  • the server is configured to send a coding control message to the first IPC; wherein the coding control message includes an offset time, and the offset time is based on the time information corresponding to the first image frame sent by the first IPC, and is different from the time information sent by the second IPC. The time difference between the time information corresponding to the second image frame is determined; the encoding control message is used to trigger the first IPC to adjust the time to obtain the first original image to be encoded in the next frame according to the offset time.
  • the server is configured to send an encoding restart message to the first IPC, and the encoding restart message is used to trigger the first IPC to restart encoding.
  • the server is configured to send a coding refresh message to the first IPC, and the coding refresh message is used to trigger the first IPC to refresh the frame.
  • the time difference between the synchronization time information corresponding to the first image frame sent by the first IPC and the synchronization time information corresponding to the second image frame sent by the second IPC is greater than the threshold, it is determined that the first IPC and the second The frame time of IPC is not synchronized.
  • the first IPC is used to determine the time information corresponding to the first image frame based on the time when the first original image to be encoded is read.
  • the first IPC is used to encapsulate the time information corresponding to the first image frame into an extension field of the first image frame, and send the encapsulated first image frame.
  • the coding adjustment indication is a coding control message
  • the coding control message includes an offset time.
  • the offset time is based on the time information corresponding to the first image frame sent by the first IPC and the time corresponding to the second image frame sent by the second IPC. The time difference between the information is determined; the first IPC is used to adjust the time to read the first original image to be encoded in the next frame according to the offset time.
  • the coding adjustment indication is a coding restart message; the first IPC is used to restart coding according to the coding restart message.
  • the coding adjustment indication is a coding refresh message
  • the first IPC is used to refresh the frame according to the coding refresh message.
  • the second IPC is used to determine the time information corresponding to the second image frame based on the time when the second original image to be encoded is read.
  • the second IPC is used to encapsulate the time information corresponding to the second image frame into an extension field of the second image frame, and send the encapsulated second image frame.
  • FIG. 7 shows a schematic block diagram of a device 700 according to an embodiment of the present application.
  • the device 700 may include: a processor 701 and a transceiver/transceiver pin 702, and optionally, a memory 703.
  • bus 704 includes, in addition to a data bus, a power bus, a control bus, and a status signal bus.
  • bus 704 includes, in addition to a data bus, a power bus, a control bus, and a status signal bus.
  • various buses are referred to as bus 704 in the figure.
  • the memory 703 may be used to store instructions in the foregoing method embodiments.
  • the processor 701 can be used to execute instructions in the memory 703, and control the receiving pin to receive signals, and control the transmitting pin to send signals.
  • the device 700 may be the electronic device or a chip of the electronic device in the above method embodiment.
  • This embodiment also provides a computer-readable storage medium.
  • Computer instructions are stored in the computer-readable storage medium.
  • the electronic device causes the electronic device to execute the above-mentioned related method steps to implement the above-mentioned embodiments. sync method.
  • This embodiment also provides a computer program product.
  • the computer program product When the computer program product is run on a computer, it causes the computer to perform the above related steps to implement the synchronization method in the above embodiment.
  • inventions of the present application also provide a device.
  • This device may be a chip, a component or a module.
  • the device may include a connected processor and a memory.
  • the memory is used to store computer execution instructions.
  • the processor can execute computer execution instructions stored in the memory, so that the chip executes the synchronization method in each of the above method embodiments.
  • the electronic devices, computer-readable storage media, computer program products or chips provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the above provided The beneficial effects of the corresponding methods will not be described again here.
  • the disclosed devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or can be integrated into another device, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • a unit described as a separate component may or may not be physically separate.
  • a component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place, or it may be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in various embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software functional units.
  • Integrated units may be stored in a readable storage medium if they are implemented in the form of software functional units and sold or used as independent products.
  • the technical solutions of the embodiments of the present application are essentially or contribute to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium , including several instructions to cause a device (which can be a microcontroller, a chip, etc.) or a processor to execute all or part of the steps of the methods of various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code.
  • the steps of the methods or algorithms described in connection with the disclosure of the embodiments of this application can be implemented in hardware or by a processor executing software instructions.
  • Software instructions can be composed of corresponding software modules.
  • Software modules can be stored in random access memory (Random Access Memory, RAM), flash memory, read only memory (Read Only Memory, ROM), erasable programmable read only memory ( Erasable Programmable ROM (EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), register, hard disk, removable hard disk, compact disc (CD-ROM) or any other form of storage media well known in the art.
  • An exemplary storage medium is coupled to the processor such that the processor can read information from the storage medium and write information to the storage medium.
  • the storage medium can also be an integral part of the processor.
  • the processor and storage media may be located in an ASIC.
  • Computer-readable media includes computer-readable storage media and communication media including any medium that facilitates transfer of a computer program from one place to another.
  • Storage media can be any available media that can be accessed by a general purpose or special purpose computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

Provided in the embodiments of the present application are a synchronization method, a system, and an electronic device. The method comprises: a server receives image frames sent by a plurality of IPCs and time information corresponding to the image frames, the image frames being obtained by encoding original images, and the plurality of IPCs comprising a first IPC and a second IPC; and when determining that the first IPC and the second IPC are asynchronous in frame time according to the time information corresponding to the image frames sent by the first IPC and the time information corresponding to the image frames sent by the second IPC, sending an encoding adjustment instruction to the first IPC, wherein the encoding adjustment instruction is used for triggering the first IPC to perform encoding adjustment, so as to adjust the time of the first IPC reading a next frame of an original image to be encoded. Thus, frame time synchronization of a plurality of IPCs is realized by data interaction between a server and the IPCs. Compared with the prior art, the present application does not need hardware, thus achieving good robustness, reducing the cost, and facilitating deployment of a plurality of IPCs.

Description

同步方法、系统及电子设备Synchronization method, system and electronic device
本申请要求于2022年07月26日提交中国国家知识产权局、申请号为202210883502.8、申请名称为“同步方法、系统及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application submitted to the State Intellectual Property Office of China on July 26, 2022, with application number 202210883502.8 and the application name "Synchronization Method, System and Electronic Device", the entire content of which is incorporated herein by reference. Applying.
技术领域Technical field
本申请实施例涉及通信领域,尤其涉及一种同步方法、系统及电子设备。Embodiments of the present application relate to the field of communications, and in particular, to a synchronization method, system and electronic device.
背景技术Background technique
IPC(IP Camera,网络摄像机)一般通过网络与服务器(如MP(Media Process,媒体处理端)设备,MEP(Multi-access Edge Platform,多接入边缘平台)设备等)连接。通常,由多个IPC采集原始图像并将原始图像编码成图像帧后发送给服务器;然后由服务器分别从各IPC发送的图像帧中选取一个图像帧,进行视频拼接和FVV(Free-Viewpoint Video,自由视角视频)视频制作等处理。IPC (IP Camera) is generally connected to servers (such as MP (Media Process, media processing terminal) equipment, MEP (Multi-access Edge Platform, multi-access edge platform) equipment, etc.) through the network. Usually, multiple IPCs collect original images and encode the original images into image frames and send them to the server; then the server selects one image frame from the image frames sent by each IPC for video splicing and FVV (Free-Viewpoint Video, Free-angle video) video production and other processing.
由于不同IPC编码启动时间可能不一致,这会导致不同IPC出帧时间会有差异,进而导致服务器在同一时间段内(如同一天的8点10分22秒10毫秒~20毫秒这个时间段)接收到的多个IPC发送的多个图像帧所拍摄的画面会有时间差(即帧时间差),也就是多个IPC的帧时间不同步;从而导致拼接后的图像中,来自不同IPC的图像帧连接处的画面出现顿挫、不流畅等问题。Since the startup time of different IPC encodings may be inconsistent, this will lead to differences in the frame outgoing times of different IPCs, which will cause the server to receive frames within the same time period (such as the time period of 8:10:22, 10 milliseconds to 20 milliseconds of the day). The pictures captured by multiple image frames sent by multiple IPCs will have time differences (i.e. frame time differences), that is, the frame times of multiple IPCs are not synchronized; thus, in the spliced image, the connection points of image frames from different IPCs There are problems such as frustration and unsmoothness in the screen.
为了解决多个IPC的帧时间不同步的问题,现有技术采用数据线将两两IPC连接,然后由硬件控制电路控制IPC的编码出视频帧时间,使所有的IPC出视频帧时间一致,实现帧时间同步。采用硬件实现多个IPC的帧时间同步的缺点在于,需要额外硬件,成本高;且采用数据线连接,不利于IPC部署;此外,如果硬件线接触不良,会导致帧时间不同步,鲁棒性差等等。In order to solve the problem of unsynchronized frame times of multiple IPCs, the existing technology uses data lines to connect two IPCs, and then the hardware control circuit controls the encoded video frame time of the IPCs so that all IPCs output video frame times are consistent. Frame time synchronization. The disadvantage of using hardware to achieve frame time synchronization of multiple IPCs is that it requires additional hardware and is costly; and the use of data lines to connect is not conducive to IPC deployment; in addition, if the hardware line contact is poor, it will cause the frame time to be out of synchronization and have poor robustness. etc.
发明内容Contents of the invention
为了解决上述技术问题,本申请提供一种同步方法、系统及电子设备。在该方法中,无需借助硬件,通过服务器与IPC之间的数据交互,即可实现多个IPC之间的帧时间同步,鲁棒性好;且能够降低成本,便于多个IPC的部署。In order to solve the above technical problems, this application provides a synchronization method, system and electronic device. In this method, frame time synchronization between multiple IPCs can be achieved without resorting to hardware through data interaction between the server and the IPC. It has good robustness and can reduce costs and facilitate the deployment of multiple IPCs.
第一方面,本申请实施例提供一种同步方法,该方法包括:首先,服务器接收多个网络摄像机IPC发送的图像帧,以及图像帧对应的时间信息,其中,图像帧是通过对原始图像进行编码得到,多个IPC包括第一IPC和第二IPC,第二IPC是第一IPC与第二IPC的帧时间是否同步的参考;接着,当服务器根据第一IPC发送的图像帧对应的时间信息,以及第二IPC发送的图像帧对应的时间信息,确定第一IPC与第二IPC的帧时间不同步时,服务器向第一IPC发送编码调整指示,编码调整指示用于触发第一IPC进行编码调整,以使第一IPC读取下一帧待编码的原始图像的时间发生调整。这样,服务器通过一次或多次向第一IPC发送编码调整指示,来触发第一IPC进行一次或多次编码调整,使得第一IPC一次或多次读取下一帧待编码的原始图像的时间发生调整,进而实现第一IPC与第二IPC的出帧时间同步;从而避免服务器在同一时间段内接收到的多个图像帧所拍摄的画面出现时间差,实现多个IPC的帧时间同步。In the first aspect, embodiments of the present application provide a synchronization method. The method includes: first, the server receives image frames sent by multiple network cameras IPC, and time information corresponding to the image frames, where the image frames are obtained by processing the original images. From the encoding, the multiple IPCs include the first IPC and the second IPC. The second IPC is a reference for whether the frame times of the first IPC and the second IPC are synchronized; then, when the server sends time information based on the image frame sent by the first IPC , and the time information corresponding to the image frame sent by the second IPC. When it is determined that the frame time of the first IPC and the second IPC is not synchronized, the server sends a coding adjustment instruction to the first IPC. The coding adjustment instruction is used to trigger the first IPC to perform encoding. Adjust so that the time for the first IPC to read the next frame of the original image to be encoded is adjusted. In this way, the server triggers the first IPC to perform one or more encoding adjustments by sending encoding adjustment instructions to the first IPC one or more times, so that the first IPC reads the time of the next frame of the original image to be encoded one or more times. The adjustment occurs to achieve synchronization of the frame time of the first IPC and the second IPC; thereby avoiding time differences in the pictures captured by multiple image frames received by the server in the same time period, and achieving frame time synchronization of multiple IPCs.
相对于现有技术借助硬件进行多个IPC的帧时间同步而言,本申请无需借助硬件,通过服务器与IPC之间的数据交互,即可实现多个IPC之间的帧时间同步,鲁棒性好;且能够降低成本,便于多个IPC的部署。Compared with the existing technology that uses hardware to synchronize the frame time of multiple IPCs, this application can achieve frame time synchronization between multiple IPCs without using hardware through data interaction between the server and the IPC, and is robust. Good; and can reduce costs and facilitate the deployment of multiple IPCs.
示例性的,多个IPC包括至少一个第一IPC和一个第二IPC。Exemplarily, the plurality of IPCs include at least a first IPC and a second IPC.
示例性的,原始图像可以是指IPC的感光器采集的图像,也就是RAW(未加工)图像。For example, the original image may refer to an image collected by the photoreceptor of the IPC, that is, a RAW (unprocessed) image.
示例性的,服务器可以是指单个服务器,也可以是指服务器集群(如云服务器),本申请对此不 作限制。例如,服务器可以是MP设备、MEP设备等。For example, the server may refer to a single server or a server cluster (such as a cloud server). This application does not make restrictions. For example, the server can be an MP device, a MEP device, etc.
示例性的,图像帧也可以称为码流。For example, an image frame may also be called a code stream.
示例性的,图像帧可以是视频帧。For example, the image frame may be a video frame.
根据第一方面,服务器向第一IPC发送编码调整指示,包括:服务器向第一IPC发送编码控制消息;其中,编码控制消息包括偏移时间,偏移时间是服务器依据第一IPC发送的图像帧对应的时间信息,与第二IPC发送的图像帧对应的时间信息之间的时间差确定的;编码控制消息用于触发第一IPC根据偏移时间对获取下一帧待编码的原始图像的时间进行调整。这样,当第一IPC接收到编码控制消息后,可以将获取下一帧待编码的原始图像的时间移动编码控制消息中的偏移时间;进而第一IPC通过一次编码调整,即可以实现与第二IPC的帧时间同步。According to the first aspect, the server sends a coding adjustment instruction to the first IPC, including: the server sends a coding control message to the first IPC; wherein the coding control message includes an offset time, and the offset time is an image frame sent by the server according to the first IPC The corresponding time information is determined by the time difference between the time information corresponding to the image frame sent by the second IPC; the encoding control message is used to trigger the first IPC to obtain the next frame of the original image to be encoded based on the offset time. Adjustment. In this way, when the first IPC receives the encoding control message, it can move the time to obtain the next frame of the original image to be encoded by the offset time in the encoding control message; and then the first IPC can achieve the same result as the first IPC through one encoding adjustment. Two IPC frame time synchronization.
示例性的,偏移时间可以是第一IPC发送的图像帧对应的时间信息,与第二IPC发送的图像帧对应的时间信息之间的时间差。For example, the offset time may be the time difference between the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC.
示例性的,偏移时间可以是第一IPC发送的图像帧对应的时间信息,和第二IPC发送的图像帧对应的时间信息之间的时间差,与预设周期之间的和值或差值。其中,预设周期可以是指预设的编码周期如30ms,具体可以按照需求设置,本申请对此不作限制。For example, the offset time may be the time difference between the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC, and the sum or difference between the preset period. . The preset period may refer to a preset encoding period such as 30 ms, which can be specifically set according to requirements, and this application does not limit this.
根据第一方面,或者以上第一方面的任意一种实现方式,服务器向第一IPC发送编码调整指示,包括:服务器向第一IPC发送编码重启消息,编码重启消息用于触发第一IPC进行编码重启。这样,当第一IPC接收编码重启消息后,可以进行编码重启;待编码重启成功后,可以读取下一帧待编码的原始图像进行编码;进而使得第一IPC读取下一帧待编码的原始图像的时间发生调整。这种情况下,第一IPC通过一次或多次编码重启,即可实现与第二IPC的帧时间同步。According to the first aspect, or any implementation of the above first aspect, the server sends an encoding adjustment instruction to the first IPC, including: the server sends an encoding restart message to the first IPC, and the encoding restart message is used to trigger the first IPC to perform encoding. Restart. In this way, when the first IPC receives the encoding restart message, the encoding can be restarted; after the encoding restart is successful, the next frame of the original image to be encoded can be read and encoded; in turn, the first IPC can read the next frame of the original image to be encoded. The timing of the original image is adjusted. In this case, the first IPC can achieve frame time synchronization with the second IPC through one or more encoding restarts.
根据第一方面,或者以上第一方面的任意一种实现方式,服务器向第一IPC发送编码调整指示,包括:服务器向第一IPC发送编码刷新消息,编码刷新消息用于触发第一IPC进行帧刷新。这样,当第一IPC接收编码刷新消息后,可以进行帧刷新即开始下一次编码,也就会读取下一帧待编码的原始图像,并对下一帧待编码的原始图像进行编码,进而使得第一IPC读取下一帧待编码的原始图像的时间发生调整。这种情况下,第一IPC通过一次或多次帧刷新,即可实现与第二IPC的帧时间同步。According to the first aspect, or any implementation of the above first aspect, the server sends a coding adjustment instruction to the first IPC, including: the server sends a coding refresh message to the first IPC, and the coding refresh message is used to trigger the first IPC to frame refresh. In this way, when the first IPC receives the encoding refresh message, it can refresh the frame and start the next encoding. It will also read the original image to be encoded in the next frame, and encode the original image to be encoded in the next frame. This causes the time for the first IPC to read the next frame of the original image to be encoded to be adjusted. In this case, the first IPC can achieve frame time synchronization with the second IPC through one or more frame refreshes.
根据第一方面,或者以上第一方面的任意一种实现方式,确定第一IPC与第二IPC的帧时间不同步,包括:服务器确定第一IPC发送的图像帧对应的同步时间信息,和第二IPC发送的图像帧对应的同步时间信息之间的时间差大于阈值。According to the first aspect, or any implementation of the above first aspect, determining that the frame time of the first IPC and the second IPC is not synchronized includes: the server determines synchronization time information corresponding to the image frame sent by the first IPC, and The time difference between the synchronization time information corresponding to the image frames sent by the two IPCs is greater than the threshold.
示例性的,当第一IPC发送的图像帧对应的同步时间信息,和第二IPC发送的图像帧对应的同步时间信息之间的时间差小于或等于阈值时,可以确定第一IPC与第二IPC的帧时间同步。For example, when the time difference between the synchronization time information corresponding to the image frame sent by the first IPC and the synchronization time information corresponding to the image frame sent by the second IPC is less than or equal to the threshold, it can be determined that the first IPC and the second IPC Frame time synchronization.
根据第一方面,或者以上第一方面的任意一种实现方式,多个IPC中各IPC发送的图像帧对应的时间信息,为各IPC读取下一帧待编码的原始图像的时间。这样,各IPC发送的各图像帧对应的时间信息,更接近各图像帧拍摄的画面真正发生时间,使得服务器确定的第一IPC发送的图像帧对应的时间信息与第二IPC发送的图像帧对应的时间信息之间的时间差更准确,进而服务器向第一IPC发送更少次数的编码调整指示,即可实现第一IPC与第二IPC的帧时间同步,减少同步第一IPC与第二IPC的帧时间的时长。According to the first aspect, or any implementation of the above first aspect, the time information corresponding to the image frame sent by each IPC in the plurality of IPCs is the time for each IPC to read the next frame of the original image to be encoded. In this way, the time information corresponding to each image frame sent by each IPC is closer to the actual time of the picture captured by each image frame, so that the time information corresponding to the image frame sent by the first IPC determined by the server corresponds to the image frame sent by the second IPC The time difference between the time information is more accurate, and the server sends fewer encoding adjustment instructions to the first IPC, which can achieve frame time synchronization between the first IPC and the second IPC and reduce the time required to synchronize the first IPC and the second IPC. The duration of the frame time.
第二方面,本申请实施例提供一种同步方法,该方法包括:首先,第一IPC读取待编码的原始图像;接着,第一IPC将原始图像编码为图像帧,以及第一IPC确定图像帧对应的时间信息;随后,第一IPC发送图像帧和图像帧对应的时间信息。之后,第一IPC可以接收编码调整指示,编码调整指示是服务器根据第一IPC发送的图像帧对应的时间信息以及第二IPC发送的图像帧对应的时间信息,确 定第一IPC与第二IPC的帧时间不同步时生成并发送的,第二IPC是第一IPC与第二IPC的帧时间是否同步的参考;然后,第一IPC根据编码调整指示进行编码调整,以使第一IPC读取下一帧待编码的原始图像的时间发生调整。这样,第一IPC通过根据服务器一次或多个发送的编码调整指示,进行一次或多次编码调整,以使一次或多次读取下一帧待编码的原始图像的时间发生调整,来实现与第二IPC的出帧时间同步;从而避免服务器在同一时间段内接收到的多个图像帧所拍摄的画面出现时间差,实现多个IPC的帧时间同步。In the second aspect, embodiments of the present application provide a synchronization method. The method includes: first, the first IPC reads the original image to be encoded; then, the first IPC encodes the original image into an image frame, and the first IPC determines the image Time information corresponding to the frame; subsequently, the first IPC sends the image frame and time information corresponding to the image frame. After that, the first IPC can receive the encoding adjustment instruction. The encoding adjustment instruction is based on the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC. It is generated and sent when the frame time of the first IPC and the second IPC is not synchronized. The second IPC is a reference for whether the frame time of the first IPC and the second IPC is synchronized; then, the first IPC performs coding adjustment according to the coding adjustment instruction. , so that the time for the first IPC to read the next frame of the original image to be encoded is adjusted. In this way, the first IPC implements one or more encoding adjustments according to one or more encoding adjustment instructions sent by the server, so that the time to read the next frame of the original image to be encoded is adjusted one or more times to achieve the same goal. The outgoing frame time of the second IPC is synchronized; thereby avoiding time differences in pictures captured by multiple image frames received by the server within the same time period, and achieving frame time synchronization of multiple IPCs.
相对于现有技术借助硬件进行多个IPC的帧时间同步而言,本申请无需借助硬件,通过服务器与IPC之间的数据交互,即可实现多个IPC之间的帧时间同步,鲁棒性好;且能够降低成本,便于多个IPC的部署。Compared with the existing technology that uses hardware to synchronize the frame time of multiple IPCs, this application can achieve frame time synchronization between multiple IPCs without using hardware through data interaction between the server and the IPC, and is robust. Good; and can reduce costs and facilitate the deployment of multiple IPCs.
示例性的,第二IPC可以执行如下步骤:首先,第二IPC读取待编码的原始图像;接着,第二IPC将原始图像编码为图像帧,以及第二IPC确定图像帧对应的时间信息;随后,第二IPC发送图像帧和图像帧对应的时间信息。For example, the second IPC can perform the following steps: first, the second IPC reads the original image to be encoded; then, the second IPC encodes the original image into an image frame, and the second IPC determines the time information corresponding to the image frame; Subsequently, the second IPC sends the image frame and time information corresponding to the image frame.
示例性的,原始图像可以是指IPC的感光器采集的图像,也就是RAW(未加工)图像。For example, the original image may refer to an image collected by the photoreceptor of the IPC, that is, a RAW (unprocessed) image.
示例性的,图像帧也可以称为码流。For example, an image frame may also be called a code stream.
示例性的,图像帧可以是视频帧。For example, the image frame may be a video frame.
根据第二方面,第一IPC确定图像帧对应的时间信息,包括:第一IPC依据读取待编码的原始图像的时间,确定图像帧对应的时间信息。这样,各IPC发送的各图像帧对应的时间信息,更接近各图像帧拍摄的画面真正发生的时间,使得服务器确定的第一IPC发送的图像帧对应的时间信息与第二IPC发送的图像帧对应的时间信息之间的时间差更准确,进而第一IPC执行更少次数的编码调整即可实现与第二IPC的帧时间同步,减少同步第一IPC与第二IPC的帧时间的时长。According to the second aspect, the first IPC determines the time information corresponding to the image frame, including: the first IPC determines the time information corresponding to the image frame based on the time when the original image to be encoded is read. In this way, the time information corresponding to each image frame sent by each IPC is closer to the time when the picture captured by each image frame actually occurred, so that the time information corresponding to the image frame sent by the first IPC determined by the server is consistent with the image frame sent by the second IPC. The time difference between the corresponding time information is more accurate, and the first IPC performs fewer encoding adjustments to achieve frame time synchronization with the second IPC, reducing the length of time to synchronize the frame time of the first IPC and the second IPC.
需要说明的是,时间信息可以依据发送图像帧之前的任一时间确定,例如,依据读取到原始图像的时间,确定图像帧对应的时间信息。又例如,依据编码得到图像帧的时间,确定图像帧对应的时间信息。还例如,依据在编码过程中执行的各种编码步骤(如编码预测、量化、熵编码等)的时间,确定图像帧对应的时间信息;等等,本申请对此不作限制。It should be noted that the time information can be determined based on any time before the image frame is sent. For example, the time information corresponding to the image frame can be determined based on the time when the original image is read. For another example, the time information corresponding to the image frame is determined based on the time at which the image frame is obtained by encoding. For example, the time information corresponding to the image frame is determined based on the time of various coding steps (such as coding prediction, quantization, entropy coding, etc.) performed during the coding process; etc., this application does not limit this.
根据第二方面,或者以上第二方面的任意一种实现方式,第一IPC发送图像帧和图像帧对应的时间信息,包括:第一IPC将图像帧对应的时间信息封装至图像帧的扩展字段中,发送封装后的图像帧。According to the second aspect, or any implementation of the above second aspect, the first IPC sends the image frame and the time information corresponding to the image frame, including: the first IPC encapsulates the time information corresponding to the image frame into the extension field of the image frame , send the encapsulated image frame.
示例性的,第一IPC可以按照视频编码协议对图像帧进行第一封装,并在按照视频编码协议封装图像帧时,将时间信息封装至图像帧的第一扩展字段(也就是视频编码协议的扩展字段)中。然后,第一IPC按照网络传输协议对第一封装后的图像帧进行第二封装,以及发送第二封装后的图像帧。For example, the first IPC may first encapsulate the image frame according to the video encoding protocol, and when encapsulating the image frame according to the video encoding protocol, encapsulate the time information into the first extension field of the image frame (that is, the first extension field of the video encoding protocol). extension field). Then, the first IPC performs a second encapsulation on the first encapsulated image frame according to the network transmission protocol, and sends the second encapsulated image frame.
示例性的,第一IPC可以按照视频编码协议对图像帧进行第一封装;然后,按照网络传输协议对第一封装后的图像帧进行第二封装,并在按照网络传输协议封装图像帧时,将时间信息封装至图像帧的第二扩展字段(也就是网络传输协议的扩展字段)中;第一IPC再发送第二封装后的图像帧。For example, the first IPC can perform the first encapsulation of the image frame according to the video encoding protocol; then, perform the second encapsulation of the first encapsulated image frame according to the network transmission protocol, and when encapsulating the image frame according to the network transmission protocol, The time information is encapsulated into the second extension field of the image frame (that is, the extension field of the network transmission protocol); the first IPC then sends the second encapsulated image frame.
根据第二方面,或者以上第二方面的任意一种实现方式,编码调整指示为编码控制消息,编码控制消息包括偏移时间,偏移时间是服务器依据第一IPC发送的图像帧对应的时间信息与第二IPC发送的图像帧对应的时间信息之间的时间差确定的;第一IPC根据编码调整指示进行编码调整,包括:第一IPC根据偏移时间对读取下一帧待编码的原始图像的时间进行调整。这样,第一IPC通过一次编码调整,即可以实现与第二IPC的帧时间同步。According to the second aspect, or any implementation of the second aspect above, the encoding adjustment indication is a encoding control message, the encoding control message includes an offset time, and the offset time is time information corresponding to the image frame sent by the server based on the first IPC. The time difference between the time information corresponding to the image frame sent by the second IPC is determined; the first IPC performs encoding adjustment according to the encoding adjustment instruction, including: the first IPC reads the original image to be encoded in the next frame according to the offset time time to adjust. In this way, the first IPC can achieve frame time synchronization with the second IPC through one encoding adjustment.
根据第二方面,或者以上第二方面的任意一种实现方式,编码调整指示为编码重启消息,第一IPC根据编码调整指示进行编码调整,包括:第一IPC根据编码重启消息进行编码重启。由于第一IPC进行编码重启后会立即进行编码,因此待编码重启成功后,可以读取下一帧待编码的原始图像,然后对下一帧待编码的图像进行编码。进而这种方式,也可以使得第一IPC读取下一帧待编码的原始图像的 时间发生调整,即可以使得第一IPC读取下一帧待编码的原始图像的时间调整为编码重启成功时间。这种情况下,第一IPC通过一次或多次编码重启,即可实现与第二IPC的帧时间同步。According to the second aspect, or any implementation of the above second aspect, the encoding adjustment indication is a encoding restart message, and the first IPC performs encoding adjustment according to the encoding adjustment instruction, including: the first IPC performs encoding restart according to the encoding restart message. Since the first IPC will perform encoding immediately after restarting encoding, after the encoding restarts successfully, the next frame of the original image to be encoded can be read, and then the next frame of the image to be encoded can be encoded. In this way, the first IPC can also read the original image to be encoded in the next frame. The time is adjusted, that is, the time for the first IPC to read the next frame of the original image to be encoded can be adjusted to the encoding restart success time. In this case, the first IPC can achieve frame time synchronization with the second IPC through one or more encoding restarts.
根据第二方面,或者以上第二方面的任意一种实现方式,编码调整指示为编码刷新消息,第一IPC根据编码调整指示进行编码调整,包括:第一IPC根据编码刷新消息进行帧刷新。其中,帧刷新即开始下一次编码,此时第一IPC可以读取下一帧待编码的原始图像,然后对下一帧待编码的原始图像进行编码。进而这种方式,也可以使得第一IPC读取下一帧待编码的原始图像的时间发生调整,即使得第一IPC读取下一帧待编码的原始图像的时间调整为当前时间。这种情况下,第一IPC通过一次或多次帧刷新,即可实现与第二IPC的帧时间同步。According to the second aspect, or any implementation of the above second aspect, the coding adjustment indication is a coding refresh message, and the first IPC performs coding adjustment according to the coding adjustment instruction, including: the first IPC performs frame refresh according to the coding refresh message. The frame refresh starts the next encoding. At this time, the first IPC can read the original image to be encoded in the next frame, and then encode the original image to be encoded in the next frame. Furthermore, in this way, the time for the first IPC to read the next frame of the original image to be encoded can also be adjusted, that is, the time for the first IPC to read the next frame of the original image to be encoded is adjusted to the current time. In this case, the first IPC can achieve frame time synchronization with the second IPC through one or more frame refreshes.
第二方面以及第二方面的任意一种实现方式分别与第一方面以及第一方面的任意一种实现方式相对应。第二方面以及第二方面的任意一种实现方式所对应的技术效果可参见上述第一方面以及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。The second aspect and any implementation manner of the second aspect respectively correspond to the first aspect and any implementation manner of the first aspect. The technical effects corresponding to the second aspect and any implementation manner of the second aspect may be referred to the technical effects corresponding to the above-mentioned first aspect and any implementation manner of the first aspect, which will not be described again here.
第三方面,本申请实施例提供一种同步系统,该系统包括:多个网络摄像机IPC和服务器,多个IPC包括第一IPC和第二IPC,第二IPC是第一IPC与第二IPC的帧时间是否同步的参考;In a third aspect, embodiments of the present application provide a synchronization system. The system includes: multiple network camera IPCs and a server. The multiple IPCs include a first IPC and a second IPC. The second IPC is a link between the first IPC and the second IPC. Reference for frame time synchronization;
第一IPC,用于读取待编码的第一原始图像;将第一原始图像编码为第一图像帧,以及确定第一图像帧对应的时间信息;向服务器发送第一图像帧和第一图像帧对应的时间信息;以及接收编码调整指示;根据编码调整指示进行编码调整,以使读取下一帧待编码的第一原始图像的时间发生调整;The first IPC is used to read the first original image to be encoded; encode the first original image into a first image frame, and determine the time information corresponding to the first image frame; send the first image frame and the first image to the server Time information corresponding to the frame; and receiving a coding adjustment instruction; performing coding adjustment according to the coding adjustment instruction, so that the time for reading the first original image to be encoded in the next frame is adjusted;
第二IPC,用于读取待编码的第二原始图像;将第二原始图像编码为第二图像帧,以及确定第二图像帧对应的时间信息;向服务器发送第二图像帧和第二图像帧对应的时间信息;The second IPC is used to read the second original image to be encoded; encode the second original image into a second image frame, and determine the time information corresponding to the second image frame; send the second image frame and the second image to the server The time information corresponding to the frame;
服务器,用于接收第一IPC发送的第一图像帧和第一图像帧对应的时间信息,以及接收第二IPC发送的第二图像帧和第二图像帧对应的时间信息;当根据第一IPC发送的第一图像帧对应的时间信息,以及第二IPC发送的第二图像帧对应的时间信息,确定第一IPC与第二IPC的帧时间不同步时,向第一IPC发送编码调整指示。The server is configured to receive the first image frame sent by the first IPC and the time information corresponding to the first image frame, and to receive the second image frame sent by the second IPC and the time information corresponding to the second image frame; when according to the first IPC When the time information corresponding to the sent first image frame and the time information corresponding to the second image frame sent by the second IPC are determined to be out of synchronization between the first IPC and the second IPC, a coding adjustment instruction is sent to the first IPC.
第三方面以及第三方面的服务器任意一种实现方式分别与第一方面以及第一方面的任意一种实现方式相对应。第三方面以及第三方面的服务器任意一种实现方式所对应的技术效果可参见上述第一方面以及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。The third aspect and any one implementation manner of the server of the third aspect respectively correspond to the first aspect and any one implementation manner of the first aspect. The technical effects corresponding to the third aspect and any implementation of the server of the third aspect can be found in the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be described again here.
第三方面以及第三方面的第一IPC任意一种实现方式分别与第二方面以及第二方面的任意一种实现方式相对应。第三方面以及第三方面的第一IPC任意一种实现方式所对应的技术效果可参见上述第二方面以及第二方面的任意一种实现方式所对应的技术效果,此处不再赘述。Any implementation of the third aspect and the first IPC of the third aspect corresponds to the second aspect and any implementation of the second aspect respectively. For the technical effects corresponding to any implementation of the third aspect and the first IPC, please refer to the technical effects corresponding to the above-mentioned second aspect and any implementation of the first IPC, and will not be described again here.
第四方面,本申请实施例提供一种网络摄像机IPC,可以用于实现第二方面以及第二方面的任意一种实现方式。In the fourth aspect, embodiments of the present application provide a network camera IPC, which can be used to implement the second aspect and any implementation manner of the second aspect.
第四方面以及第四方面的第一IPC任意一种实现方式所对应的技术效果可参见上述第二方面以及第二方面的任意一种实现方式所对应的技术效果,此处不再赘述。The technical effects corresponding to the fourth aspect and any one of the first IPC implementation methods of the fourth aspect may be referred to the technical effects corresponding to the above-mentioned second aspect and any one implementation method of the second aspect, and will not be described again here.
第五方面,本申请实施例提供一种电子设备,包括:存储器和处理器,存储器与处理器耦合;存储器存储有程序指令,当程序指令由处理器执行时,使得电子设备执行第一方面或第一方面的任意可能的实现方式中的同步方法。In a fifth aspect, embodiments of the present application provide an electronic device, including: a memory and a processor, the memory is coupled to the processor; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the first aspect or A synchronized method in any possible implementation of the first aspect.
第五方面以及第五方面任意一种实现方式分别与第一方面以及第一方面的任意一种实现方式相对应。第五方面以及第五方面任意一种实现方式所对应的技术效果可参见上述第一方面以及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。The fifth aspect and any implementation manner of the fifth aspect respectively correspond to the first aspect and any implementation manner of the first aspect. The technical effects corresponding to the fifth aspect and any implementation manner of the fifth aspect may be referred to the technical effects corresponding to the above-mentioned first aspect and any implementation manner of the first aspect, and will not be described again here.
第六方面,本申请实施例提供一种电子设备,包括:存储器和处理器,存储器与处理器耦合;存储器存储有程序指令,当程序指令由处理器执行时,使得电子设备执行第二方面或第二方面的任意可 能的实现方式中的同步方法。In a sixth aspect, embodiments of the present application provide an electronic device, including: a memory and a processor, the memory is coupled to the processor; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the second aspect or The second aspect is optional synchronization method in the possible implementation.
第六方面以及第六方面任意一种实现方式分别与第二方面以及第二方面的任意一种实现方式相对应。第六方面以及第六方面任意一种实现方式所对应的技术效果可参见上述第二方面以及第二方面的任意一种实现方式所对应的技术效果,此处不再赘述。The sixth aspect and any implementation manner of the sixth aspect respectively correspond to the second aspect and any implementation manner of the second aspect. For the technical effects corresponding to the sixth aspect and any implementation manner of the sixth aspect, please refer to the technical effects corresponding to the above-mentioned second aspect and any implementation manner of the second aspect, which will not be described again here.
第七方面,本申请实施例提供一种芯片,包括一个或多个接口电路和一个或多个处理器;接口电路用于从电子设备的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令;当处理器执行计算机指令时,使得电子设备执行第一方面或第一方面的任意可能的实现方式中的同步方法。In a seventh aspect, embodiments of the present application provide a chip, including one or more interface circuits and one or more processors; the interface circuit is used to receive signals from the memory of the electronic device and send signals to the processor, and the signals include the memory computer instructions stored in; when the processor executes the computer instructions, the electronic device is caused to execute the synchronization method in the first aspect or any possible implementation of the first aspect.
第七方面以及第七方面任意一种实现方式分别与第一方面以及第一方面的任意一种实现方式相对应。第七方面以及第七方面任意一种实现方式所对应的技术效果可参见上述第一方面以及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。The seventh aspect and any implementation manner of the seventh aspect respectively correspond to the first aspect and any implementation manner of the first aspect. The technical effects corresponding to the seventh aspect and any implementation manner of the seventh aspect may be referred to the technical effects corresponding to the above-mentioned first aspect and any implementation manner of the first aspect, and will not be described again here.
第八方面,本申请实施例提供一种芯片,包括一个或多个接口电路和一个或多个处理器;接口电路用于从电子设备的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令;当处理器执行计算机指令时,使得电子设备执行第二方面或第二方面的任意可能的实现方式中的同步方法。In an eighth aspect, embodiments of the present application provide a chip, including one or more interface circuits and one or more processors; the interface circuit is used to receive signals from the memory of the electronic device and send signals to the processor, and the signals include the memory computer instructions stored in; when the processor executes the computer instructions, the electronic device is caused to execute the synchronization method in the second aspect or any possible implementation of the second aspect.
第八方面以及第八方面任意一种实现方式分别与第二方面以及第二方面的任意一种实现方式相对应。第八方面以及第八方面任意一种实现方式所对应的技术效果可参见上述第二方面以及第二方面的任意一种实现方式所对应的技术效果,此处不再赘述。The eighth aspect and any implementation manner of the eighth aspect respectively correspond to the second aspect and any implementation manner of the second aspect. For the technical effects corresponding to the eighth aspect and any implementation manner of the eighth aspect, please refer to the technical effects corresponding to the above-mentioned second aspect and any implementation manner of the second aspect, which will not be described again here.
第九方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,当计算机程序运行在计算机或处理器上时,使得计算机或处理器执行第一方面或第一方面的任意可能的实现方式中的同步方法。In a ninth aspect, embodiments of the present application provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is run on a computer or processor, it causes the computer or processor to execute the first aspect or the second aspect. A synchronized method in any possible implementation on the one hand.
第九方面以及第九方面任意一种实现方式分别与第一方面以及第一方面的任意一种实现方式相对应。第九方面以及第九方面任意一种实现方式所对应的技术效果可参见上述第一方面以及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。The ninth aspect and any one implementation manner of the ninth aspect respectively correspond to the first aspect and any one implementation manner of the first aspect. The technical effects corresponding to the ninth aspect and any implementation manner of the ninth aspect may be referred to the technical effects corresponding to the above-mentioned first aspect and any implementation manner of the first aspect, and will not be described again here.
第十方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,当计算机程序运行在计算机或处理器上时,使得计算机或处理器执行第二方面或第二方面的任意可能的实现方式中的同步方法。In a tenth aspect, embodiments of the present application provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is run on a computer or processor, it causes the computer or processor to execute the second aspect or the second aspect. Synchronization methods in any possible implementation of both aspects.
第十方面以及第十方面任意一种实现方式分别与第二方面以及第二方面的任意一种实现方式相对应。第十方面以及第十方面任意一种实现方式所对应的技术效果可参见上述第二方面以及第二方面的任意一种实现方式所对应的技术效果,此处不再赘述。The tenth aspect and any one implementation manner of the tenth aspect respectively correspond to the second aspect and any one implementation manner of the second aspect. For the technical effects corresponding to the tenth aspect and any one of the implementation methods of the tenth aspect, please refer to the technical effects corresponding to the above-mentioned second aspect and any one implementation method of the second aspect, which will not be described again here.
第十一方面,本申请实施例提供一种计算机程序产品,计算机程序产品包括软件程序,当软件程序被计算机或处理器执行时,使得计算机或处理器执行第一方面或第一方面的任意可能的实现方式中的同步方法。In an eleventh aspect, embodiments of the present application provide a computer program product. The computer program product includes a software program. When the software program is executed by a computer or a processor, it causes the computer or processor to execute the first aspect or any possibility of the first aspect. The synchronization method in the implementation.
第十一方面以及第十一方面任意一种实现方式分别与第一方面以及第一方面的任意一种实现方式相对应。第十一方面以及第十一方面任意一种实现方式所对应的技术效果可参见上述第一方面以及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。The eleventh aspect and any implementation manner of the eleventh aspect respectively correspond to the first aspect and any implementation manner of the first aspect. For the technical effects corresponding to the eleventh aspect and any implementation manner of the eleventh aspect, please refer to the technical effects corresponding to the above-mentioned first aspect and any implementation manner of the first aspect, which will not be described again here.
第十二方面,本申请实施例提供一种计算机程序产品,计算机程序产品包括软件程序,当软件程序被计算机或处理器执行时,使得计算机或处理器执行第二方面或第二方面的任意可能的实现方式中的同步方法。 In a twelfth aspect, embodiments of the present application provide a computer program product. The computer program product includes a software program. When the software program is executed by a computer or a processor, it causes the computer or processor to execute the second aspect or any possibility of the second aspect. The synchronization method in the implementation.
第十二方面以及第十二方面任意一种实现方式分别与第二方面以及第二方面的任意一种实现方式相对应。第十二方面以及第十二方面任意一种实现方式所对应的技术效果可参见上述第二方面以及第二方面的任意一种实现方式所对应的技术效果,此处不再赘述。The twelfth aspect and any one implementation manner of the twelfth aspect respectively correspond to the second aspect and any one implementation manner of the second aspect. For the technical effects corresponding to the twelfth aspect and any one of the implementation methods of the twelfth aspect, please refer to the technical effects corresponding to the above-mentioned second aspect and any one implementation method of the second aspect, which will not be described again here.
附图说明Description of drawings
图1a为示例性示出的应用场景示意图;Figure 1a is a schematic diagram of an exemplary application scenario;
图1b为示例性示出的应用场景示意图;Figure 1b is a schematic diagram of an exemplary application scenario;
图1c为示例性示出的应用场景示意图;Figure 1c is a schematic diagram of an exemplary application scenario;
图1d为示例性的示出的IPC的部署方式的示意图;Figure 1d is a schematic diagram illustrating an exemplary IPC deployment manner;
图1e为示例性示出的IPC的结构示意图;Figure 1e is a schematic structural diagram of an exemplary IPC;
图1f为示例性示出的同步组件的结构示意图;Figure 1f is a schematic structural diagram of an exemplary synchronization component;
图2为示例性示出的同步过程示意图;Figure 2 is a schematic diagram of an exemplary synchronization process;
图3a为示例性示出的同步过程示意图;Figure 3a is a schematic diagram of an exemplary synchronization process;
图3b为示例性示出的封装后的图像帧的帧结构示意图;Figure 3b is a schematic diagram of the frame structure of an encapsulated image frame;
图3c为示例性示出的封装后的图像帧的帧结构示意图;Figure 3c is a schematic diagram of the frame structure of an encapsulated image frame;
图3d为示例性示出的封装后的图像帧的帧结构示意图;Figure 3d is a schematic diagram of the frame structure of an encapsulated image frame;
图3e为示例性示出的编码控制消息的消息结构示意图;Figure 3e is a schematic diagram of the message structure of an exemplary encoded control message;
图4为示例性示出的同步过程示意图;Figure 4 is a schematic diagram of an exemplary synchronization process;
图5为示例性示出的同步过程示意图;Figure 5 is a schematic diagram of an exemplary synchronization process;
图6为示例性示出的同步系统示意图;Figure 6 is a schematic diagram of an exemplary synchronization system;
图7为示例性示出的装置的结构示意图。Figure 7 is a schematic structural diagram of an exemplary device.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。The term "and/or" in this article is just an association relationship that describes related objects, indicating that three relationships can exist. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and they exist alone. B these three situations.
本申请实施例的说明书和权利要求书中的术语“第一”和“第二”等是用于区别不同的对象,而不是用于描述对象的特定顺序。例如,第一目标对象和第二目标对象等是用于区别不同的目标对象,而不是用于描述目标对象的特定顺序。The terms “first” and “second” in the description and claims of the embodiments of this application are used to distinguish different objects, rather than to describe a specific order of objects. For example, the first target object, the second target object, etc. are used to distinguish different target objects, rather than to describe a specific order of the target objects.
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of this application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "such as" in the embodiments of the present application is not to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary" or "such as" is intended to present the concept in a concrete manner.
在本申请实施例的描述中,除非另有说明,“多个”的含义是指两个或两个以上。例如,多个处理单元是指两个或两个以上的处理单元;多个系统是指两个或两个以上的系统。In the description of the embodiments of this application, unless otherwise specified, the meaning of “plurality” refers to two or more. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
图1a为示例性示出的应用场景示意图。Figure 1a is a schematic diagram of an exemplary application scenario.
参照图1a,示例性的,n(n为大于1的整数)个IPC经由路由器连接到同一MP设备。n个IPC启动后,每个IPC均可以采集目标对象的原始图像(也就是RAW(未加工)图像),然后将原始图像编码成图像帧,并将图像帧发送至路由器;由路由器将图像帧转发给MP设备。MP设备接收到n个IPC发送的图像帧后,可以对n个IPC发送的图像帧进行处理,如视频拼接、FVV视频制作等,本申请对此不作限制。随后,MP设备可以将处理得到的图像帧发送给终端设备如手机、平板电脑等。Referring to Figure 1a, in an exemplary embodiment, n (n is an integer greater than 1) IPCs are connected to the same MP device via a router. After n IPCs are started, each IPC can collect the original image of the target object (that is, RAW (unprocessed) image), then encode the original image into an image frame, and send the image frame to the router; the router converts the image frame Forwarded to MP device. After receiving n image frames sent by IPC, the MP device can process the n image frames sent by IPC, such as video splicing, FVV video production, etc. This application does not limit this. Subsequently, the MP device can send the processed image frames to terminal devices such as mobile phones, tablets, etc.
图1b为示例性示出的应用场景示意图。Figure 1b is a schematic diagram of an exemplary application scenario.
参照图1b,示例性的,n个IPC经由基站和核心网连接到同一MEP设备。n个IPC启动后,每 个IPC均可以采集目标对象的原始图像,然后将原始图像编码成图像帧,并将图像帧发送至基站。基站接收到n个IPC发送的图像帧后,可以将n个IPC发送的图像帧发送给核心网,由核心网的UPF(User Plane Function,用户面功能)网元将n个IPC发送的图像帧发送给MEP设备。MEP设备接收到n个IPC发送的图像帧后,可以对n个IPC发送的图像帧进行处理,如视频拼接、FVV视频制作等,本申请对此不作限制。随后,MEP设备可以将处理得到的图像帧发送给终端设备如手机、平板电脑等。Referring to Figure 1b, in an exemplary embodiment, n IPCs are connected to the same MEP device via a base station and a core network. After n IPCs are started, each Each IPC can collect the original image of the target object, then encode the original image into an image frame, and send the image frame to the base station. After receiving n image frames sent by IPC, the base station can send the n image frames sent by IPC to the core network. The UPF (User Plane Function) network element of the core network will send the n image frames sent by IPC. Sent to MEP equipment. After receiving n image frames sent by IPC, the MEP device can process the n image frames sent by IPC, such as video splicing, FVV video production, etc. This application does not limit this. Subsequently, the MEP device can send the processed image frames to terminal devices such as mobile phones, tablets, etc.
图1c为示例性示出的应用场景示意图。Figure 1c is a schematic diagram of an exemplary application scenario.
参照图1c,示例性的,n个IPC通过通信卫星连接到同一MP设备。n个IPC启动后,每个IPC均可以采集目标对象的原始图像,然后将原始图像编码成图像帧,并将图像帧发送至通信卫星。通信卫星接收到n个IPC发送的图像帧后,可以将n个IPC发送的图像帧发送至MP设备。MP设备接收到n个IPC发送的图像帧后,可以对n个IPC发送的图像进行处理,如视频拼接、FVV视频制作等,本申请对此不作限制。随后,MP设备可以将处理得到的图像帧发送给终端设备如手机、平板电脑等。Referring to Figure 1c, in an exemplary embodiment, n IPCs are connected to the same MP device through communication satellites. After n IPCs are started, each IPC can collect the original image of the target object, then encode the original image into an image frame, and send the image frame to the communication satellite. After the communication satellite receives n image frames sent by IPC, it can send n image frames sent by IPC to the MP device. After receiving n image frames sent by IPC, the MP device can process the n images sent by IPC, such as video splicing, FVV video production, etc. This application does not limit this. Subsequently, the MP device can send the processed image frames to terminal devices such as mobile phones, tablets, etc.
需要说明的是,MP设备和MEP设备可以是服务器,该服务器可以是指单个服务器,也可以是指服务器集群(例如,云服务器等),本申请对此不作限制。It should be noted that MP devices and MEP devices may be servers, and the server may refer to a single server or a server cluster (for example, a cloud server, etc.), which is not limited in this application.
需要说明的是,IPC可以连续向MP设备/MEP设备发送多个图像帧。一种可能的方式中,连续发送的多个图像帧可以组成视频,此时,图像帧也可以称为视频帧。It should be noted that the IPC can continuously send multiple image frames to the MP device/MEP device. In one possible way, multiple image frames sent continuously can form a video. In this case, the image frames can also be called video frames.
图1d为示例性的示出的IPC的部署方式的示意图。在图1d中,示出了多个IPC相对于目标对象的部署方式。Figure 1d is a schematic diagram illustrating an exemplary IPC deployment manner. In Figure 1d, the deployment manner of multiple IPCs relative to the target object is shown.
参照图1d(1),示例性的,n(n=6)个IPC(包括IPC1、IPC2、IPC3、IPC4、IPC5个IPC6)可以环绕目标对象部署,每个IPC部署在相对于目标对象的不同角度。应该理解的是,图1d(1)仅是多个IPC部署方式的一个示例,本申请环绕目标对象部署的IPC的数量可以比图1d(1)示出的更多或更少,本申请对此不作限制。Referring to Figure 1d(1), for example, n (n=6) IPCs (including IPC1, IPC2, IPC3, IPC4, IPC5 and IPC6) can be deployed around the target object, and each IPC is deployed at a different location relative to the target object. angle. It should be understood that Figure 1d(1) is only an example of multiple IPC deployment methods. The number of IPCs deployed around the target object in this application may be more or less than that shown in Figure 1d(1). This application is This is not a restriction.
示例性的,采用图1d(1)所示的部署方式的应用场景可以包括多种,例如,文艺类舞蹈表演、体育比赛、影视综艺、网红表演、景区留影、直播带货、展会引流、动作教学等。这样,MP设备/MEP设备对n个IPC发送的图像帧进行FVV视频制作后,可以为用户提供多种不同的画面观看角度。Exemplarily, the application scenarios using the deployment method shown in Figure 1d(1) can include a variety of applications, such as artistic dance performances, sports competitions, film and television variety shows, Internet celebrity performances, scenic spots, live broadcasts, and exhibition traffic. Movement teaching, etc. In this way, after the MP device/MEP device performs FVV video production on n image frames sent by IPC, it can provide users with a variety of different viewing angles.
参照图1d(2),示例性的,n(n=5)个IPC(包括IPC1、IPC2、IPC3、IPC4和IPC5)以用户位置为中心,朝向目标对象呈扇形部署。应该理解的是,图1d(2)仅是多个IPC部署方式的一个示例,本申请以用户位置为中心,朝向目标对象呈扇形部署的IPC的数量可以比图1d(2)示出的更多或更少,本申请对此不作限制。Referring to Figure 1d(2), for example, n (n=5) IPCs (including IPC1, IPC2, IPC3, IPC4, and IPC5) are deployed in a fan shape with the user position as the center and toward the target object. It should be understood that Figure 1d(2) is only an example of multiple IPC deployment methods. This application takes the user location as the center and the number of IPCs deployed in a fan shape toward the target object can be greater than that shown in Figure 1d(2). More or less, this application does not limit this.
示例性的,采用图1d(2)的部署方式的应用场景可以包括多种,例如,VR(Virtual Reality,虚拟现实)场景、AR(Augmented Reality,增强现实)场景等。这样,MP设备/MEP设备对n个IPC中位置相邻的两个IPC发送的图像帧进行视频拼接后,可以形成用于VR场景和AR场景展示的全景图像。Exemplarily, application scenarios using the deployment method of Figure 1d(2) may include a variety of scenarios, such as VR (Virtual Reality, virtual reality) scenarios, AR (Augmented Reality, augmented reality) scenarios, etc. In this way, after the MP device/MEP device performs video splicing on the image frames sent by two adjacent IPCs among the n IPCs, a panoramic image for VR scene and AR scene display can be formed.
图1e为示例性示出的IPC的结构示意图。Figure 1e is a schematic structural diagram of an exemplary IPC.
参照图1e,示例性的,IPC可以包括感光器、图像缓存、编码组件和通信组件。应该理解的是,图1e仅是本申请的一个示例,IPC可以包括比图1e示出的更多的组件,本申请对此不作限制。Referring to FIG. 1 e , by way of example, an IPC may include a photoreceptor, an image cache, an encoding component, and a communication component. It should be understood that Figure 1e is only an example of the present application, and the IPC may include more components than shown in Figure 1e, which is not limited by this application.
参照图1e,示例性的,感光器是一种光传感器,经由外部曝光,接收光信号,转换成电信号。感光器与图像缓存可以通过排线连接,经由光电转换成图像数据(后续称为原始图像),实时输出到图像缓存中。编码组件可以按照预设周期从图像缓存中读取待编码的原始图像,并对原始图像进行编码,输出图像帧;编码得到的图像帧在通信组件中进行打包,经由网络发送到MP设备或MEP设备。Referring to Figure 1e, an exemplary photoreceptor is a light sensor that receives an optical signal through external exposure and converts it into an electrical signal. The photoreceptor and the image buffer can be connected through a cable, which is photoelectrically converted into image data (hereinafter referred to as the original image) and output to the image buffer in real time. The encoding component can read the original image to be encoded from the image cache according to the preset cycle, encode the original image, and output the image frame; the encoded image frame is packaged in the communication component and sent to the MP device or MEP via the network equipment.
需要说明的是,IPC向MP设备/MEP设备连续发送图像帧的间隔,可以等于预设周期。It should be noted that the interval at which the IPC continuously sends image frames to the MP device/MEP device may be equal to the preset period.
示例性的,MP设备/MEP设备在进行视频拼接或FVV视频制作之前,需要同步多个IPC发送的多个图像帧的帧时间(也就是同步同一时间段内(如同一天的8点10分22秒10毫秒~20毫秒这 个时间段)接收到的多个IPC发送的多个图像帧拍摄的画面),以保证用于视频拼接或FVV视频制作的同一组中多个图像帧所拍摄的画面不存在时间差。For example, before MP equipment/MEP equipment performs video splicing or FVV video production, it needs to synchronize the frame times of multiple image frames sent by multiple IPCs (that is, synchronize the frame times within the same time period (such as 8:10:22 of the day) 10 milliseconds to 20 milliseconds time period) to ensure that there is no time difference in the pictures captured by multiple image frames in the same group for video splicing or FVV video production.
目前,导致多个IPC的帧时间不同步(即服务器在同一时间段内(如同一天的8点10分22秒10毫秒~20毫秒这个时间段)接收到的多个IPC发送的多个图像帧所拍摄的画面存在时间差)的原因之一在于,不同IPC编码启动时间(也就是第一次从图像缓存读取待编码的原始图像的时间)不一致。基于此,本申请提出一种同步方法,该方法通过在IPC发送图像帧的同时发送图像帧对应的时间信息;然后,由MP设备/MEP设备根据各IPC发送的图像帧对应的时间信息,判断多个IPC的帧时间是否同步;当确定多个IPC的帧时间不同步时,可以向部分IPC发送编码调整指示,来触发部分IPC进行编码调整,进而控制部分IPC的出帧时间,使得多个IPC出帧时间同步,从而实现多个IPC的帧时间同步。Currently, the frame time of multiple IPCs is not synchronized (that is, the server receives multiple image frames sent by multiple IPCs within the same time period (such as the time period of 8:10:22, 10 milliseconds to 20 milliseconds of the day) One of the reasons why there is a time difference in the captured pictures is that different IPC encoding start times (that is, the time when the original image to be encoded is read from the image cache for the first time) are inconsistent. Based on this, this application proposes a synchronization method. This method sends the time information corresponding to the image frame while the IPC sends the image frame; then, the MP device/MEP device determines based on the time information corresponding to the image frame sent by each IPC. Whether the frame times of multiple IPCs are synchronized; when it is determined that the frame times of multiple IPCs are not synchronized, coding adjustment instructions can be sent to some IPCs to trigger some IPCs to adjust their coding, thereby controlling the frame outgoing times of some IPCs, so that multiple IPC outgoing frame time synchronization, thereby achieving frame time synchronization of multiple IPCs.
图1f为示例性示出的同步组件的结构示意图。图1f所示的是服务器(如MP设备、MEP设备)中的同步组件,用于保证服务器侧实施本申请的同步方法。Figure 1f is a schematic structural diagram of an exemplary synchronization component. Figure 1f shows the synchronization component in the server (such as MP device, MEP device), which is used to ensure that the server side implements the synchronization method of the present application.
参照图1f,示例性的,MP设备中同步组件可以包括时间对比模块、决策模块和控制模块。其中,时间对比模块用于对比两个IPC发送的两个图像帧对应的时间信息,确定时间差;决策模块用于根据时间差,决策是否发送编码调整指示;控制模块用于发送编码调整指示。Referring to Figure 1f, in an exemplary embodiment, the synchronization component in the MP device may include a time comparison module, a decision-making module and a control module. Among them, the time comparison module is used to compare the time information corresponding to the two image frames sent by the two IPCs to determine the time difference; the decision-making module is used to decide whether to send a coding adjustment instruction based on the time difference; the control module is used to send a coding adjustment instruction.
应该理解的是,图1f仅是本申请的一个示例,同步组件可以包括比图1f所示的更多或更少的模块,本申请对此不作限制。It should be understood that Figure 1f is only an example of this application, and the synchronization component may include more or fewer modules than shown in Figure 1f, which is not limited by this application.
以下对本申请的同步方法进行说明。The synchronization method of this application is described below.
图2为示例性示出的同步过程示意图。在图2的实施例中,IPC的数量为n,n个IPC均连接到同一服务器,服务器可以是指单个服务器,也可以是指服务器集群;服务器可以是MP设备,也可以是MEP设备。Figure 2 is a schematic diagram illustrating an exemplary synchronization process. In the embodiment of Figure 2, the number of IPCs is n, and the n IPCs are all connected to the same server. The server can refer to a single server or a server cluster; the server can be an MP device or a MEP device.
S201,IPC读取待编码的原始图像。S201, IPC reads the original image to be encoded.
示例性的,n个IPC中可以包括1个第二IPC和(n-1)个第一IPC,其中,第二IPC是第一IPC与第二IPC的帧时间是否同步的参考,第一IPC是n个IPC中除第二IPC之外的IPC。For example, n IPCs may include 1 second IPC and (n-1) first IPCs, where the second IPC is a reference for whether the frame times of the first IPC and the second IPC are synchronized, and the first IPC It is the IPC except the second IPC among the n IPCs.
一种可能的方式中,可以由n个IPC相互协商确定n个IPC中的第一IPC和第二IPC。In one possible way, n IPCs may negotiate with each other to determine the first IPC and the second IPC among the n IPCs.
一种可能的方式中,可以由服务器在开始同步多个IPC的帧时间时,确定n个IPC中的第一IPC和第二IPC。In one possible way, the server can determine the first IPC and the second IPC among the n IPCs when starting to synchronize the frame times of multiple IPCs.
示例性的,服务器在开始同步多个IPC的帧时间时,可以按照预设规则,确定n个IPC中的第一IPC和第二IPC。示例性的,预设规则可以按照需求设置,如随机选取,按照预设顺序选取等等,本申请对此不作限制。For example, when the server starts to synchronize the frame times of multiple IPCs, the server may determine the first IPC and the second IPC among the n IPCs according to preset rules. For example, the preset rules can be set according to requirements, such as random selection, selection according to a preset order, etc. This application does not limit this.
示例性的,n个IPC在启动后,这n个IPC可以进行系统时间同步。示例性的,每个IPC启动后,均可以与时间服务器进行交互,进而与时间服务器的系统时间同步;这样,这n个IPC的系统时间即可以实现同步。For example, after n IPCs are started, these n IPCs can perform system time synchronization. For example, after each IPC is started, it can interact with the time server and then synchronize with the system time of the time server; in this way, the system time of these n IPCs can be synchronized.
示例性的,S201包括S201a和S201b:For example, S201 includes S201a and S201b:
S201a,第一IPC读取待编码的原始图像。S201a, the first IPC reads the original image to be encoded.
S201b,第二IPC读取待编码的原始图像。S201b, the second IPC reads the original image to be encoded.
示例性的,第一IPC启动后,第一IPC中的感光器可以接收光信号,并将光信号转换成电信号;然后将经由光电转换得到的原始图像,实时输出到图像缓存中。这样,图像缓存可以存储有多帧原始图像。For example, after the first IPC is started, the photoreceptor in the first IPC can receive the optical signal and convert the optical signal into an electrical signal; and then output the original image obtained through photoelectric conversion to the image cache in real time. In this way, the image cache can store multiple frames of the original image.
示例性的,第一IPC启动后,编码组件也被启动;编码组件启动后,可以按照预设周期,从图像缓存中读取待编码的原始图像。这样,(n-1)个第一IPC均可以从对应的图像缓存中读取待编码的原始图像。需要说明的是,编码组件一个预设周期,可以从图像缓存中读取一帧待编码的原始图像。For example, after the first IPC is started, the encoding component is also started; after the encoding component is started, the original image to be encoded can be read from the image cache according to a preset cycle. In this way, each of the (n-1) first IPCs can read the original image to be encoded from the corresponding image cache. It should be noted that the encoding component can read a frame of the original image to be encoded from the image cache in a preset cycle.
示例性的,第二IPC启动后,第二IPC中的编码组件,也可以按照预设周期,从图像缓存中读取待编码的原始图像。 For example, after the second IPC is started, the encoding component in the second IPC can also read the original image to be encoded from the image cache according to a preset cycle.
S202,IPC将原始图像编码为图像帧,以及确定图像帧对应的时间信息。S202, IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
示例性的,S202包括S202a和S202b:Illustratively, S202 includes S202a and S202b:
S202a,第一IPC将原始图像编码为图像帧,以及确定图像帧对应的时间信息。S202a: The first IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
S202b,第二IPC将原始图像编码为图像帧,以及确定图像帧对应的时间信息。S202b: The second IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
示例性的,第一IPC的编码组件在读取到原始图像后,一方面,可以由编码组件对原始图像进行编码,输出图像帧(也就是码流)。示例性的,第一IPC对原始图像的编码方法可以按照需求确定,如可以采用H.264、H.265、H.266等编码协议对原始图像进行编码,本申请对此不作限制。For example, after the encoding component of the first IPC reads the original image, on the one hand, the encoding component can encode the original image and output the image frame (that is, the code stream). For example, the encoding method of the original image by the first IPC can be determined according to the requirements. For example, the original image can be encoded by encoding protocols such as H.264, H.265, H.266, etc. This application does not limit this.
示例性的,第一IPC的编码组件在读取到原始图像后,另一方面,可以由编码组件或通信组件确定图像帧对应的时间信息。其中,图像帧对应的时间信息可以用于服务器同步多个IPC的帧时间。时间信息可以用于标识时间,时间信息如可以是时间戳,本申请对此不作限制。For example, after the encoding component of the first IPC reads the original image, on the other hand, the encoding component or the communication component can determine the time information corresponding to the image frame. Among them, the time information corresponding to the image frame can be used by the server to synchronize the frame times of multiple IPCs. The time information can be used to identify the time. For example, the time information can be a timestamp, which is not limited in this application.
一种可能的方式中,可以由编码组件依据编码组件从图像缓存中读取到待编码的原始图像的时间,确定图像帧对应的时间信息。例如,可以将编码组件从图像缓存中读取到待编码的原始图像的时间,作为图像帧对应的时间信息;又例如,可以将编码组件从图像缓存中读取到待编码的原始图像的时间,与预设时间(如1970年01月01日0点0分0秒10毫秒)的差值,作为图像帧对应的时间信息;本申请对此不作限制。示例性的,图像帧对应的时间信息的单位可以是ms(毫秒)。In one possible way, the encoding component can determine the time information corresponding to the image frame based on the time when the encoding component reads the original image to be encoded from the image cache. For example, the time when the encoding component reads the original image to be encoded from the image cache can be used as the time information corresponding to the image frame; for another example, the time when the encoding component reads the original image to be encoded from the image cache can be used , the difference from the preset time (such as 0:00:00:10 milliseconds on January 1, 1970) is used as the time information corresponding to the image frame; this application does not limit this. For example, the unit of the time information corresponding to the image frame may be ms (millisecond).
一种可能的方式中,可以由编码组件依据编码组件编码得到图像帧的时间,确定图像帧对应的时间信息。例如,可以将编码组件编码得到图像帧的时间,作为图像帧对应的时间信息;又例如,可以将编码组件编码得到图像帧的时间与预设时间的差值,作为图像帧对应的时间信息;本申请对此不作限制。In one possible way, the encoding component can determine the time information corresponding to the image frame based on the time when the image frame is obtained by encoding the encoding component. For example, the coding component can be coded to obtain the time of the image frame as the time information corresponding to the image frame; for another example, the coding component can be coded to obtain the difference between the time of the image frame and the preset time as the time information corresponding to the image frame; This application does not limit this.
一种可能的方式中,可以由编码组件依据编码组件在编码过程中执行的各种编码步骤(如编码预测、量化、熵编码等)的时间,确定图像帧对应的时间信息。例如,编码组件将编码组件开始进行编码预测的时间,作为确定图像帧对应的时间信息;又例如,编码组件将编码组件开始进行量化的时间,作为确定图像帧对应的时间信息;等等,本申请对此不作限制。In one possible way, the encoding component can determine the time information corresponding to the image frame based on the time of various encoding steps (such as encoding prediction, quantization, entropy encoding, etc.) performed by the encoding component during the encoding process. For example, the encoding component uses the time when the encoding component starts to perform coding prediction as the time information for determining the image frame correspondence; for another example, the encoding component uses the time when the encoding component starts to perform quantization as the time information for determining the image frame correspondence; and so on. There are no restrictions on applications.
一种可能的方式中,可以由通信组件依据接收到图像帧的时间,确定图像帧对应的时间信息。例如,将通信组件接收到图像帧的时间,作为确定图像帧对应的时间信息;又例如,将通信组件接收到图像帧的时间与预设时间的差值,作为图像帧对应的时间信息。In one possible way, the communication component can determine the time information corresponding to the image frame based on the time when the image frame is received. For example, the time when the communication component receives the image frame is used as the time information corresponding to the image frame; for another example, the difference between the time when the communication component receives the image frame and the preset time is used as the time information corresponding to the image frame.
应该理解的是,可以将向服务器发送图像帧之前的任一时间,作为图像帧对应的时间信息,本申请对此不作限制。It should be understood that any time before sending the image frame to the server can be used as the time information corresponding to the image frame, and this application does not limit this.
这样,(n-1)个第一IPC均可以得到图像帧和图像帧对应的时间信息。In this way, each of the (n-1) first IPCs can obtain the image frame and the time information corresponding to the image frame.
示例性的,第二IPC的编码组件在读取到原始图像后,可以参照上述方式,得到图像帧和图像帧对应的时间信息。For example, after reading the original image, the encoding component of the second IPC can refer to the above method to obtain the image frame and the time information corresponding to the image frame.
S203,IPC向服务器发送图像帧和图像帧对应的时间信息。S203. The IPC sends the image frame and the time information corresponding to the image frame to the server.
示例性的,S203包括S203a和S203b:Illustratively, S203 includes S203a and S203b:
S203a,第一IPC向服务器发送图像帧和图像帧对应的时间信息。S203a: The first IPC sends the image frame and time information corresponding to the image frame to the server.
S203b,第二IPC向服务器发送图像帧和图像帧对应的时间信息。S203b: The second IPC sends the image frame and time information corresponding to the image frame to the server.
示例性的,(n-1)个第一IPC中每个第一IPC,均可以将得到的图像帧和图像帧对应的时间信息,发送给同一服务器。For example, each of the (n-1) first IPCs can send the obtained image frame and the time information corresponding to the image frame to the same server.
示例性的,第二IPC也可以将得到的图像帧和图像帧对应的时间信息,发送给该服务器。For example, the second IPC may also send the obtained image frame and the time information corresponding to the image frame to the server.
S204,服务器根据第一IPC发送的图像帧对应的时间信息,以及第二IPC发送的图像帧对应的时间信息,确定第一IPC与第二IPC的帧时间不同步时,向第一IPC发送编码调整指示。S204: Based on the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC, the server determines that the frame time of the first IPC and the second IPC are not synchronized, and sends the code to the first IPC. Adjustment instructions.
示例性的,服务器可以以第二IPC发送的图像帧对应的时间信息为参考,根据各第一IPC发送的图像帧对应的时间信息,来判断各第一IPC与第二IPC的帧时间是否同步。For example, the server can use the time information corresponding to the image frame sent by the second IPC as a reference, and determine whether the frame time of each first IPC and the second IPC is synchronized based on the time information corresponding to the image frame sent by each first IPC. .
示例性的,针对一个第一IPC,服务器可以确定该第一IPC发送的图像帧对应的时间信息,与第二IPC发送的图像帧对应的时间信息之间的时间差。若该时间差大于阈值,则可以确定该第一IPC与第二IPC的帧时间不同步。若该时间差小于或等于阈值,则可以确定该第一IPC与第二IPC的帧时间 同步。其中,阈值可以按照需求设置,本申请对此不作限制。For example, for a first IPC, the server may determine the time difference between the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC. If the time difference is greater than the threshold, it may be determined that the frame times of the first IPC and the second IPC are not synchronized. If the time difference is less than or equal to the threshold, the frame time of the first IPC and the second IPC can be determined. Synchronize. The threshold can be set according to requirements, and this application does not limit this.
这样,按照上述方式,可以判断(n-1)个第一IPC中的每个第一IPC,与第二IPC的帧时间是否同步;也就是判断n个IPC的帧时间是否同步。In this way, according to the above method, it can be judged whether the frame time of each first IPC among the (n-1) first IPCs is synchronized with the second IPC; that is, whether the frame time of n IPCs is synchronized is judged.
应该理解的是,服务器可以串行判断这(n-1)个第一IPC与第二IPC的帧时间是否同步,也可以并行判断这(n-1)个第一IPC与第二IPC的帧时间是否同步;本申请对此不作限制。It should be understood that the server can serially determine whether the frame times of the (n-1) first IPC and the second IPC are synchronized, or it can also determine in parallel the frames of the (n-1) first IPC and the second IPC. Whether the time is synchronized; this application does not limit this.
示例性的,针对一个第一IPC,若服务器确定该第一IPC与第二IPC帧时间不同步,则需要对该第一IPC进行同步调整,此时,可以生成编码调整指示;然后将编码调整指示,发送给该第一IPC。若服务器确定该第一IPC与第二IPC帧时间同步,则可以结束对该第一IPC的同步调整,此时无需生成编码调整指示。For example, for a first IPC, if the server determines that the first IPC and the second IPC frame time are not synchronized, the first IPC needs to be synchronized. At this time, a coding adjustment instruction can be generated; and then the coding adjustment Instructions are sent to the first IPC. If the server determines that the first IPC and the second IPC frame time are synchronized, the synchronization adjustment of the first IPC can be ended, and there is no need to generate a coding adjustment instruction at this time.
S205,第一IPC根据编码调整指示进行编码调整,以使第一IPC读取下一帧的原始图像的时间发生调整。S205: The first IPC performs encoding adjustment according to the encoding adjustment instruction, so that the time for the first IPC to read the original image of the next frame is adjusted.
示例性的,(n-1)个第一IPC中,任意一个第一IPC接收到服务器发送的编码调整指示后,可以根据编码调整指示进行编码调整,以使得第一IPC读取下一帧待编码的原始图像的时间发生调整。这样,当到达读取下一帧待编码的原始图像的时间时,可以返回执行上述S201~S205,如此循环往复,直至(n-1)个第一IPC与第二IPC的帧时间均同步为止。For example, among the (n-1) first IPCs, after receiving the encoding adjustment instruction sent by the server, any first IPC can perform encoding adjustment according to the encoding adjustment instruction, so that the first IPC reads the next frame to be processed. The encoding of the original image is adjusted in time. In this way, when it is time to read the next frame of the original image to be encoded, you can return to execute the above-mentioned S201 to S205, and so on until the frame times of (n-1) first IPCs and second IPCs are all synchronized. .
需要说明的是,一种可能的方式中,(n-1)个第一IPC中可能仅存在部分第一IPC与第二IPC的帧时间不同步,此时服务器也仅向这部分的第一IPC发送编码调整指示(图2未示出)。一种可能的方式中,(n-1)个第一IPC与第二IPC的帧时间均不同步,此时服务器可以向这(n-1)个第一IPC发送编码调整指示(如图2所示)。It should be noted that in one possible way, among the (n-1) first IPCs, there may be only a part of the first IPCs and the second IPCs whose frame times are out of sync. The IPC sends a coding adjustment indication (not shown in Figure 2). In one possible way, the frame times of the (n-1) first IPCs and the second IPCs are not synchronized. At this time, the server can send coding adjustment instructions to the (n-1) first IPCs (as shown in Figure 2 shown).
需要说明的是,对于一个第一IPC而言,可能在接收到服务器一次发送编码调整指示,并按照该编码调整指示进行编码调整后,即可以实现与第二IPC的帧时间同步;也就是该第一IPC进行一次编码调整即可以实现与第二IPC的帧时间同步。也可能在接收到服务器多次发送编码调整指示,并按照多次发送编码调整指示进行编码调整后,才能够实现与第二IPC的帧时间同步;也就是该第一IPC进行多次编码时间调整才实现与第二IPC的帧时间同步。It should be noted that for a first IPC, frame time synchronization with the second IPC may be achieved after receiving a coding adjustment instruction sent by the server once and performing coding adjustment according to the coding adjustment instruction; that is, the The first IPC can achieve frame time synchronization with the second IPC by performing one coding adjustment. It is also possible that frame time synchronization with the second IPC can be achieved only after receiving the encoding adjustment instructions sent multiple times by the server and performing encoding adjustments according to the encoding adjustment instructions sent multiple times; that is, the first IPC performs multiple encoding time adjustments. Only then can frame time synchronization with the second IPC be achieved.
这样,第一IPC通过根据服务器一次或多次发送的编码调整指示,进行一次或多次的编码条件,以使一个或多次读取下一帧待编码的原始图像的时间的发生调整,来实现与第二IPC的出帧时间同步;从而避免服务器在同一时间段内接收到的多个图像帧所拍摄的画面出现时间差,实现多个IPC的帧时间同步。In this way, the first IPC performs one or more encoding conditions according to the encoding adjustment instructions sent one or more times by the server to adjust the time of reading the next frame of the original image to be encoded one or more times. Realize frame time synchronization with the second IPC; thereby avoiding time differences in pictures captured by multiple image frames received by the server in the same time period, and realizing frame time synchronization of multiple IPCs.
相对于现有技术借助硬件进行多个IPC的帧时间同步而言,本申请无需借助硬件,通过服务器与IPC之间的数据交互,即可实现多个IPC之间的帧时间同步,鲁棒性好;且能够降低成本,便于多个IPC的部署。Compared with the existing technology that uses hardware to synchronize the frame time of multiple IPCs, this application can achieve frame time synchronization between multiple IPCs without using hardware through data interaction between the server and the IPC, and is robust. Good; and can reduce costs and facilitate the deployment of multiple IPCs.
图3a为示例性示出的同步过程示意图。在图3a的实施例中,编码调整指示为编码控制消息。Figure 3a is a schematic diagram illustrating an exemplary synchronization process. In the embodiment of Figure 3a, the coding adjustment indication is a coding control message.
S301,IPC读取待编码的原始图像。S301, IPC reads the original image to be encoded.
示例性的,S301包括S301a和S301b:For example, S301 includes S301a and S301b:
S301a,第一IPC读取待编码的原始图像。S301a, the first IPC reads the original image to be encoded.
S301b,第二IPC读取待编码的原始图像。S301b: The second IPC reads the original image to be encoded.
S302,IPC将原始图像编码为图像帧,以及确定图像帧对应的时间信息。S302, IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
示例性的,S302包括S302a和S302b:Exemplarily, S302 includes S302a and S302b:
S302a,第一IPC将原始图像编码为图像帧,以及确定图像帧对应的时间信息。S302a: The first IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
S302b,第二IPC将原始图像编码为图像帧,以及确定图像帧对应的时间信息。S302b: The second IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
示例性的,S301~S302,可以参照上述S201~S202的描述,在此不再赘述。For example, for S301 to S302, reference may be made to the description of the above S201 to S202, which will not be described again here.
S303,IPC向服务器发送图像帧和图像帧对应的时间信息。S303. The IPC sends the image frame and the time information corresponding to the image frame to the server.
示例性的,S303包括S303a和S303b:Exemplarily, S303 includes S303a and S303b:
S303a,第一IPC向服务器发送图像帧和图像帧对应的时间信息。 S303a: The first IPC sends the image frame and time information corresponding to the image frame to the server.
S303b,第二IPC向服务器发送图像帧和图像帧对应的时间信息。S303b: The second IPC sends the image frame and time information corresponding to the image frame to the server.
示例性的,第一IPC可以将图像帧对应的时间信息与图像帧封装在一起后,再向服务器发送封装在一起的图像帧和图像帧对应的时间信息。以下以一个第一IPC为例,对第一IPC发送图像帧和图像帧对应的时间信息的过程进行说明。For example, the first IPC may encapsulate the time information corresponding to the image frame and the image frame together, and then send the encapsulated image frame and the time information corresponding to the image frame to the server. The following takes a first IPC as an example to describe the process of the first IPC sending image frames and time information corresponding to the image frames.
图3b为示例性示出的封装后的图像帧的帧结构示意图。Figure 3b is a schematic diagram of the frame structure of an encapsulated image frame.
示例性的,可以将图像帧对应的时间信息封装至图像帧的扩展字段中;然后向服务器发送封装后的图像帧。For example, the time information corresponding to the image frame can be encapsulated into the extension field of the image frame; and then the encapsulated image frame is sent to the server.
示例性的,可以为图像帧封装信息头(header)和扩展字段;并将图像帧对应的时间信息,封装在该扩展字段中;如图3b所示。For example, an information header (header) and an extension field can be encapsulated for the image frame; and the time information corresponding to the image frame can be encapsulated in the extension field; as shown in Figure 3b.
图3c为示例性示出的封装后的图像帧的帧结构示意图。在图3c的实施例中,本申请将图像帧对应的时间信息,封装在视频编码协议的扩展字段中。Figure 3c is a schematic diagram of the frame structure of an encapsulated image frame. In the embodiment of Figure 3c, this application encapsulates the time information corresponding to the image frame in the extension field of the video coding protocol.
示例性的,第一IPC的编码组件对原始图像进行编码得到图像帧后,可以按照视频编码协议(如H.264、H.265、H.266等编码协议)对图像帧进行第一封装;并在按照视频编码协议对图像帧进行第一封装的同时,将图像帧对应的时间信息,封装至图像帧的第一扩展字段中。示例性的,在按照视频编码协议对图像帧进行第一封装的过程中,可以为图像帧封装视频编码协议的信息头(header)(后续称为信息头1(header1))和第一扩展字段(也就是视频编码协议的扩展字段);并将图像帧对应的时间信息,封装在该第一扩展字段中;如图3c(1)所示。Exemplarily, after the encoding component of the first IPC encodes the original image to obtain the image frame, the image frame can be first encapsulated according to a video encoding protocol (such as H.264, H.265, H.266 and other encoding protocols); While first encapsulating the image frame according to the video encoding protocol, time information corresponding to the image frame is encapsulated into the first extension field of the image frame. For example, in the process of first encapsulating the image frame according to the video encoding protocol, the image frame may be encapsulated with the information header (header) of the video encoding protocol (hereinafter referred to as information header 1 (header1)) and the first extension field. (That is, the extension field of the video coding protocol); and the time information corresponding to the image frame is encapsulated in the first extension field; as shown in Figure 3c (1).
这种情况下,图像帧对应的时间信息可以依据编码得到图像帧之前任一时间确定,如编码组件从图像缓存读取待编码的原始图像的时间,又如编码组件编码过程中执行的各种编码步骤的时间,还如编码得到图像帧的时间等等,本申请对此不作限制。In this case, the time information corresponding to the image frame can be determined based on any time before the image frame is obtained by encoding, such as the time when the encoding component reads the original image to be encoded from the image cache, or various various tasks performed by the encoding component during the encoding process. The time of the encoding step, such as the time of encoding the image frame, etc., is not limited in this application.
接着,编码组件可以将第一封装后的图像帧发送给通信组件,由通信组件按照网络传输协议对第一封装后的图像帧进行第二封装,得到第二封装后的图像帧。示例性的,在按照网络传输协议对第一封装后的图像帧进行第二封装的过程中,可以为第一封装后的图像帧封装网络传输协议的信息头(header)(后续称为信息头2(header2))和网络传输协议的扩展字段(后续称为第二扩展字段);如图3c(2)所示。随后,将第二封装后的图像帧发送给服务器。Then, the encoding component can send the first encapsulated image frame to the communication component, and the communication component performs a second encapsulation on the first encapsulated image frame according to the network transmission protocol to obtain a second encapsulated image frame. For example, during the second encapsulation process of the first encapsulated image frame according to the network transmission protocol, the first encapsulated image frame may be encapsulated with a header of the network transmission protocol (hereinafter referred to as the information header). 2 (header2)) and the extension field of the network transmission protocol (hereinafter referred to as the second extension field); as shown in Figure 3c(2). Subsequently, the second encapsulated image frame is sent to the server.
图3d为示例性示出的封装后的图像帧的帧结构示意图。在图3d的实施例中,本申请将图像帧对应的时间信息,封装在网络传输协议的扩展字段中。Figure 3d is a schematic diagram of the frame structure of an encapsulated image frame. In the embodiment of Figure 3d, this application encapsulates the time information corresponding to the image frame in the extension field of the network transmission protocol.
示例性的,第一IPC的编码组件对原始图像进行编码得到图像帧后,可以按照视频编码协议对图像帧进行第一封装,得到第一封装后的图像帧。示例性的,在按照视频编码协议对图像帧进行第一封装的过程中,可以为图像帧封装视频编码协议的信息头(header)(后续称为信息头1(header1))和第一扩展字段(也就是视频编码协议的扩展字段);如图3d(1)所示。For example, after the encoding component of the first IPC encodes the original image to obtain the image frame, the image frame can be first encapsulated according to the video encoding protocol to obtain the first encapsulated image frame. For example, in the process of first encapsulating the image frame according to the video encoding protocol, the image frame may be encapsulated with the information header (header) of the video encoding protocol (hereinafter referred to as information header 1 (header1)) and the first extension field. (That is, the extension field of the video encoding protocol); as shown in Figure 3d(1).
接着,编码组件可以将第一封装后的图像帧发送给通信组件,由通信组件按照网络传输协议对第一封装后的图像帧进行第二封装,并在对第一封装后的图像帧进行第二封装的同时,将图像帧对应的时间信息,封装至图像帧的第二扩展字段中。示例性的,在按照网络传输协议对第一封装后的图像帧进行第二封装的过程中,可以为图像帧封装网络传输协议的信息头(header)(后续称为信息头2(header2))和第二扩展字段(也就是网络传输协议的的扩展字段);并将图像帧对应的时间信息,封装在该第二扩展字段中;如图3d(2)所示。随后,将第二封装后的图像帧发送给服务器。Then, the encoding component can send the first encapsulated image frame to the communication component, and the communication component performs a second encapsulation on the first encapsulated image frame according to the network transmission protocol, and performs a third encapsulation on the first encapsulated image frame. While encapsulating, the time information corresponding to the image frame is encapsulated into the second extension field of the image frame. For example, during the second encapsulation process of the first encapsulated image frame according to the network transmission protocol, the image frame may be encapsulated with a header (header) of the network transmission protocol (hereinafter referred to as header 2 (header2)). and the second extension field (that is, the extension field of the network transmission protocol); and the time information corresponding to the image frame is encapsulated in the second extension field; as shown in Figure 3d(2). Subsequently, the second encapsulated image frame is sent to the server.
这种情况下,图像帧对应的时间信息可以依据对第一封装后的图像帧进行第二封装之前任一时间确定,如编码组件从图像缓存读取原始图像的时间,又如编码组件编码过程中执行的各种编码步骤的时间,又如编码得到图像帧的时间,又如对图像帧进行第一封装的时间等等,本申请对此不作限制。In this case, the time information corresponding to the image frame can be determined based on any time before the second encapsulation of the first encapsulated image frame, such as the time when the encoding component reads the original image from the image cache, or the encoding process of the encoding component The time of various coding steps performed in the process, such as the time of encoding to obtain the image frame, the time of first encapsulation of the image frame, etc., are not limited by this application.
示例性的,第二IPC也可以按照上述方式,通过将图像帧对应的时间信息封装在图像帧的扩展字段中,向服务器发送图像帧和图像帧对应的时间信息,在此不再赘述。For example, the second IPC may also send the image frame and the time information corresponding to the image frame to the server by encapsulating the time information corresponding to the image frame in the extension field of the image frame in the above manner, which will not be described again here.
S304,服务器根据第一IPC发送的图像帧对应的时间信息,以及第二IPC发送的图像帧对应的时间信息,判断第一IPC与第二IPC是否同步。S304: The server determines whether the first IPC and the second IPC are synchronized based on the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC.
示例性的,S304可以参照上述S204的描述,在此不再赘述。 For example, S304 may refer to the description of S204 above, which will not be described again here.
S305,服务器确定第一IPC与第二IPC不同步时,向第一IPC发送编码控制消息。S305: When the server determines that the first IPC and the second IPC are out of synchronization, it sends an encoding control message to the first IPC.
示例性的,针对一个第一IPC,当服务器确定该第一IPC与第二IPC不同步时,可以根据该第一IPC发送的图像帧对应的时间信息,与第二IPC发送的图像帧对应的时间信息之间的时间差,生成编码控制消息(Control Message)。其中,编码控制消息可以包括消息头(header)和时间偏移字段,如图3e所示。时间偏移字段用于携带偏移时间,偏移时间可以根据该第一IPC发送的图像帧对应的时间信息,与第二IPC发送的图像帧对应的时间信息之间的时间差确定。For example, for a first IPC, when the server determines that the first IPC and the second IPC are not synchronized, the time information corresponding to the image frame sent by the first IPC can be compared with the time information corresponding to the image frame sent by the second IPC. The time difference between time information generates a coded control message (Control Message). The encoded control message may include a message header and a time offset field, as shown in Figure 3e. The time offset field is used to carry the offset time. The offset time can be determined based on the time difference between the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC.
一种可能的方式中,偏移时间可以是第二IPC发送的图像帧对应的时间信息,减去第一IPC发送的图像帧对应的时间信息,所得到的时间差。此时,偏移时间可能是正数,也可能是负数。In one possible way, the offset time may be the time difference obtained by subtracting the time information corresponding to the image frame sent by the first IPC from the time information corresponding to the image frame sent by the first IPC. At this time, the offset time may be a positive number or a negative number.
一种可能的方式中,若第二IPC发送的图像帧对应的时间信息,小于第二IPC发送的图像帧对应的时间信息,则第二IPC发送的图像帧对应的时间信息,减去第一IPC发送的图像帧对应的时间信息,所得到的时间差为负数。此时,可以计算时间差加上预设周期的和值,将该和值作为偏移时间。若第二IPC发送的图像帧对应的时间信息,大于第二IPC发送的图像帧对应的时间信息,则第二IPC发送的图像帧对应的时间信息,减去第一IPC发送的图像帧对应的时间信息,所得到的时间差为正数。此时,可以将该时间差作为偏移时间。也就是说,这种方式中,得到的偏移时间均为正数。In one possible way, if the time information corresponding to the image frame sent by the second IPC is less than the time information corresponding to the image frame sent by the second IPC, then the time information corresponding to the image frame sent by the second IPC is minus the first The time information corresponding to the image frame sent by IPC is a negative number. At this time, the sum of the time difference plus the preset period can be calculated, and the sum is used as the offset time. If the time information corresponding to the image frame sent by the second IPC is greater than the time information corresponding to the image frame sent by the second IPC, then the time information corresponding to the image frame sent by the second IPC is subtracted from the time information corresponding to the image frame sent by the first IPC. Time information, the resulting time difference is a positive number. At this time, the time difference can be used as the offset time. In other words, in this way, the offset times obtained are all positive numbers.
一种可能的方式中,若第二IPC发送的图像帧对应的时间信息,大于第二IPC发送的图像帧对应的时间信息,则第二IPC发送的图像帧对应的时间信息,减去第一IPC发送的图像帧对应的时间信息,所得到的时间差为正数。此时,可以计算时间差减去预设周期的差值,将该差值作为偏移时间。若第二IPC发送的图像帧对应的时间信息,小于第二IPC发送的图像帧对应的时间信息,则第二IPC发送的图像帧对应的时间信息,减去第一IPC发送的图像帧对应的时间信息,所得到的时间差为负数。此时,可以将该时间差作为偏移时间。也就是说,这种方式中,得到的偏移时间均为负数。In one possible way, if the time information corresponding to the image frame sent by the second IPC is greater than the time information corresponding to the image frame sent by the second IPC, then the time information corresponding to the image frame sent by the second IPC is minus the first The time information corresponding to the image frame sent by IPC is a positive number. At this time, the time difference minus the preset period can be calculated, and the difference can be used as the offset time. If the time information corresponding to the image frame sent by the second IPC is less than the time information corresponding to the image frame sent by the second IPC, then the time information corresponding to the image frame sent by the second IPC is subtracted from the time information corresponding to the image frame sent by the first IPC. Time information, the resulting time difference is a negative number. At this time, the time difference can be used as the offset time. In other words, in this way, the offset times obtained are all negative numbers.
应该理解的是,本申请对如何确定偏移时间的方式不作限制。It should be understood that this application does not limit the method of determining the offset time.
S306,第一IPC按照偏移时间对读取下一帧待编码的原始图像的时间进行调整。S306: The first IPC adjusts the time for reading the original image to be encoded in the next frame according to the offset time.
示例性的,第一IPC接收到编码控制消息后,可以对编码控制消息进行解析,获取编码控制消息携带的偏移时间。接着,第一IPC根据预设周期,确定读取下一帧待编码的原始图像的时间;然后将读取下一帧待编码的原始图像的时间,移动该偏移时间。这样,第一IPC发送的下一个图像帧和第二IPC发送的下一个图像帧拍摄的画面不会出现时间差,进而实现了第一IPC与第二IPC的帧时间同步。For example, after receiving the encoding control message, the first IPC can parse the encoding control message and obtain the offset time carried in the encoding control message. Then, the first IPC determines the time to read the next frame of the original image to be encoded according to the preset period; then, the time to read the next frame of the original image to be encoded is moved by the offset time. In this way, there will be no time difference between the next image frame sent by the first IPC and the next image frame sent by the second IPC, thereby achieving frame time synchronization between the first IPC and the second IPC.
这样,第一IPC在接收到服务器一次发送编码控制消息,并按照该编码控制消息中偏移时间对读取下一帧待编码的原始图像的时间进行调整后,即可以实现与第二IPC的帧时间同步。也就是说,在图3a的实施例中,对于每个第一IPC,通过一次编码调整,就可以实现与第二IPC的帧时间同步。In this way, after the first IPC receives an encoding control message sent by the server once and adjusts the time to read the original image to be encoded in the next frame according to the offset time in the encoding control message, it can realize communication with the second IPC. Frame time synchronization. That is to say, in the embodiment of Figure 3a, for each first IPC, frame time synchronization with the second IPC can be achieved through one encoding adjustment.
此外,若图像帧的时间信息是依据读取待编码的原始图像的时间确定的,则各IPC发送的各图像帧对应的时间信息,更接近各图像帧拍摄的画面真正发生的时间;这样,服务器确定的第一IPC发送的图像帧对应的时间信息与第二IPC发送的图像帧对应的时间信息之间的时间差更准确,进而服务器向第一IPC发送更少次数的编码调整指示,以及第一IPC执行更少次数的编码调整,即可实现第一IPC与第二IPC的帧时间同步,减少同步第一IPC与第二IPC的帧时间的时长。In addition, if the time information of the image frame is determined based on the time when the original image to be encoded is read, the time information corresponding to each image frame sent by each IPC is closer to the time when the picture captured by each image frame actually occurred; in this way, The time difference between the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC determined by the server is more accurate, and then the server sends fewer encoding adjustment instructions to the first IPC, and the third By performing fewer encoding adjustments on one IPC, the frame time synchronization of the first IPC and the second IPC can be achieved, and the duration of synchronizing the frame time of the first IPC and the second IPC can be reduced.
需要说明的是,对于图3a的实施例而言,对于不具有处理编码控制消息功能的IPC,可以在该IPC中添加处理编码控制消息的服务/应用程序;这样,该IPC即可以完成图3a中S306。从而按照图3a实施例中的步骤与服务器协同,实现帧时间同步。It should be noted that for the embodiment of Figure 3a, for an IPC that does not have the function of processing encoding control messages, a service/application program for processing encoding control messages can be added to the IPC; in this way, the IPC can complete Figure 3a Medium S306. Thereby, it cooperates with the server according to the steps in the embodiment of Figure 3a to achieve frame time synchronization.
图4为示例性示出的同步过程示意图。在图4的实施例中,编码调整指示为编码重启消息。Figure 4 is a schematic diagram illustrating an exemplary synchronization process. In the embodiment of Figure 4, the coding adjustment indication is a coding restart message.
S401,IPC读取待编码的原始图像。S401, IPC reads the original image to be encoded.
示例性的,S401包括S401a和S401b:For example, S401 includes S401a and S401b:
S401a,第一IPC读取待编码的原始图像。S401a, the first IPC reads the original image to be encoded.
S401b,第二IPC读取待编码的原始图像。S401b: The second IPC reads the original image to be encoded.
S402,IPC将原始图像编码为图像帧,以及确定图像帧对应的时间信息。S402, IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
示例性的,S402包括S402a和S402b: Exemplarily, S402 includes S402a and S402b:
S402a,第一IPC将原始图像编码为图像帧,以及确定图像帧对应的时间信息。S402a: The first IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
S402b,第二IPC将原始图像编码为图像帧,以及确定图像帧对应的时间信息。S402b: The second IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
示例性的,S401~S402,可以参照上述S201~S202的描述,在此不再赘述。For example, for S401 to S402, reference may be made to the description of S201 to S202 above, which will not be described again here.
S403,IPC向服务器发送图像帧和图像帧对应的时间信息。S403. The IPC sends the image frame and the time information corresponding to the image frame to the server.
示例性的,S403包括S403a和S403b:Exemplarily, S403 includes S403a and S403b:
S403a,第一IPC向服务器发送图像帧和图像帧对应的时间信息。S403a: The first IPC sends the image frame and time information corresponding to the image frame to the server.
S403b,第二IPC向服务器发送图像帧和图像帧对应的时间信息。S403b: The second IPC sends the image frame and time information corresponding to the image frame to the server.
示例性的,S403可以参照上述S303的描述,在此不再赘述。For example, S403 may refer to the description of S303 above, which will not be described again here.
S404,服务器根据第一IPC发送的图像帧对应的时间信息,以及第二IPC发送的图像帧对应的时间信息,判断第一IPC与第二IPC是否同步。S404: The server determines whether the first IPC and the second IPC are synchronized based on the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC.
示例性的,S404可以参照上述S204的描述,在此不再赘述。For example, S404 may refer to the description of S204 above, which will not be described again here.
S405,服务器确定第一IPC与第二IPC不同步时,向第一IPC发送编码重启消息。S405: When the server determines that the first IPC and the second IPC are out of synchronization, it sends an encoding restart message to the first IPC.
示例性的,编码重启消息(Restart Message),用于触发第一IPC进行编码重启,也就是重启编码组件。For example, the encoding restart message (Restart Message) is used to trigger the first IPC to restart encoding, that is, to restart the encoding component.
S406,第一IPC根据编码重启消息进行编码重启。S406: The first IPC performs encoding restart according to the encoding restart message.
示例性的,第一IPC接收到编码重启消息后,可以重启编码组件;编码组件在重启成功后,即可以开始从图像缓存中获取下一帧待编码的原始图像,然后执行上述S402~S403。这样,第一IPC从图像缓存中读取下一帧待编码的原始图像的时间,被调整为了编码重启成功时间。For example, after receiving the encoding restart message, the first IPC can restart the encoding component; after the encoding component restarts successfully, it can start to obtain the next frame of original image to be encoded from the image cache, and then execute the above S402-S403. In this way, the time for the first IPC to read the next frame of the original image to be encoded from the image cache is adjusted to the encoding restart success time.
需要说明的是,一种情况可以是,第一IPC进行此次编码重启后,其从图像缓存读取下一帧待编码的原始图像的时间,与第二IPC从图像缓存读取下一帧待编码的原始图像的时间相同;这样,该第一IPC再次执行完S401a~S403a,以及第二IPC再次执行完S401b~S403b后,服务器可以接收该第一IPC发送的下一个图像帧和图像帧对应的时间信息,以及第二IPC发送的下一个图像帧和图像帧对应的时间信息,并可以确定该第一IPC与第二IPC的帧时间同步,无需再生成编码重启消息。也就是说,第一IPC经过一次编码重启,即可实现与第二IPC的帧时间同步。It should be noted that one situation may be that after the first IPC restarts encoding, the time when it reads the next frame of the original image to be encoded from the image cache is the same as the time when the second IPC reads the next frame from the image cache. The time of the original image to be encoded is the same; in this way, after the first IPC completes S401a to S403a again, and the second IPC completes S401b to S403b again, the server can receive the next image frame and image frame sent by the first IPC The corresponding time information, as well as the next image frame sent by the second IPC and the time information corresponding to the image frame, and the frame time synchronization of the first IPC and the second IPC can be determined without generating a coding restart message. In other words, the first IPC can achieve frame time synchronization with the second IPC after a coding restart.
一种情况可以是,第一IPC进行此次编码重启后,其从图像缓存读取下一帧待编码的原始图像的时间,与第二IPC从图像缓存读取下一帧待编码的原始图像的时间仍然不相同;这样,该第一IPC再次执行完S401a~S403a,以及第二IPC再次执行完S401b~S403b后,服务器可以接收该第一IPC发送的下一个图像帧和图像帧对应的时间信息,以及第二IPC发送的下一个图像帧和图像帧对应的时间信息;并可以确定该第一IPC与第二IPC的帧时间不同步,此时服务器可以再次向第一IPC发送编码重启消息,然后该第一IPC再次根据编码重启消息进行编码重启。如此循环往复,直至该第一IPC与第二IPC的帧时间同步为止。也就是说,第一IPC需要经过多次编码重启,才可实现与第二IPC的帧时间同步。One situation may be that after the first IPC restarts encoding, the time when it reads the next frame of the original image to be encoded from the image cache is the same as the time when the second IPC reads the next frame of the original image to be encoded from the image cache. The times are still different; in this way, after the first IPC finishes executing S401a~S403a again, and the second IPC finishes executing S401b~S403b again, the server can receive the next image frame and the time corresponding to the image frame sent by the first IPC information, as well as the next image frame and the time information corresponding to the image frame sent by the second IPC; and it can be determined that the frame time of the first IPC and the second IPC is not synchronized. At this time, the server can send the encoding restart message to the first IPC again. , and then the first IPC performs coding restart according to the coding restart message again. This cycle repeats until the frame times of the first IPC and the second IPC are synchronized. In other words, the first IPC needs to undergo multiple encoding restarts before it can achieve frame time synchronization with the second IPC.
也就是说,在图4的实施例中,第一IPC需要经过一次或多次的编码重启,才能够实现与第二IPC的帧时间同步。That is to say, in the embodiment of FIG. 4 , the first IPC needs to undergo one or more encoding restarts before it can achieve frame time synchronization with the second IPC.
图5为示例性示出的同步过程示意图。在图5的实施例中,编码调整指示为编码刷新消息。Figure 5 is a schematic diagram illustrating an exemplary synchronization process. In the embodiment of Figure 5, the encoding adjustment indication is a encoding refresh message.
S501,开始时,IPC读取待编码的原始图像。S501: At the beginning, the IPC reads the original image to be encoded.
示例性的,S501包括S501a和S501b:For example, S501 includes S501a and S501b:
S501a,开始时,第一IPC读取待编码的原始图像。S501a, at the beginning, the first IPC reads the original image to be encoded.
S501b,开始时,第二IPC读取待编码的原始图像。S501b, at the beginning, the second IPC reads the original image to be encoded.
S502,IPC将原始图像编码为图像帧,以及确定图像帧对应的时间信息。S502, IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
示例性的,S502包括S502a和S502b:Exemplarily, S502 includes S502a and S502b:
S502a,第一IPC将原始图像编码为图像帧,以及确定图像帧对应的时间信息。S502a: The first IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
S502b,第二IPC将原始图像编码为图像帧,以及确定图像帧对应的时间信息。S502b: The second IPC encodes the original image into an image frame, and determines the time information corresponding to the image frame.
示例性的,S501~S502,可以参照上述S201~S202的描述,在此不再赘述。 For example, for S501 to S502, reference may be made to the description of S201 to S202 above, which will not be described again here.
S503,IPC向服务器发送图像帧和图像帧对应的时间信息。S503. The IPC sends the image frame and the time information corresponding to the image frame to the server.
示例性的,S503包括S503a和S503b:Exemplarily, S503 includes S503a and S503b:
S503a,第一IPC向服务器发送图像帧和图像帧对应的时间信息。S503a: The first IPC sends the image frame and time information corresponding to the image frame to the server.
S503b,第二IPC向服务器发送图像帧和图像帧对应的时间信息。S503b: The second IPC sends the image frame and time information corresponding to the image frame to the server.
示例性的,S503可以参照上述S303的描述,在此不再赘述。For example, S503 may refer to the description of S303 above, which will not be described again here.
S504,服务器根据第一IPC发送的图像帧对应的时间信息,以及第二IPC发送的图像帧对应的时间信息,判断第一IPC与第二IPC是否同步。S504: The server determines whether the first IPC and the second IPC are synchronized based on the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC.
示例性的,S504可以参照上述S204的描述,在此不再赘述。For example, S504 may refer to the description of S204 above, which will not be described again here.
S505,服务器确定第一IPC与第二IPC不同步时,向第一IPC发送编码刷新消息。S505: When the server determines that the first IPC and the second IPC are out of synchronization, it sends a coding refresh message to the first IPC.
示例性的,编码刷新消息(Refresh Messgae),用于触发第一IPC进行帧刷新,也就用于触发第一IPC中编码组件进行帧刷新。For example, the encoding refresh message (Refresh Messgae) is used to trigger the first IPC to perform frame refresh, and is also used to trigger the encoding component in the first IPC to perform frame refresh.
S506,第一IPC根据编码刷新消息进行帧刷新。S506: The first IPC performs frame refresh according to the coding refresh message.
示例性的,第一IPC接收到编码刷新消息后,可以触发编码组件进行帧刷新,即触发编码组件立即编码一个图像帧,此时,编码组件可以立即从图像缓存中获取下一帧待编码的原始图像,然后执行上述S502~S503。这样,第一IPC从图像缓存中读取下一帧待编码的原始图像的时间,被调整为了当前时间。For example, after receiving the encoding refresh message, the first IPC can trigger the encoding component to perform frame refresh, that is, trigger the encoding component to immediately encode an image frame. At this time, the encoding component can immediately obtain the next frame to be encoded from the image cache. original image, and then execute the above S502~S503. In this way, the time when the first IPC reads the next frame of the original image to be encoded from the image buffer is adjusted to the current time.
需要说明的是,一种情况可以是,第一IPC进行此次编码刷新后,其从图像缓存读取下一帧待编码的原始图像的时间,与第二IPC从图像缓存读取下一帧待编码的原始图像的时间相同;这样,该第一IPC再次执行完S501a~S503a,以及第二IPC再次执行完S501b~S503b后,服务器可以接收该第一IPC发送的下一个图像帧和图像帧对应的时间信息,以及第二IPC发送的下一个图像帧和图像帧对应的时间信息,并可以确定该第一IPC与第二IPC的帧时间同步,无需再生成编码刷新消息。也就是说,第一IPC经过一次帧刷新,即可实现与第二IPC的帧时间同步。It should be noted that one situation may be that after the first IPC performs this encoding refresh, the time when it reads the next frame of the original image to be encoded from the image cache is the same as the time when the second IPC reads the next frame from the image cache. The time of the original image to be encoded is the same; in this way, after the first IPC completes S501a ~ S503a again, and the second IPC completes S501b ~ S503b again, the server can receive the next image frame and image frame sent by the first IPC The corresponding time information, as well as the next image frame sent by the second IPC and the time information corresponding to the image frame can be determined, and the frame time synchronization of the first IPC and the second IPC can be determined without generating a coding refresh message. In other words, the first IPC can achieve frame time synchronization with the second IPC after one frame refresh.
一种情况可以是,第一IPC进行此次编码刷新后,其从图像缓存读取下一帧待编码的原始图像的时间,与第二IPC从图像缓存读取下一帧待编码的原始图像的时间仍然不相同;这样,该第一IPC再次执行完S501a~S503a,以及第二IPC再次执行完S501b~S503b后,服务器可以接收该第一IPC发送的下一个图像帧和图像帧对应的时间信息,以及第二IPC发送的下一个图像帧和图像帧对应的时间信息;并可以确定该第一IPC与第二IPC的帧时间不同步,此时服务器可以再次向第一IPC发送编码刷新消息,然后该第一IPC再次根据编码刷新消息进行编码刷新。如此循环往复,直至该第一IPC与第二IPC的帧时间同步为止。也就是说,第一IPC经过多次帧刷新,才可实现与第二IPC的帧时间同步。One situation may be that after the first IPC performs this encoding refresh, the time when it reads the next frame of original image to be encoded from the image cache is the same as the time when the second IPC reads the next frame of original image to be encoded from the image cache. The times are still different; in this way, after the first IPC finishes executing S501a~S503a again, and the second IPC finishes executing S501b~S503b again, the server can receive the next image frame and the time corresponding to the image frame sent by the first IPC information, as well as the next image frame sent by the second IPC and the time information corresponding to the image frame; and it can be determined that the frame time of the first IPC and the second IPC is not synchronized. At this time, the server can send a coding refresh message to the first IPC again. , and then the first IPC performs encoding refresh according to the encoding refresh message again. This cycle repeats until the frame times of the first IPC and the second IPC are synchronized. In other words, the first IPC can achieve frame time synchronization with the second IPC after multiple frame refreshes.
也就是说,在图5的实施例中,第一IPC需要通过一次或多次的帧刷新,才可以实现与第二IPC的帧时间同步。That is to say, in the embodiment of FIG. 5 , the first IPC needs one or more frame refreshes to achieve frame time synchronization with the second IPC.
需要说明的是,现有IPC具有编码重启功能和编码刷新功能,因此可以执行图4实施例中的S406和图5实施例中的S506。这样多个IPC按照图4实施例中的步骤与服务器协同,或者按照图5实施例中的步骤与服务器协同,即可实现帧时间同步。It should be noted that the existing IPC has a coding restart function and a coding refresh function, so S406 in the embodiment of FIG. 4 and S506 in the embodiment of FIG. 5 can be executed. In this way, multiple IPCs cooperate with the server according to the steps in the embodiment of Figure 4, or cooperate with the server according to the steps in the embodiment of Figure 5, so that frame time synchronization can be achieved.
需要说明的是,服务器可以按照设定时长对多个IPC的帧时间进行周期性同步,其中,设定时长可以按照需求设置,可以大于预设周期,本申请对此不作限制。It should be noted that the server can periodically synchronize the frame times of multiple IPCs according to a set time period. The set time period can be set according to requirements and can be greater than the preset period. This application does not limit this.
图6为示例性示出的同步系统示意图。在图6的实施例中,图6中的同步系统可以包括多个IPC和服务器,多个IPC可以包括至少一个第一IPC和一个第二IPC,第二IPC是第一IPC与第二IPC的帧时间是否同步的参考;其中,Figure 6 is a schematic diagram of an exemplary synchronization system. In the embodiment of Figure 6, the synchronization system in Figure 6 may include multiple IPCs and servers. The multiple IPCs may include at least a first IPC and a second IPC. The second IPC is a combination of the first IPC and the second IPC. Reference for frame time synchronization; where,
第一IPC,用于读取待编码的第一原始图像;将第一原始图像编码为第一图像帧,以及确定第一图像帧对应的时间信息;向服务器发送第一图像帧和第一图像帧对应的时间信息;以及接收编码调整指示;根据编码调整指示进行编码调整;The first IPC is used to read the first original image to be encoded; encode the first original image into a first image frame, and determine the time information corresponding to the first image frame; send the first image frame and the first image to the server Time information corresponding to the frame; and receiving coding adjustment instructions; performing coding adjustments according to the coding adjustment instructions;
第二IPC,用于读取待编码的第二原始图像;将第二原始图像编码为第二图像帧,以及确定第二图像帧对应的时间信息;向服务器发送第二图像帧和第二图像帧对应的时间信息; The second IPC is used to read the second original image to be encoded; encode the second original image into a second image frame, and determine the time information corresponding to the second image frame; send the second image frame and the second image to the server The time information corresponding to the frame;
服务器,用于接收第一IPC发送的第一图像帧和第一图像帧对应的时间信息,以及接收第二IPC发送的第二图像帧和第二图像帧对应的时间信息;当根据第一IPC发送的第一图像帧对应的时间信息,以及第二IPC发送的第二图像帧对应的时间信息,确定第一IPC与第二IPC的帧时间不同步时,向第一IPC发送编码调整指示。The server is configured to receive the first image frame sent by the first IPC and the time information corresponding to the first image frame, and to receive the second image frame sent by the second IPC and the time information corresponding to the second image frame; when according to the first IPC When the time information corresponding to the first image frame sent and the time information corresponding to the second image frame sent by the second IPC are determined to be out of sync between the frame times of the first IPC and the second IPC, a coding adjustment instruction is sent to the first IPC.
示例性的,服务器,用于向第一IPC发送编码控制消息;其中,编码控制消息包括偏移时间,偏移时间依据第一IPC发送的第一图像帧对应的时间信息,与第二IPC发送的第二图像帧对应的时间信息之间的时间差确定;编码控制消息用于触发第一IPC根据偏移时间对获取下一帧待编码的第一原始图像的时间进行调整。Exemplarily, the server is configured to send a coding control message to the first IPC; wherein the coding control message includes an offset time, and the offset time is based on the time information corresponding to the first image frame sent by the first IPC, and is different from the time information sent by the second IPC. The time difference between the time information corresponding to the second image frame is determined; the encoding control message is used to trigger the first IPC to adjust the time to obtain the first original image to be encoded in the next frame according to the offset time.
示例性的,服务器,用于向第一IPC发送编码重启消息,编码重启消息用于触发第一IPC进行编码重启。Exemplarily, the server is configured to send an encoding restart message to the first IPC, and the encoding restart message is used to trigger the first IPC to restart encoding.
示例性的,服务器,用于向第一IPC发送编码刷新消息,编码刷新消息用于触发第一IPC进行帧刷新。Exemplarily, the server is configured to send a coding refresh message to the first IPC, and the coding refresh message is used to trigger the first IPC to refresh the frame.
示例性的,若第一IPC发送的第一图像帧对应的同步时间信息,和第二IPC发送的第二图像帧对应的同步时间信息之间的时间差大于阈值,则确定第一IPC与第二IPC的帧时间不同步。For example, if the time difference between the synchronization time information corresponding to the first image frame sent by the first IPC and the synchronization time information corresponding to the second image frame sent by the second IPC is greater than the threshold, it is determined that the first IPC and the second The frame time of IPC is not synchronized.
示例性的,第一IPC,用于依据读取待编码的第一原始图像的时间,确定第一图像帧对应的时间信息。Exemplarily, the first IPC is used to determine the time information corresponding to the first image frame based on the time when the first original image to be encoded is read.
示例性的,第一IPC,用于将第一图像帧对应的时间信息封装至第一图像帧的扩展字段中,发送封装后的第一图像帧。Exemplarily, the first IPC is used to encapsulate the time information corresponding to the first image frame into an extension field of the first image frame, and send the encapsulated first image frame.
示例性的,编码调整指示为编码控制消息,编码控制消息包括偏移时间,偏移时间依据第一IPC发送的第一图像帧对应的时间信息与第二IPC发送的第二图像帧对应的时间信息之间的时间差确定;第一IPC,用于依据偏移时间对读取下一帧待编码的第一原始图像的时间进行调整。Exemplarily, the coding adjustment indication is a coding control message, and the coding control message includes an offset time. The offset time is based on the time information corresponding to the first image frame sent by the first IPC and the time corresponding to the second image frame sent by the second IPC. The time difference between the information is determined; the first IPC is used to adjust the time to read the first original image to be encoded in the next frame according to the offset time.
示例性的,编码调整指示为编码重启消息;第一IPC,用于根据编码重启消息进行编码重启。For example, the coding adjustment indication is a coding restart message; the first IPC is used to restart coding according to the coding restart message.
示例性的,编码调整指示为编码刷新消息,第一IPC,用于根据编码刷新消息进行帧刷新。Exemplarily, the coding adjustment indication is a coding refresh message, and the first IPC is used to refresh the frame according to the coding refresh message.
示例性的,第二IPC,用于依据读取待编码的第二原始图像的时间,确定第二图像帧对应的时间信息。Exemplarily, the second IPC is used to determine the time information corresponding to the second image frame based on the time when the second original image to be encoded is read.
示例性的,第二IPC,用于将第二图像帧对应的时间信息封装至第二图像帧的扩展字段中,发送封装后的第二图像帧。Exemplarily, the second IPC is used to encapsulate the time information corresponding to the second image frame into an extension field of the second image frame, and send the encapsulated second image frame.
应该理解的是,服务器以及IPC所执行的步骤的技术效果可参见上述图2、图3a、图4和图5中任一实施例所描述的技术效果,此处不再赘述。It should be understood that the technical effects of the steps performed by the server and the IPC can be referred to the technical effects described in any of the embodiments in Figure 2, Figure 3a, Figure 4 and Figure 5, and will not be described again here.
一个示例中,图7示出了本申请实施例的一种装置700的示意性框图装置700可包括:处理器701和收发器/收发管脚702,可选地,还包括存储器703。In one example, FIG. 7 shows a schematic block diagram of a device 700 according to an embodiment of the present application. The device 700 may include: a processor 701 and a transceiver/transceiver pin 702, and optionally, a memory 703.
装置700的各个组件通过总线704耦合在一起,其中总线704除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图中将各种总线都称为总线704。The various components of device 700 are coupled together by bus 704, which includes, in addition to a data bus, a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are referred to as bus 704 in the figure.
可选地,存储器703可以用于存储前述方法实施例中的指令。该处理器701可用于执行存储器703中的指令,并控制接收管脚接收信号,以及控制发送管脚发送信号。Optionally, the memory 703 may be used to store instructions in the foregoing method embodiments. The processor 701 can be used to execute instructions in the memory 703, and control the receiving pin to receive signals, and control the transmitting pin to send signals.
装置700可以是上述方法实施例中的电子设备或电子设备的芯片。The device 700 may be the electronic device or a chip of the electronic device in the above method embodiment.
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。All relevant content of each step involved in the above method embodiments can be quoted from the functional description of the corresponding functional module, and will not be described again here.
本实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的同步方法。This embodiment also provides a computer-readable storage medium. Computer instructions are stored in the computer-readable storage medium. When the computer instructions are run on an electronic device, the electronic device causes the electronic device to execute the above-mentioned related method steps to implement the above-mentioned embodiments. sync method.
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的同步方法。 This embodiment also provides a computer program product. When the computer program product is run on a computer, it causes the computer to perform the above related steps to implement the synchronization method in the above embodiment.
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的同步方法。In addition, embodiments of the present application also provide a device. This device may be a chip, a component or a module. The device may include a connected processor and a memory. The memory is used to store computer execution instructions. When the device is running, The processor can execute computer execution instructions stored in the memory, so that the chip executes the synchronization method in each of the above method embodiments.
其中,本实施例提供的电子设备、计算机可读存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Among them, the electronic devices, computer-readable storage media, computer program products or chips provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the above provided The beneficial effects of the corresponding methods will not be described again here.
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In practical applications, the above functions can be allocated to different modules according to needs. The functional module is completed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another device, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。A unit described as a separate component may or may not be physically separate. A component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place, or it may be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in various embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.
本申请各个实施例的任意内容,以及同一实施例的任意内容,均可以自由组合。对上述内容的任意组合均在本申请的范围之内。Any contents of various embodiments of this application, as well as any contents of the same embodiment, can be freely combined. Any combination of the above is within the scope of this application.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。Integrated units may be stored in a readable storage medium if they are implemented in the form of software functional units and sold or used as independent products. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or contribute to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium , including several instructions to cause a device (which can be a microcontroller, a chip, etc.) or a processor to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Inspired by this application, many forms can be made without departing from the purpose of this application and the scope protected by the claims, all of which fall within the protection of this application.
结合本申请实施例公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(Random Access Memory,RAM)、闪存、只读存储器(Read Only Memory,ROM)、可擦除可编程只读存储器(Erasable Programmable ROM,EPROM)、电可擦可编程只读存储器(Electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。The steps of the methods or algorithms described in connection with the disclosure of the embodiments of this application can be implemented in hardware or by a processor executing software instructions. Software instructions can be composed of corresponding software modules. Software modules can be stored in random access memory (Random Access Memory, RAM), flash memory, read only memory (Read Only Memory, ROM), erasable programmable read only memory ( Erasable Programmable ROM (EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), register, hard disk, removable hard disk, compact disc (CD-ROM) or any other form of storage media well known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage media may be located in an ASIC.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机可读存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。 Those skilled in the art should realize that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes computer-readable storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. Storage media can be any available media that can be accessed by a general purpose or special purpose computer.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。 The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Inspired by this application, many forms can be made without departing from the purpose of this application and the scope protected by the claims, all of which fall within the protection of this application.

Claims (20)

  1. 一种同步方法,其特征在于,所述方法包括:A synchronization method, characterized in that the method includes:
    服务器接收多个网络摄像机IPC发送的图像帧,以及所述图像帧对应的时间信息,其中,所述图像帧是通过对原始图像进行编码得到,所述多个IPC包括第一IPC和第二IPC,所述第二IPC是所述第一IPC与所述第二IPC的帧时间是否同步的参考;The server receives image frames sent by multiple network cameras IPC, and time information corresponding to the image frames, wherein the image frames are obtained by encoding the original images, and the multiple IPCs include a first IPC and a second IPC. , the second IPC is a reference for whether the frame time of the first IPC and the second IPC is synchronized;
    当所述服务器根据所述第一IPC发送的图像帧对应的时间信息,以及所述第二IPC发送的图像帧对应的时间信息,确定所述第一IPC与所述第二IPC的帧时间不同步时,所述服务器向所述第一IPC发送编码调整指示,所述编码调整指示用于触发所述第一IPC进行编码调整,以使所述第一IPC读取下一帧待编码的原始图像的时间发生调整。When the server determines that the frame time of the first IPC and the second IPC are different based on the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC. During synchronization, the server sends a coding adjustment indication to the first IPC. The coding adjustment indication is used to trigger the first IPC to perform coding adjustment so that the first IPC reads the original to be coded in the next frame. The timing of the image is adjusted.
  2. 根据权利要求1所述的方法,其特征在于,所述服务器向所述第一IPC发送编码调整指示,包括:The method according to claim 1, characterized in that the server sends a coding adjustment instruction to the first IPC, including:
    所述服务器向所述第一IPC发送编码控制消息;The server sends an encoding control message to the first IPC;
    其中,所述编码控制消息包括偏移时间,所述偏移时间是所述服务器依据所述第一IPC发送的图像帧对应的时间信息,与所述第二IPC发送的图像帧对应的时间信息之间的时间差确定的;所述编码控制消息用于触发所述第一IPC根据所述偏移时间对获取下一帧待编码的原始图像的时间进行调整。Wherein, the encoding control message includes an offset time, the offset time is the time information corresponding to the image frame sent by the server according to the first IPC, and the time information corresponding to the image frame sent by the second IPC The time difference between the two frames is determined; the encoding control message is used to trigger the first IPC to adjust the time to acquire the next frame of the original image to be encoded according to the offset time.
  3. 根据权利要求1所述的方法,其特征在于,所述服务器向所述第一IPC发送编码调整指示,包括:The method according to claim 1, characterized in that the server sends a coding adjustment instruction to the first IPC, including:
    所述服务器向所述第一IPC发送编码重启消息,所述编码重启消息用于触发所述第一IPC进行编码重启。The server sends an encoding restart message to the first IPC, where the encoding restart message is used to trigger the first IPC to restart encoding.
  4. 根据权利要求1所述的方法,其特征在于,所述服务器向所述第一IPC发送编码调整指示,包括:The method according to claim 1, characterized in that the server sends a coding adjustment instruction to the first IPC, including:
    所述服务器向所述第一IPC发送编码刷新消息,所述编码刷新消息用于触发所述第一IPC进行帧刷新。The server sends a coding refresh message to the first IPC, where the coding refresh message is used to trigger the first IPC to refresh the frame.
  5. 根据权利要求1至4任一项所述的方法,其特征在于,所述确定所述第一IPC与所述第二IPC的帧时间不同步,包括:The method according to any one of claims 1 to 4, wherein determining that the frame time of the first IPC and the second IPC is out of synchronization includes:
    所述服务器确定所述第一IPC发送的图像帧对应的时间信息,和所述第二IPC发送的图像帧对应的时间信息之间的时间差大于阈值。The server determines that the time difference between the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC is greater than a threshold.
  6. 根据权利要求1至5任一项所述的方法,其特征在于,The method according to any one of claims 1 to 5, characterized in that,
    所述多个IPC中各IPC发送的图像帧对应的时间信息,为所述各IPC读取待编码的原始图像的时间。The time information corresponding to the image frame sent by each IPC among the plurality of IPCs is the time at which each IPC reads the original image to be encoded.
  7. 一种同步方法,其特征在于,所述方法包括:A synchronization method, characterized in that the method includes:
    第一网络摄像机IPC读取待编码的原始图像;The first network camera IPC reads the original image to be encoded;
    所述第一IPC将所述原始图像编码为图像帧,以及所述第一IPC确定所述图像帧对应的时间信息;The first IPC encodes the original image into an image frame, and the first IPC determines the time information corresponding to the image frame;
    所述第一IPC发送所述图像帧和所述图像帧对应的时间信息;The first IPC sends the image frame and time information corresponding to the image frame;
    所述第一IPC接收编码调整指示,所述编码调整指示是服务器根据所述第一IPC发送的图像帧对应的时间信息以及第二IPC发送的图像帧对应的时间信息,确定所述第一IPC与所述第二IPC的帧时间不同步时生成并发送的,所述第二IPC是所述第一IPC与所述第二IPC的帧时间是否同步的参考;The first IPC receives a coding adjustment indication, and the coding adjustment indication is that the server determines the first IPC based on the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC. Generated and sent when the frame time of the second IPC is not synchronized, the second IPC is a reference for whether the frame time of the first IPC and the second IPC are synchronized;
    所述第一IPC根据所述编码调整指示进行编码调整,以使所述第一IPC读取下一帧待编码的原始 图像的时间发生调整。The first IPC performs encoding adjustment according to the encoding adjustment instruction, so that the first IPC reads the original to be encoded in the next frame. The timing of the image is adjusted.
  8. 根据权利要求7所述的方法,其特征在于,所述第一IPC确定所述图像帧对应的时间信息,包括:The method of claim 7, wherein the first IPC determines the time information corresponding to the image frame, including:
    所述第一IPC依据读取待编码的原始图像的时间,确定所述图像帧对应的时间信息。The first IPC determines the time information corresponding to the image frame based on the time when the original image to be encoded is read.
  9. 根据权利要求7或8所述的方法,其特征在于,所述第一IPC发送所述图像帧和所述图像帧对应的时间信息,包括:The method according to claim 7 or 8, characterized in that the first IPC sends the image frame and the time information corresponding to the image frame, including:
    所述第一IPC将所述图像帧对应的时间信息封装至所述图像帧的扩展字段中,发送所述封装后的图像帧。The first IPC encapsulates the time information corresponding to the image frame into an extension field of the image frame, and sends the encapsulated image frame.
  10. 根据权利要求7至9任一项所述的方法,其特征在于,所述编码调整指示为编码控制消息,所述编码控制消息包括偏移时间,所述偏移时间是所述服务器依据所述第一IPC发送的所述图像帧对应的时间信息与所述第二IPC发送的图像帧对应的时间信息之间的时间差确定的;The method according to any one of claims 7 to 9, characterized in that the encoding adjustment indication is an encoding control message, the encoding control message includes an offset time, and the offset time is the time specified by the server according to the The time difference between the time information corresponding to the image frame sent by the first IPC and the time information corresponding to the image frame sent by the second IPC is determined;
    所述第一IPC根据所述编码调整指示进行编码调整,包括:The first IPC performs encoding adjustment according to the encoding adjustment instruction, including:
    所述第一IPC根据所述偏移时间对读取下一帧待编码的原始图像的时间进行调整。The first IPC adjusts the time to read the original image to be encoded in the next frame according to the offset time.
  11. 根据权利要求7至9任一项所述的方法,其特征在于,所述编码调整指示为编码重启消息,所述第一IPC根据所述编码调整指示进行编码调整,包括:The method according to any one of claims 7 to 9, characterized in that the coding adjustment indication is a coding restart message, and the first IPC performs coding adjustment according to the coding adjustment indication, including:
    所述第一IPC根据所述编码重启消息进行编码重启。The first IPC performs encoding restart according to the encoding restart message.
  12. 根据权利要求7至9任一项所述的方法,其特征在于,所述编码调整指示为编码刷新消息,所述第一IPC根据所述编码调整指示进行编码调整,包括:The method according to any one of claims 7 to 9, characterized in that the coding adjustment indication is a coding refresh message, and the first IPC performs coding adjustment according to the coding adjustment indication, including:
    所述第一IPC根据所述编码刷新消息进行帧刷新。The first IPC performs frame refresh according to the encoding refresh message.
  13. 一种同步系统,其特征在于,所述帧时间同步系统包括:多个网络摄像机IPC和服务器,所述多个IPC包括第一IPC和第二IPC,所述第二IPC是所述第一IPC与所述第二IPC的帧时间是否同步的参考;A synchronization system, characterized in that the frame time synchronization system includes: multiple network camera IPCs and servers, the multiple IPCs include a first IPC and a second IPC, the second IPC is the first IPC A reference to whether the frame time of the second IPC is synchronized;
    所述第一IPC,用于读取待编码的第一原始图像;将所述第一原始图像编码为第一图像帧,以及确定所述第一图像帧对应的时间信息;向所述服务器发送所述第一图像帧和所述第一图像帧对应的时间信息;以及接收编码调整指示;根据所述编码调整指示进行编码调整,以使读取下一帧待编码的第一原始图像的时间发生调整。The first IPC is used to read the first original image to be encoded; encode the first original image into a first image frame, and determine the time information corresponding to the first image frame; send to the server The first image frame and the time information corresponding to the first image frame; and receiving an encoding adjustment instruction; performing encoding adjustment according to the encoding adjustment instruction so as to read the time of the first original image to be encoded in the next frame Adjustments occur.
    所述第二IPC,用于读取待编码的第二原始图像;将所述第二原始图像编码为第二图像帧,以及确定所述第二图像帧对应的时间信息;向所述服务器发送所述第二图像帧和所述第二图像帧对应的时间信息;The second IPC is used to read the second original image to be encoded; encode the second original image into a second image frame, and determine the time information corresponding to the second image frame; send to the server The second image frame and the time information corresponding to the second image frame;
    所述服务器,用于接收第一IPC发送的第一图像帧和所述第一图像帧对应的时间信息,以及接收第二IPC发送的第二图像帧和所述第二图像帧对应的时间信息;当根据所述第一IPC发送的第一图像帧对应的时间信息,以及所述第二IPC发送的第二图像帧对应的时间信息,确定所述第一IPC与所述第二IPC的帧时间不同步时,向所述第一IPC发送编码调整指示。The server is configured to receive the first image frame sent by the first IPC and the time information corresponding to the first image frame, and to receive the second image frame sent by the second IPC and the time information corresponding to the second image frame. ; When the frames of the first IPC and the second IPC are determined according to the time information corresponding to the first image frame sent by the first IPC and the time information corresponding to the second image frame sent by the second IPC. When the time is not synchronized, a coding adjustment instruction is sent to the first IPC.
  14. 一种网络摄像机IPC,其特征在于,用于执行上述权利要求7至权利要求12任一项所述的同步方法。A network camera IPC, characterized in that it is used to perform the synchronization method described in any one of the above claims 7 to 12.
  15. 一种电子设备,其特征在于,包括:An electronic device, characterized by including:
    存储器和处理器,所述存储器与所述处理器耦合; a memory and a processor, the memory coupled to the processor;
    所述存储器存储有程序指令,当所述程序指令由所述处理器执行时,使得所述电子设备执行权利要求1至权利要求6中任一服务器所执行的同步方法。The memory stores program instructions that, when executed by the processor, cause the electronic device to execute the synchronization method executed by any server in claims 1 to 6.
  16. 一种电子设备,其特征在于,包括:An electronic device, characterized by including:
    存储器和处理器,所述存储器与所述处理器耦合;a memory and a processor, the memory coupled to the processor;
    所述存储器存储有程序指令,当所述程序指令由所述处理器执行时,使得所述电子设备执行权利要求7至权利要求12中任一第一IPC所执行的同步方法。The memory stores program instructions that, when executed by the processor, cause the electronic device to execute the synchronization method executed by any one of the first IPCs in claims 7 to 12.
  17. 一种芯片,其特征在于,包括一个或多个接口电路和一个或多个处理器;所述接口电路用于从电子设备的存储器接收信号,并向所述处理器发送所述信号,所述信号包括存储器中存储的计算机指令;当所述处理器执行所述计算机指令时,使得所述电子设备执行权利要求1至权利要求6中任一服务器所执行的同步方法。A chip, characterized in that it includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from a memory of an electronic device and send the signals to the processor, and the The signal includes computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device is caused to perform the synchronization method performed by any server in claims 1 to 6.
  18. 一种芯片,其特征在于,包括一个或多个接口电路和一个或多个处理器;所述接口电路用于从电子设备的存储器接收信号,并向所述处理器发送所述信号,所述信号包括存储器中存储的计算机指令;当所述处理器执行所述计算机指令时,使得所述电子设备执行权利要求7至权利要求12中任一第一IPC所执行的同步方法。A chip, characterized in that it includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from a memory of an electronic device and send the signals to the processor, and the The signal includes computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device is caused to perform the synchronization method performed by any first IPC in claims 7 to 12.
  19. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,当所述计算机程序运行在计算机或处理器上时,使得所述计算机或所述处理器执行如权利要求1至权利要求12任一项所述的同步方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program. When the computer program is run on a computer or a processor, the computer or the processor causes the computer or the processor to execute the instructions as claimed. The synchronization method according to any one of claims 1 to 12.
  20. 一种计算机程序产品,其特征在于,所述计算机程序产品包含软件程序,当所述软件程序被计算机或处理器执行时,使得权利要求1至权利要求12任一项所述的方法的步骤被执行。 A computer program product, characterized in that the computer program product includes a software program, and when the software program is executed by a computer or a processor, the steps of the method described in any one of claims 1 to 12 are performed. implement.
PCT/CN2023/104098 2022-07-26 2023-06-29 Synchronization method, system, and electronic device WO2024021999A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210883502.8A CN117499712A (en) 2022-07-26 2022-07-26 Synchronization method, system and electronic equipment
CN202210883502.8 2022-07-26

Publications (1)

Publication Number Publication Date
WO2024021999A1 true WO2024021999A1 (en) 2024-02-01

Family

ID=89675000

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/104098 WO2024021999A1 (en) 2022-07-26 2023-06-29 Synchronization method, system, and electronic device

Country Status (2)

Country Link
CN (1) CN117499712A (en)
WO (1) WO2024021999A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117931458A (en) * 2024-03-21 2024-04-26 北京壁仞科技开发有限公司 Inference service scheduling method, device, processor and chip

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102510494A (en) * 2011-10-09 2012-06-20 杭州华三通信技术有限公司 Method and device for synchronizing I frame
KR20170050698A (en) * 2015-10-30 2017-05-11 에스케이텔레콤 주식회사 Method for encoding and decoding, and apparatus for the same
CN112153446A (en) * 2020-09-27 2020-12-29 海信视像科技股份有限公司 Display equipment and streaming media video audio-video synchronization method
WO2022028283A1 (en) * 2020-08-03 2022-02-10 阿里巴巴集团控股有限公司 Image frame coding method, object search method, computer device, and storage medium
CN114095769A (en) * 2020-08-24 2022-02-25 海信视像科技股份有限公司 Live broadcast low-delay processing method of application-level player and display equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102510494A (en) * 2011-10-09 2012-06-20 杭州华三通信技术有限公司 Method and device for synchronizing I frame
KR20170050698A (en) * 2015-10-30 2017-05-11 에스케이텔레콤 주식회사 Method for encoding and decoding, and apparatus for the same
WO2022028283A1 (en) * 2020-08-03 2022-02-10 阿里巴巴集团控股有限公司 Image frame coding method, object search method, computer device, and storage medium
CN114095769A (en) * 2020-08-24 2022-02-25 海信视像科技股份有限公司 Live broadcast low-delay processing method of application-level player and display equipment
CN112153446A (en) * 2020-09-27 2020-12-29 海信视像科技股份有限公司 Display equipment and streaming media video audio-video synchronization method

Also Published As

Publication number Publication date
CN117499712A (en) 2024-02-02

Similar Documents

Publication Publication Date Title
US9282232B2 (en) Collaborative image control
WO2024021999A1 (en) Synchronization method, system, and electronic device
US20100238264A1 (en) Three dimensional video communication terminal, system, and method
US20230262273A1 (en) Video stream processing method, apparatus, device, storage medium, and program product
EP3840394A1 (en) Video screen projection method, device, computer equipment and storage medium
SG185110A1 (en) Multiple-site drawn-image sharing apparatus, multiple-site drawn-image sharing system, method executed by multiple-site drawn-image sharing apparatus, program, and recording medium
CN112019877A (en) Screen projection method, device and equipment based on VR equipment and storage medium
CN106210503B (en) Camera shutter synchronous control method and equipment in vehicle-mounted ethernet communication network
CN112261353A (en) Video monitoring and shunting method, system and computer readable storage medium
US11050992B2 (en) Control apparatus, image processing system, control method, and medium
JP2022517587A (en) Audio stream and video stream synchronization switching method and equipment
CN103096018B (en) The method of transmission information and terminal
WO2020103018A1 (en) Video processing method, ground control terminal and storage medium
CN108667795B (en) Virtual reality video multi-person sharing system and virtual reality equipment
US20200218700A1 (en) Image synchronized storage method and image processing device
CN109389674B (en) Data processing method and device, MEC server and storage medium
CN109151435B (en) Data processing method, terminal, server and computer storage medium
JP2005176233A (en) Communication apparatus and communication system
CN114584648A (en) Method and equipment for synchronizing audio and video
CN115334322B (en) Video frame synchronization method, terminal, server, electronic device and storage medium
KR20080091952A (en) Method and system for filming flow motion
US20240107094A1 (en) Communication apparatus, control method, and storage medium
CN115102927B (en) SIP intercom method, system and storage device for keeping video clear
US20240007603A1 (en) Method, an apparatus and a computer program product for streaming of immersive video
CN117579679B (en) Signaling interaction method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23845212

Country of ref document: EP

Kind code of ref document: A1