Video processing method and apparatus, electronic device, and storage medium
By obtaining terminal device parameters, determining the adaptive streaming address and cropping the video stream, the screen mismatch caused by differences in terminal device display parameters in live video broadcast is solved, and efficient display of video streams and optimization of bandwidth resources is achieved.
Patent Information
- Application Number
- PCT/CN2024/143647
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-29
- Filing Date
- 2024-12-30
- Publication Date
- 2025-07-03
AI Technical Summary
During the live video broadcast process, the differences in display parameters of the terminal device cause the pulled video stream to be incompatible with the device, the screen content is incomplete or the display screen cannot be overwhelmed, and bandwidth resources are wasted.
By obtaining the parameters of the terminal device, the adaptive streaming address is determined, thereby obtaining the target video stream, cropping and processing the video stream to adapt to the screen ratio of the terminal device, and reducing bandwidth resource usage.
It realizes the adaptation of the video stream and the screen ratio of terminal equipment, reduces picture redundancy and bandwidth resource waste, and improves user viewing experience.
Smart Images

Figure CN2024143647_03072025_PF_FP_ABST
Abstract
Description
Video processing method, device, electronic device and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed on December 29, 2023, with application number 202311869308.5 and invention name “Video processing method, device, electronic device and storage medium”. The entire contents of that application are incorporated by reference into this application. Technical Field
[0003] The embodiments of the present disclosure relate to the field of data processing technology, and in particular to a video processing method, device, electronic device, and storage medium. Background Art
[0004] With the popularization of terminal devices, terminal devices with different display parameters have also appeared in the user's field of vision. Users can watch live video through terminal devices with different display parameters.
[0005] During the live video broadcast process, for terminals with different display parameters, the video streams corresponding to the live content pulled are the same.
[0006] At this time, the pulled video stream is not compatible with the terminal device, for example, the picture content is not fully displayed or the picture content cannot cover the display screen. Summary of the Invention
[0007] The present disclosure provides a video processing method, device, electronic device and storage medium.
[0008] In a first aspect, an embodiment of the present disclosure provides a video processing method, the method comprising:
[0009] In response to a request to enter a target live broadcast room, obtaining at least one stream pull address corresponding to the target live broadcast room and device parameters corresponding to a target terminal; wherein the at least one stream pull address corresponds to a video stream of at least one aspect ratio;
[0010] Determining a target stream pulling address from the at least one stream pulling address based on the device parameter;
[0011] A target video stream is obtained based on the target stream pulling address, so as to determine a live broadcast picture of the target live broadcast room based on the target video stream.
[0012] In a second aspect, an embodiment of the present disclosure further provides a video processing device, the device comprising:
[0013] An information acquisition module, configured to, in response to a request to enter a target live broadcast room, acquire at least one stream pull address corresponding to the target live broadcast room and device parameters corresponding to a target terminal; wherein the at least one stream pull address corresponds to a video stream of at least one aspect ratio;
[0014] A stream pull address determination module, configured to determine a target stream pull address from the at least one stream pull address based on the device parameters;
[0015] The video stream display module is used to obtain the target video stream based on the target stream pulling address, so as to determine the live broadcast picture of the target live broadcast room based on the target video stream.
[0016] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0017] one or more processors;
[0018] a storage device for storing one or more programs,
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the video processing method as described in any one of the embodiments of the present invention.
[0020] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute the video processing method as described in any one of the embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0022] FIG1 is a schematic diagram of a display screen provided by an embodiment of the present disclosure;
[0023] FIG2 is a flow chart of a video processing method provided by an embodiment of the present disclosure;
[0024] FIG3 is a flow chart of a video processing method provided by an embodiment of the present disclosure;
[0025] FIG4 is a schematic structural diagram of a video processing device provided by an embodiment of the present disclosure;
[0026] FIG5 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0028] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0029] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0030] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0031] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0032] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0033] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0034] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0035] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0036] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0037] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.
[0038] Before introducing the technical solutions provided by the embodiments of this disclosure, we will first provide an illustrative application scenario. The solutions provided by the embodiments of this disclosure can be applied in live streaming scenarios, such as live streaming. Live streaming scenarios include a host end and an audience end. The audience end is the user end viewing the live content, while the host end corresponds to the host user.
[0039] Usually, there are certain differences in the device parameters corresponding to different types of terminal devices (such as the screen ratio and aspect ratio of the display screen), but the ratio of the video screen corresponding to the live video stream is mostly pre-set, usually based on the screen ratio that currently accounts for a higher proportion. Therefore, when the screen ratio used is consistent with the ratio corresponding to the video screen, the video screen can be better presented on the display screen; if it is inconsistent, the pulled video stream needs to be further processed, such as proportionally stretching the video screen according to the height or width of the display screen. There may be a situation where the width or height of the enlarged video screen is larger than the display screen, that is, there is a problem that part of the video screen is not displayed on the display screen. However, the pulled video stream is the video stream of the entire video screen, and there is a problem that some video streams that cannot be displayed occupy bandwidth resources during the pulling process.
[0040] That is, when the screen ratio of the currently used device is mainly the first aspect ratio, the video stream corresponding to the live broadcast corresponds to the first aspect ratio. However, there are devices with other screen ratios. Optionally, the terminal devices with other screen ratios can be 9:17, 9:18, 9:20, etc.
[0041] In order to better present the video screen (live screen) on terminal devices with different screen ratios, the pulled video stream (corresponding to the live screen) can be stretched to fill the display screen in height, and then the width can be enlarged proportionally. This operation may cause the width of the video stream to exceed the width of the terminal device display screen, that is, a part of the video screen cannot be displayed on the display screen. In other words, the pulled video stream cannot be displayed on the display screen, and pulling the video stream requires a large amount of bandwidth resources, which leads to problems of screen redundancy and bandwidth resource occupation.
[0042] For example, the screen resolution of a commonly used terminal device is 1080*1920, that is, the screen aspect ratio is 9:16, and the resolution of the video stream corresponding to the live screen (video screen) is 1080*1920, see (a) in Figure 1. If the screen resolution of other terminal devices is 1080*2400, see (b) in Figure 1. In order to make the height of the video stream fill the display screen, the video stream needs to be enlarged by 1.25 times to 1350*2400 to obtain the effect shown in (c) in Figure 1. At this time, there is a situation where part of the video stream cannot be displayed on the display screen, that is, there is a problem of screen redundancy.
[0043] Figure 2 is a flow chart of a video processing method provided by an embodiment of the present invention. The embodiment of the present disclosure is applicable to the situation of determining a video stream that matches the parameters of a hardware device in a live broadcast scenario. The method can be executed by a video processing device, which can be implemented by software or hardware. Optionally, the hardware can be an electronic device, and the electronic device can be a mobile terminal, a PC or a server, etc.
[0044] In this embodiment, we will first introduce how to determine the live broadcast room to be transcoded and the transcoded video stream corresponding to the live broadcast room to be transcoded. For specific implementation methods, please refer to the detailed description of this embodiment.
[0045] As shown in FIG2 , the method includes:
[0046] S210. Determine at least one live broadcast room to be transcoded based on object information and / or business scenario information associated with at least one live broadcast room.
[0047] In this embodiment, the object information associated with the live broadcast room can specifically be said to be viewing object information, interactive object information, etc. The viewing object information can be the number of viewers in the live broadcast room, and the business scenario information can be the business scenario type of the live broadcast room, and the business scenario type includes the microphone type, the connection type, etc. If it is necessary to convert the video stream of a certain live broadcast room from the first picture ratio to the second picture ratio, then this live broadcast room can be used as the live broadcast room to be transcoded. It should be noted that in actual applications, each live broadcast room can be used as a live broadcast room to be transcoded. In order to improve the conversion rate, the live broadcast room to be transcoded can be determined according to the corresponding conditions. For example, a live broadcast room with an audience volume greater than a preset threshold can be used as a live broadcast room to be transcoded.
[0048] Furthermore, the business information for each live broadcast room may vary to some extent, and whether it is a live broadcast room to be transcoded can also be determined based on the business scenario. The business scenario can be a multi-user simulcast scenario or a scenario where the video screen width is aligned. The reason for determining the business scenario is that if it is a simulcast scenario, even if the display screen ratio is not currently the same, the video stream does not need to be transcoded. The simulcast scenario can be understood as a scenario where multiple live broadcast rooms are connected to each other.
[0049] S220. According to the transcoding task corresponding to the at least one live broadcast room to be transcoded, transcode the acquired source video stream to obtain a transcoded video stream.
[0050] A video stream with a preset aspect ratio is used as the source video stream. The preset aspect ratio may be a first aspect ratio. The source video stream is a video stream generated during a live broadcast. A transcoding task can be understood as a task requiring conversion of a source video stream with a first aspect ratio into a video stream with another aspect ratio. The converted video stream with the other aspect ratio is used as the transcoded video stream.
[0051] It should also be noted that the transcoding task may include at least one aspect ratio. Accordingly, the number of transcoded video streams may be consistent with the number of the at least one aspect ratio.
[0052] In an embodiment of the present disclosure, a source video stream is processed based on a transcoding task to obtain a transcoded video stream, including: based on a transcoding identifier in the transcoding task, processing the source video stream from a first aspect ratio to a transcoded video stream of a second aspect ratio; wherein different transcoding identifiers correspond to different second aspect ratios.
[0053] The aspect ratio of the source video stream displayed on the display screen is referred to as the first aspect ratio. A transcoding task is a task that converts the source video stream into a video stream of another aspect ratio. The transcoding task may include a transcoding identifier corresponding to the aspect ratio to be converted to, and the aspect ratio to be converted to is referred to as the second aspect ratio. The number of second aspect ratios can be multiple and can be set according to actual needs. The second aspect ratio can be larger than the first aspect ratio.
[0054] Specifically, based on the transcoding identifier in the transcoding task, the second aspect ratio to be converted can be determined. Based on this, the source video stream can be processed into a video stream corresponding to the second aspect ratio as a transcoded video stream.
[0055] Typically, the first aspect ratio is smaller than the second aspect ratio. When processing the video stream of the first aspect ratio based on high alignment, redundant video streams in width can be eliminated, that is, the video stream corresponding to a portion of the video screen can be cropped. In other words, the screen content of the transcoded video stream is less than that of the source video stream, and the bandwidth resources occupied by the transcoded video stream during the pull or push process are less than the bandwidth resources occupied by the source video stream.
[0056] It can be understood that when the source video stream corresponding to the live broadcast room is obtained, it can be determined whether there is a transcoding task in the live broadcast room. If so, the video stream of the first aspect ratio can be cropped based on the task identifier in the transcoding task to obtain a transcoded video stream of the second aspect ratio.
[0057] It should also be noted that the first aspect ratio and the second aspect ratio correspond to different screen ratios of the display screen.
[0058] It should be noted again that the specific setting of the second screen ratio can be determined based on the design user's experience, or can be determined based on the share corresponding to the current terminal device screen ratio. The specific setting method is not limited in this embodiment.
[0059] S230: Store the source video stream and the pull stream address corresponding to the transcoded video stream.
[0060] In order to facilitate the client to pull the video stream or the server to push the video stream to the client, the source video stream and the transcoded video stream can be stored after they are obtained. When storing, the storage address of the above video can be recorded and used as the pull stream address.
[0061] When a user enters the live broadcast room, the device parameters of the terminal device used by the user can be obtained to determine whether the source video stream or the transcoded video stream is being called based on the device parameters. After the determination is made, the target stream pull address can be used as the target stream pull address, and the target video stream can be obtained based on the target stream pull address. At this time, the aspect ratio of the pulled target video stream is highly compatible with the screen aspect ratio of the display screen.
[0062] It should also be noted that if the pulled target video stream is the video stream corresponding to the second aspect ratio, it is obtained after cropping the source video stream of the first aspect ratio. Therefore, the effect of adapting the aspect ratio to the display screen ratio can be achieved while occupying less bandwidth resources.
[0063] The technical solution provided by the embodiment of the present invention configures a corresponding transcoding task for each transcoding live broadcast room. After generating a source video stream, the source video stream can be cropped based on the transcoding task to obtain a transcoded video stream with a portion of the video screen cropped, that is, to obtain a transcoded video stream with at least one second aspect ratio. When a terminal device is detected entering the live broadcast room for live viewing, a video stream adapted to the terminal device can be obtained based on its device parameters, thereby achieving the effect of adapting the terminal device's screen ratio to the video stream's aspect ratio.
[0064] Figure 3 is a flow chart of a video processing method provided by an embodiment of the present disclosure. Based on the aforementioned embodiment, after obtaining the device parameters, a target video stream that is compatible with it can be determined. The specific implementation method can be found in the detailed description of this embodiment, wherein the technical terms that are the same as or corresponding to the aforementioned embodiment are not repeated here.
[0065] As shown in FIG3 , the method includes:
[0066] S310: In response to a request to enter a target live broadcast room, obtain at least one stream pulling address corresponding to the target live broadcast room and device parameters corresponding to a target terminal.
[0067] It should be noted that the device for executing the video processing method provided by the embodiment of the present disclosure can be integrated into application software that supports video processing functions, and the software can be installed in an electronic device. Optionally, the electronic device can be a mobile terminal or a PC terminal, etc.
[0068] The user can trigger any control on the display interface, including a control for entering a live broadcast room. When the user triggers the control for entering a live broadcast room on the display interface, the live broadcast image can be displayed on the display interface, and the live broadcast room currently entered is designated as the target live broadcast room. The target live broadcast room can be a live broadcast room to be transcoded or a live broadcast room not to be transcoded. If it is a live broadcast room to be transcoded, it may contain multiple transcoded video streams, each corresponding to a different second aspect ratio. Accordingly, each transcoded video stream may correspond to a stream pull address. In this case, the live broadcast room to be transcoded may have multiple stream pull addresses. If it is a live broadcast room not to be transcoded, it may only have one stream pull address corresponding to the source video stream. In other words, the number of at least one stream pull address can be one or more, and the specific number of stream pull addresses is determined by whether it is a live broadcast room to be transcoded and the number of second aspect ratios in the transcoding task for the live broadcast room to be transcoded. The target terminal can be the terminal device corresponding to the viewer end, specifically the device used by the viewer to view the target live broadcast room. Accordingly, the device parameters can be the display parameters of the target terminal. The display parameter may be a screen ratio of a display screen, that is, a picture ratio when the video stream is displayed on the display screen.
[0069] It should also be noted that different streaming addresses correspond to different picture ratios.
[0070] In an embodiment of the present disclosure, before obtaining at least one streaming address corresponding to the target live broadcast room and the device parameters corresponding to the target terminal, the method also includes: obtaining the live broadcast room identifier of the target live broadcast room; determining whether the live broadcast room identifier includes at least one streaming address; if so, obtaining at least one streaming address and device parameters.
[0071] Based on the above embodiment, after determining the live broadcast room to be transcoded, the live broadcast room to be transcoded can be marked so that when a viewing user enters the live broadcast room subsequently, it can be determined whether there is a transcoded video stream based on the mark identification of the live broadcast room, that is, whether there is at least one stream pulling address.
[0072] The live broadcast room identifier is used to distinguish whether the target live broadcast room is a live broadcast room to be transcoded. Optionally, if the live broadcast room identifier is 1, it can be said that the live broadcast room is a live broadcast room to be transcoded, and if the live broadcast room identifier is 0, it can be said that the live broadcast room is not a live broadcast room to be transcoded.
[0073] Specifically, when clicking to enter the target live broadcast room, the live broadcast room identifier of the target live broadcast room can be obtained. Based on the live broadcast room identifier, it can be determined whether the target live broadcast room has multiple streaming pull addresses. If the live broadcast room identifier determines that multiple streaming pull addresses exist, the multiple streaming pull addresses and device parameters are obtained. If not, the device parameters do not need to be obtained, and only the streaming pull address can be obtained.
[0074] It should also be noted that if there are multiple streaming addresses, then the target live broadcast room is the live broadcast room to be transcoded, that is, the target live broadcast room has multiple streaming addresses.
[0075] S320: Determine a target stream pulling address from at least one stream pulling address based on device parameters.
[0076] The device parameter may be the screen ratio of the target terminal, i.e., the aspect ratio. A target stream pull address may be determined from at least one stream pull address based on the aspect ratio. That is, the target stream pull address is the storage address of the video stream that matches the device parameter.
[0077] In this embodiment, the device parameters include the size ratio of the target terminal. Based on the device parameters, the target stream pulling address is determined from at least one stream pulling address, including: determining the target screen ratio based on the size ratio; if there is a stream pulling address corresponding to the target screen ratio, the stream pulling address is used as the target stream pulling address.
[0078] The size ratio can be understood as the aspect ratio of the target terminal. Based on the size ratio, the aspect ratio of the video image corresponding to the video stream when displayed on the display screen can be determined and used as the target aspect ratio. If a stream pull address corresponding to the target aspect ratio exists, this stream pull address is used as the target stream pull address.
[0079] In actual applications, there may be a streaming address that does not correspond to the target screen ratio. In this case, the streaming address corresponding to the source video stream may be used as the target streaming address.
[0080] The advantage of pulling the video stream based on the above method is that if the screen ratio is larger than the screen ratio corresponding to the source video stream, then when displaying the picture based on the pulled source video stream, the source video stream needs to be highly aligned, and the picture width needs to be proportionally enlarged according to the height adjustment ratio. Some video pictures are not displayed on the display screen, that is, there are problems of picture redundancy and too many pulled video streams. The advantage of determining transcoded video streams with different picture ratios is that it can reduce the bandwidth occupied by the pulled video stream, and the picture ratio of the pulled video stream is more adapted to the picture ratio of the terminal device.
[0081] S330: Acquire a target video stream based on the target stream pulling address, so as to determine a live broadcast picture of the target live broadcast room based on the target video stream.
[0082] The video stream corresponding to the target pull address is used as the target video stream. The target video stream can be the source video stream or a transcoded video stream. The transcoded video stream is the video stream obtained by cropping the source video stream. The specific video stream pulled corresponds to the device parameters of the terminal device.
[0083] Specifically, after determining the target stream pull address, the corresponding target video stream can be pulled from the storage location corresponding to the target stream pull address. The target video stream can be displayed on the display screen of the target terminal, so that the viewing user can watch the live screen based on the terminal.
[0084] Based on the above technical solution, the method also includes: in response to the request of the target live broadcast room to broadcast simultaneously with at least one simulcast live broadcast room, obtaining the address of the target live broadcast room and the source video stream of the simulcast live broadcast room to be pulled; updating the target stream pulling address based on the address of the stream to be pulled, so as to obtain the source video stream based on the updated target stream pulling address.
[0085] A simulcast room can be understood as a live broadcast room that needs to be broadcasted together. There can be one or more simulcast rooms. Simulcasting can be understood as establishing communication between multiple live broadcast rooms for a joint broadcast. In a simulcast scenario, the source video stream address of each live broadcast room is used as the stream address to be pulled. In other words, in a simulcast scenario, stream switching is required, and the source video stream pulled is primarily the source video stream corresponding to each live broadcast room.
[0086] It can be understood that during the live broadcast process, if the business scenario changes, such as a non-joint live broadcast is converted into a multiple live broadcast scene, then for each live broadcast user, it is not necessary for the corresponding video stream to fill the entire screen in the height direction, and the stream switching operation can be performed at this time. Get the storage address of the source video stream corresponding to the live broadcast room that needs to be switched, and use it as the address of the stream to be pulled. Based on the address of the stream to be pulled, the corresponding video stream can be pulled and displayed on the target terminal. When displaying, it can be displayed according to the pre-set live broadcast room layout parameters.
[0087] The technical solution provided by the disclosed embodiments, in response to a request to enter a target live broadcast room, determines whether the target live broadcast room has multiple streaming addresses, and obtains the device parameters of the target terminal of the user viewing the live broadcast. If a streaming address corresponding to the device parameters exists, the streaming address is used as the target streaming address, and the target video stream is pulled based on the target streaming address. At this time, the target video stream is most compatible with the display screen of the target terminal, which can improve the user's viewing experience of the live broadcast.
[0088] As an alternative embodiment of the above embodiment, a specific example can be used to further illustrate the solution provided by the embodiment of the present disclosure, which can be:
[0089] The embodiments of the present disclosure can be introduced from two dimensions. One dimension is the anchor side dimension, which can be understood as the anchor end; the other dimension can be the audience side dimension, which can be the audience end.
[0090] For the anchor side, it can be: based on the viewing object information and / or pre-set business scenarios corresponding to each live broadcast room, determine whether the live broadcast room is a live broadcast room to be transcoded. The live broadcast room to be transcoded can be understood as a live broadcast room for which a transcoded video stream needs to be generated. If so, a separate transcoding task can be generated for the push stream of the live broadcast room. The transcoding task can be a task that converts the universal first aspect ratio corresponding to the source video stream into a set second aspect ratio. For example, the universal first aspect ratio 9:16 source video stream can be transcoded into a transcoded video stream with a set second aspect ratio of 9:20.
[0091] It should be noted that the second aspect ratio can be determined based on the resolution ratio of the terminal used by the user and can be adjusted as the resolution ratio changes. If a 9:20 transcoded video stream is generated, the 9:16 video stream can be cropped to obtain a video stream that conforms to the 9:20 ratio. When pulling the transcoded video stream, the pulling of redundant images can be reduced, thereby improving the pulling efficiency.
[0092] For the audience, when the user triggers the operation of entering a live broadcast room, the device parameters of the target terminal can be obtained first, optionally, the size ratio of the display screen, optionally, the size ratio can be the aspect ratio of the display screen.
[0093] Next, it determines whether the aspect ratio is greater than a specified ratio. In this case, the specified ratio can be the first aspect ratio corresponding to the source video stream. If so, it determines whether a pull stream address corresponding to the aspect ratio exists. If so, it can be used as the target pull stream address to pull the corresponding target video stream. If not, the source video stream is pulled. During live streaming, if the server detects a scene switch, such as switching to a live scene that does not require high-level alignment, or a scenario with multiple live broadcast rooms, it can determine whether a stream switching operation is required. For example, if each live broadcast room pulls the source video or a transcoded video stream, if it is a transcoded video stream, the stream switching operation is required. If it is not a transcoded video stream, the source video stream does not meet the stream switching operation. If the stream switching operation is required, the source video stream address corresponding to each live broadcast room can be obtained and used as the target pull stream address to pull the corresponding video stream for display on the display screen. This achieves the effect of adapting the display image to the terminal device screen display ratio and the service scenario.
[0094] FIG4 is a schematic diagram of the structure of a video processing device provided by an embodiment of the present disclosure. As shown in FIG4 , the device includes: an information acquisition module 410, a stream address determination module 420, and a video stream display module 430.
[0095] The information acquisition module 410 is used to respond to a request to enter the target live broadcast room and obtain at least one streaming address corresponding to the target live broadcast room and the device parameters corresponding to the target terminal; wherein, the at least one streaming address corresponds to a video stream with at least one screen ratio; the streaming address determination module 420 is used to determine the target streaming address from the at least one streaming address based on the device parameters; the video stream display module 430 is used to obtain the target video stream based on the target streaming address, so as to determine the live screen of the target live broadcast room based on the target video stream.
[0096] The technical solution provided by the embodiment of the present disclosure, in response to a request to enter a target live broadcast room, determines whether the target live broadcast room has multiple streaming addresses, and obtains the device parameters of the target terminal to which the user watching the live broadcast belongs. If there is a streaming address corresponding to the device parameters, the streaming address is used as the target streaming address to pull the target video stream based on the target streaming address. At this time, the target video stream is most adapted to the display screen of the target terminal, achieving an effect of making the video stream displayed on the display screen extremely adapted to the display ratio of the display screen without wasting bandwidth resources and picture redundancy, further improving the user's experience of watching live broadcasts.
[0097] On the basis of the above technical solution, the information acquisition unit in the information acquisition module, before being used to obtain at least one stream pulling address corresponding to the target live broadcast room and device parameters corresponding to the target terminal, further includes:
[0098] An identification acquisition subunit, configured to acquire the live broadcast room identification of the target live broadcast room;
[0099] An address acquisition subunit, configured to determine whether the live broadcast room identifier includes at least one stream pulling address;
[0100] The information acquisition subunit is configured to, if yes, acquire the at least one stream pulling address and the device parameters.
[0101] On the basis of the above technical solutions, the device further includes:
[0102] A transcoding live broadcast room determination module is used to determine at least one live broadcast room to be transcoded based on the object information and / or business scenario information associated with at least one live broadcast room; a transcoding video stream generation module is used to transcode the acquired source video stream based on the transcoding task corresponding to the at least one live broadcast room to be transcoded to obtain a transcoded video stream; a stream pulling address recording module is used to store the source video stream and the stream pulling address corresponding to the transcoded video stream.
[0103] Based on the above technical solution, the at least one live broadcast room to be transcoded includes the target live broadcast room.
[0104] Based on the above technical solutions, the transcoded video stream generation module is further used to: based on the transcoding identifier in the transcoding task, process the source video stream of the first aspect ratio into a transcoded video stream of the second aspect ratio; wherein different transcoding identifiers correspond to different second aspect ratios.
[0105] Based on the above technical solutions, the device parameters include the size ratio of the target terminal, the at least one stream pulling address includes at least two stream pulling addresses, and the stream pulling address determination module includes:
[0106] a ratio determination unit, configured to determine a target screen ratio based on the size ratio;
[0107] The stream pulling address determining unit is configured to use the stream pulling address as the target stream pulling address if there is a stream pulling address corresponding to the target screen ratio.
[0108] Based on the above technical solutions, the device further includes: a stream pulling address determining unit, which is further configured to use the stream pulling address corresponding to the source video stream as the target stream pulling address if there is no stream pulling address corresponding to the target screen ratio.
[0109] On the basis of the above technical solutions, the device further includes: a to-be-pulled stream address determination module, configured to obtain the to-be-pulled stream addresses corresponding to the target live broadcast room and the source video streams of the simulcast live broadcast room in response to a request for simulcasting between the target live broadcast room and at least one simulcast live broadcast room;
[0110] The target stream pulling address determining module is configured to update the target stream pulling address based on the to-be-pulled stream address, so as to obtain the source video stream based on the updated target stream pulling address.
[0111] The video processing device provided in the embodiments of the present disclosure can execute the video processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0112] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0113] FIG5 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Referring to FIG5 , a schematic diagram of the structure of an electronic device (such as a terminal device or server in FIG5 ) 500 suitable for implementing an embodiment of the present disclosure is shown below. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG5 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0114] As shown in FIG5 , the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0115] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although FIG5 shows the electronic device 500 with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may alternatively be implemented or present.
[0116] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0117] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0118] The electronic device provided by the embodiment of the present disclosure and the video processing method provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0119] An embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the video processing method provided by the above embodiment is implemented.
[0120] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0121] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.
[0122] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0123] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0124] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0125] In response to a request to enter a target live broadcast room, obtaining at least one stream pull address corresponding to the target live broadcast room and device parameters corresponding to a target terminal; wherein the at least one stream pull address corresponds to a video stream of at least one aspect ratio;
[0126] Determining a target stream pulling address from the at least one stream pulling address based on the device parameter;
[0127] A target video stream is obtained based on the target stream pulling address, so as to determine a live broadcast picture of the target live broadcast room based on the target video stream.
[0128] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0129] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0130] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0131] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0132] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0133] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0134] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0135] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A video processing method, comprising: In response to a request to enter a target live broadcast room, obtaining at least one pulling stream address corresponding to the target live broadcast room and device parameters corresponding to the target terminal; wherein, the at least one pulling stream address corresponds to video streams of at least one screen ratio; Based on the device parameters, determining a target pulling stream address from the at least one pulling stream address; Obtaining a target video stream based on the target pulling stream address, so as to determine a live broadcast picture of the target live broadcast room based on the target video stream.
2. The method according to claim 1, wherein Before obtaining the at least one pulling stream address corresponding to the target live broadcast room and the device parameters corresponding to the target terminal, the method further comprises: Obtaining a live broadcast room identifier of the target live broadcast room; Determining whether the live broadcast room identifier includes at least one pulling stream address; If so, obtaining the at least one pulling stream address and the device parameters.
3. The method according to claim 1, wherein Further comprising: Determining at least one live broadcast room to be transcoded according to object information and / or service scenario information associated with at least one live broadcast room; Performing transcoding processing on the obtained source video stream according to a transcoding task corresponding to the at least one live broadcast room to be transcoded, to obtain a transcoded video stream; Storing the pulling stream addresses corresponding to the source video stream and the transcoded video stream.
4. The method according to claim 3, wherein, The at least one live broadcast room to be transcoded includes the target live broadcast room.
5. The method according to claim 3, wherein The performing transcoding processing on the obtained source video stream according to a transcoding task corresponding to the at least one live broadcast room to be transcoded, to obtain a transcoded video stream, includes: Based on a transcoding identifier in the transcoding task, processing a source video stream with a first screen ratio into a transcoded video stream with a second screen ratio; Wherein, different transcoding identifiers correspond to different second screen ratios.
6. The method according to claim 1, wherein The device parameters include a size ratio of the target terminal, and the determining a target pulling stream address from the at least one pulling stream address based on the device parameters includes: Based on the size ratio, determining a target screen ratio; If there is a pulling stream address corresponding to the target screen ratio, using the pulling stream address as the target pulling stream address.
7. The method according to claim 6, wherein, Further comprising: If there is no pulling stream address corresponding to the target screen ratio, using the pulling stream address corresponding to the source video stream as the target pulling stream address.
8. The method according to claim 1, wherein, Further comprising: In response to a request for a joint broadcast between the target live broadcast room and at least one joint broadcast live broadcast room, obtaining a pulling stream address to be pulled corresponding to the source video streams of the target live broadcast room and the joint broadcast live broadcast rooms; Updating the target pulling stream address based on the pulling stream address to be pulled, so as to obtain the source video stream based on the updated target pulling stream address.
9. A video processing device, comprising: An information obtaining module, configured to, in response to a request to enter a target live broadcast room, obtain at least one pulling stream address corresponding to the target live broadcast room and device parameters corresponding to the target terminal; wherein, the at least one pulling stream address corresponds to video streams of at least one screen ratio; A pulling stream address determining module, configured to determine a target pulling stream address from the at least one pulling stream address based on the device parameters; A video stream display module, configured to obtain a target video stream based on the target pulling stream address, so as to determine a live broadcast picture of the target live broadcast room based on the target video stream.
10. An electronic device, the electronic device comprising: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, enabling the one or more processors to implement the video processing method as described in any one of claims 1-8.
11. A storage medium containing computer-executable instructions, the computer-executable instructions being used to execute the video processing method as described in any one of claims 1-8 when executed by a computer processor.
Citation Information
Patent Citations
Microphone alternating live broadcast method, device and system
CN106791892A
Video cropping method and device, electronic equipment and storage medium
CN111050204A
Video processing method and device, electronic equipment and computer readable storage medium
CN113542795A
Live broadcast processing method and device
CN115037951A
Data download method and apparatus, computer device and computer-readable storage medium
WO2022016896A1