Video processing method and device, electronic equipment and storage medium
By obtaining terminal device parameters and determining the adaptive streaming address and video stream, the problem of screen mismatch in live videos is solved, improving user experience and optimizing bandwidth usage.
Patent Information
- Application Number
- CN202311869308.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
During the live video broadcast process, different display parameters of the terminal device lead to the pulling video stream not adapting to the device, the screen content is incomplete or the display screen cannot be overwhelmed, and it occupies a lot of bandwidth resources.
By obtaining the parameters of the terminal device, the adaptive streaming address is determined, thereby obtaining the target video stream, ensuring that the live broadcast screen matches the display screen ratio of the terminal device, and cropping and processing the video stream to adapt to different screen ratios.
It improves the user's experience of watching live broadcasts, reduces the waste of bandwidth resources, avoids screen redundancy, and realizes the adaptation of video streams and display screens.
Smart Images

Figure CN120238666A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the technical field of data processing, and in particular, to a video processing method, apparatus, electronic device, and storage medium. Background Art
[0002] With the popularization of terminal devices, terminal devices with different display parameters have also appeared in the user's view. Users can watch video live broadcasts through terminal devices with different display parameters.
[0003] During a video live broadcast, for terminals with different display parameters, the video streams pulled corresponding to the live broadcast content are the same.
[0004] At this time, there is a situation where 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
[0005] The present disclosure provides a video processing method, apparatus, electronic device, and storage medium to achieve the technical effect of adapting the live broadcast picture content to the terminal device.
[0006] In a first aspect, embodiments of the present disclosure provide a video processing method, the method including:
[0007] In response to a request to enter a target live broadcast room, obtain at least one streaming address corresponding to the target live broadcast room and device parameters corresponding to the target terminal; wherein, the at least one streaming address corresponds to video streams of at least one picture ratio;
[0008] Based on the device parameters, determine a target streaming address from the at least one streaming address;
[0009] Obtain a target video stream based on the target streaming address to determine the live broadcast picture of the target live broadcast room based on the target video stream.
[0010] In a second aspect, embodiments of the present disclosure further provide a video processing apparatus, the apparatus including:
[0011] An information acquisition module, configured to obtain at least one streaming address corresponding to the target live broadcast room and device parameters corresponding to the target terminal in response to a request to enter the target live broadcast room; wherein, the at least one streaming address corresponds to video streams of at least one picture ratio;
[0012] A streaming address determination module, configured to determine a target streaming address from the at least one streaming address based on the device parameters;
[0013] A video stream display module, configured to obtain a target video stream based on the target stream pulling address, and determine a live broadcast screen of the target live broadcast room based on the target video stream.
[0014] In a third aspect, an embodiment of the present disclosure further provides an electronic device, which includes:
[0015] One or more processors;
[0016] A storage device, configured to store one or more programs,
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the video processing method according to any one of the embodiments of the present invention.
[0018] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute the video processing method according to any one of the embodiments of the present invention when executed by a computer processor.
[0019] The technical solution provided by the embodiment of the present disclosure, in response to a request to enter a target live broadcast room, obtains at least one stream pulling address of the target live broadcast room and device parameters of a user terminal for watching the live broadcast. If there is a stream pulling address corresponding to the device parameters, the stream pulling address is used as the target stream pulling address to pull a target video stream based on the target stream pulling address, so as to achieve the effect that the video stream displayed on the display screen is adapted to the display ratio of the display screen. Further, the effect of improving the user's live broadcast viewing experience can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Combined with the drawings and referring to the following specific embodiments, the above and other features, advantages and aspects of the embodiments of the present disclosure will become more obvious. 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 the original components and elements are not necessarily drawn to scale.
[0021] Figure 1 is a schematic diagram of a display screen provided by an embodiment of the present disclosure;
[0022] Figure 2 is a schematic diagram of a video processing method flow provided by an embodiment of the present disclosure;
[0023] Figure 3 is a schematic diagram of a video processing method flow provided by an embodiment of the present disclosure;
[0024] Figure 4 is a schematic diagram of a video processing device structure provided by an embodiment of the present disclosure;
[0025] Figure 5It is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners
[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the 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 set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.
[0027] It should be understood that the steps recited in the method embodiments of the present disclosure can be executed in a different order 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 regard.
[0028] The term "including" and its variations used herein are open-ended, that is, "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0029] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of the functions executed by these devices, modules or units or their interdependent relationships.
[0030] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".
[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.
[0032] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to users and user authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0033] For example, when a user's active request is received, a prompt message is sent to the user to clearly prompt that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application program, server, or storage medium that performs the operations of the present disclosure's technical solution based on the prompt message.
[0034] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving the user's active request may be, for example, in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0035] It can be understood that the above process of notifying and obtaining user authorization is only illustrative and does not limit the implementation manner of the present disclosure. Other manners that comply with relevant laws and regulations can also be applied to the implementation manner of the present disclosure.
[0036] It can be understood that the data involved in the present technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of corresponding laws, regulations, and related provisions.
[0037] Before introducing the technical solution provided by the embodiments of the present disclosure, an exemplary description of the application scenario is first given. The solution provided by the embodiments of the present disclosure can be applied in a live broadcast scenario, such as a live video streaming scenario. The live broadcast scenario includes a host side and an audience side. The audience side is the user side for watching the live broadcast content, and the host side corresponds to the host user.
[0038] Generally, 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 picture corresponding to the live video stream is mostly preset in advance, usually preset according to the currently dominant screen ratio. Therefore, when the used screen ratio is consistent with the ratio corresponding to the video picture, the video picture can be better presented on the display screen; if they are inconsistent, further processing of the pulled video stream is required, such as stretching the video picture proportionally according to the height or width of the display screen. There may be a situation where the width or height of the enlarged video picture is greater than the display screen, that is, there is a problem that part of the video picture is not displayed on the display screen. However, the pulled video stream is the video stream of the entire video picture, and the part of the video stream that cannot be displayed has the problem of occupying bandwidth resources during the pulling process.
[0039] That is to say, when the screen ratio of the currently used device is mainly the first screen ratio, the video stream corresponding to the live broadcast corresponds to the first screen ratio. However, there are currently devices with other screen ratios. Optionally, the terminal devices with other screen ratios can be 9:17, 9:18, 9:20, etc.
[0040] In order to better present the video picture (live broadcast picture) on terminal devices with different screen ratios, the pulled video stream (corresponding to the live broadcast picture) can be stretched to fill the display screen in height and then enlarged proportionally in width. Such an operation may result in the width of the video stream exceeding the width of the display screen of the terminal device, that is, a part of the video picture fails to be displayed on the display screen. That is, the pulled video stream cannot be displayed on the display screen, and pulling the video stream requires a large amount of bandwidth resources, resulting in problems of picture redundancy and bandwidth resource occupation.
[0041] Exemplarily, the screen resolution of a commonly used terminal device is 1080*1920, that is, the screen width-to-height ratio is 9:16, and the resolution of the video stream corresponding to the live broadcast picture (video picture) is 1080*1920. See Figure 1 (a) in. If the screen resolution of other terminal devices is 1080*2400, see Figure 1 (b) in. In order to stretch the height of the video stream to fill the display screen, the video stream needs to be enlarged by 1.25 times to become 1350*2400 to obtain the effect shown in Figure 1 (c). At this time, there is a situation where part of the video stream fails to be displayed on the display screen, that is, there is a problem of picture redundancy.
[0042] Figure 2 FIG. is a schematic flowchart of a video processing method provided by an embodiment of the present invention. The embodiments of the present disclosure are applicable to determining a video stream matching hardware device parameters in a live broadcast scenario. This method can be executed by a video processing device, and the device can be implemented in 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.
[0043] In this embodiment, how to determine the live broadcast rooms to be transcoded and the transcoded video streams corresponding to the live broadcast rooms to be transcoded can be introduced first, and the specific implementation can be referred to the detailed description of this embodiment.
[0044] As shown in Figure 2 , the method includes:
[0045] S210. Determine at least one live broadcast room to be transcoded according to the object information and / or service scenario information associated with at least one live broadcast room.
[0046] In this embodiment, the object information associated with the live broadcast room can specifically refer to viewing object information, interaction object information, etc. The viewing object information can be the number of viewers in the live broadcast room, and the service scenario information can be the service scenario type of the live broadcast room. The service scenario type includes co-hosting types, connection types, etc. If it is necessary to convert the video stream of a certain live broadcast room from a first screen ratio to a second screen ratio, this live broadcast room can be used as the live broadcast room to be transcoded. It should be noted that in practical applications, each live broadcast room can be used as the live broadcast room to be transcoded. To improve the conversion rate, the live broadcast room to be transcoded can be determined according to corresponding conditions. Exemplarily, the live broadcast room with the number of viewers greater than the preset quantity threshold can be used as the live broadcast room to be transcoded.
[0047] In addition, for each live broadcast room, its service information may also have certain differences, and it can also be determined whether it is the live broadcast room to be transcoded based on the service scenario. The service scenario can be a multi-user live broadcast scenario, or a scenario where the video screen widths are aligned. The reason for determining the service scenario is that in the case of a live broadcast scenario, even if the display screen ratio is not the currently common screen ratio, the video stream does not need to be transcoded. The live broadcast scenario can be understood as a multi-live broadcast room co-hosting scenario.
[0048] S220. Transcode the obtained source video stream according to the transcoding task corresponding to the at least one live broadcast room to be transcoded to obtain a transcoded video stream.
[0049] Among them, the video stream with a preset screen ratio is used as the source video stream. The preset screen ratio can be the first screen ratio. The source video stream is the video stream generated during the live broadcast. The transcoding task can be understood as the task of converting the source video stream with the first screen ratio into a video stream with another screen ratio. The video stream with the converted another screen ratio is used as the transcoded video stream.
[0050] It should also be noted that the transcoding task can include at least one screen ratio. Correspondingly, the number of transcoded video streams can be consistent with the number of at least one screen ratio.
[0051] In the embodiments of the present disclosure, processing the source video stream based on the transcoding task to obtain a transcoded video stream includes: processing the source video stream from the first screen ratio to a transcoded video stream with the second screen ratio based on the transcoding identifier in the transcoding task; wherein, different transcoding identifiers correspond to different second screen ratios.
[0052] Among them, the screen ratio of the source video stream displayed on the display screen is used as the first screen ratio. The transcoding task refers to the task of converting the source video stream into a video stream with a different screen ratio. The transcoding task may include a transcoding identifier corresponding to the screen ratio to which conversion is required, and the screen ratio to which conversion is required is used as the second screen ratio. The number of second screen ratios can be multiple and can be set according to actual needs. The second screen ratio can be greater than the first screen ratio.
[0053] Specifically, based on the transcoding identifier in the transcoding task, the second screen ratio to which conversion is required can be determined. Based on this, the source video stream can be processed into a video stream corresponding to the second screen ratio as the transcoded video stream.
[0054] Generally, the first screen ratio is smaller than the second screen ratio. When processing the video stream with the first screen ratio in a high-alignment manner, the redundant video stream in the width can be removed, that is, cropped to a part of the video stream corresponding to the video frame. That is to say, the picture 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 process of pulling or pushing the stream are less than those occupied by the source video stream.
[0055] 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, based on the task identifier in the transcoding task, the video stream with the first screen ratio can be cropped to obtain the transcoded video stream with the second screen ratio.
[0056] It should also be noted that the first screen ratio and the second screen ratio correspond to different screen ratios of the display screen.
[0057] It should be noted again that the specific setting of the second screen ratio can be determined according to the experience of the designed user or according to the share corresponding to the current screen ratio of the terminal device, and its specific setting method is not limited in this embodiment.
[0058] S230. Store the pull addresses corresponding to the source video stream and the transcoded video stream.
[0059] To facilitate the client to pull the video stream or the server to push the video stream to the client, they can be stored after obtaining the source video stream and the transcoded video stream. When storing, the storage address of the above video can be recorded and used as the pull address.
[0060] When a user entering the live broadcast room is detected, the device parameters of the terminal device used by the viewing user can be obtained to determine whether to call the source video stream or the transcoded video stream based on the device parameters. After the determination, it can be used as the target stream pulling address, and the target video stream can be obtained based on the target stream pulling address. At this time, the aspect ratio of the pulled target video stream is extremely adapted to the aspect ratio of the display screen.
[0061] 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 by cropping the source video stream with the first aspect ratio. Therefore, the effect of adapting the aspect ratio of the video stream to the aspect ratio of the display screen can be achieved under the condition of less bandwidth resource occupancy.
[0062] The technical solution provided by the embodiments of the present invention configures corresponding transcoding tasks for each transcoded live broadcast room, so that after the source video stream is generated, the source video stream can be cropped based on the transcoding tasks to obtain a transcoded video stream with some video frames cropped, that is, at least one transcoded video stream with the second aspect ratio is obtained. When it is detected that there is a terminal device entering the live broadcast room for live viewing, a video stream adapted to it can be obtained according to the device parameters of the terminal device, achieving the effect that the screen ratio of the terminal device is adapted to the aspect ratio of the video stream.
[0063] Figure 3 It is a schematic flowchart of a video processing method provided by an embodiment of the present disclosure. On the basis of the foregoing embodiments, after the device parameters are obtained, a target video stream adapted to them can be determined. The specific implementation manner can refer to the detailed description of this embodiment. Among them, the same or corresponding technical terms as those in the above embodiments will not be described in detail here.
[0064] As Figure 3 shown, the method includes:
[0065] 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 the device parameters corresponding to the target terminal.
[0066] It should be noted that the device for executing the video processing method provided by the embodiments of the present disclosure can be integrated in an application software supporting 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.
[0067] Among them, the user can trigger any control on the display interface, and any control can include a control for entering the live broadcast room. When the user triggers the control for entering the live broadcast room on the display interface, the live broadcast screen can be displayed on the display interface, and the live broadcast room entered at this time is used 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 that is not to be transcoded. If it is a live broadcast room to be transcoded, there may be multiple transcoded video streams, and different transcoded video streams correspond to different second screen ratios. Correspondingly, each transcoded video stream can correspond to a pull stream address. At this time, there may be multiple pull stream addresses in the live broadcast room to be transcoded; if it is a live broadcast room that is not to be transcoded, there may be only one pull stream address corresponding to the source video stream. That is to say, the number of at least one pull stream address can be one or more, and the specific number of pull stream addresses is determined by whether it is a live broadcast room to be transcoded and the number of second screen ratios in the transcoding task of the live broadcast room to be transcoded. The target terminal can be the terminal device corresponding to the viewer side, specifically, the device used by the viewer who watches the target live broadcast room. Correspondingly, the device parameter can be the display parameter of the target terminal. The display parameter can be the screen ratio of the display screen, that is, the screen ratio when the video stream is displayed on the display screen.
[0068] It should also be noted that different pull stream addresses correspond to different screen ratios.
[0069] In the embodiment of the present disclosure, before obtaining at least one pull stream address corresponding to the target live broadcast room and the device parameter corresponding to the target terminal, the method further includes: obtaining the live broadcast room identifier of the target live broadcast room; determining whether the live broadcast room identifier includes at least one pull stream address; if so, obtaining at least one pull stream address and the device parameter.
[0070] 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 subsequent viewing user enters the live broadcast room, it can be determined whether there is a transcoded video stream based on the marked identifier of the live broadcast room, that is, it can be determined whether there is at least one pull stream address.
[0071] Among them, the live broadcast room identifier is an identifier 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 indicate that the live broadcast room is a live broadcast room to be transcoded, and if the live broadcast room identifier is 0, it can indicate that the live broadcast room is a live broadcast room that is not to be transcoded.
[0072] Specifically, when clicking to enter the target live broadcast room, the live broadcast room identifier of the target live broadcast room can be obtained, and it can be determined whether there are multiple pull stream addresses in the target live broadcast room based on the live broadcast room identifier. If it is determined based on the live broadcast room identifier that there are multiple pull stream addresses, then obtain multiple pull stream addresses and the device parameter. If not, the device parameter does not need to be obtained, and only the pull stream address needs to be obtained.
[0073] It should also be noted that if the number of pulling stream addresses includes multiple ones, then the target live broadcast room is the live broadcast room to be transcoded, that is, there are multiple pulling stream addresses in the target live broadcast room.
[0074] S320. Based on the device parameters, determine a target pulling stream address from at least one pulling stream address.
[0075] Among them, the device parameters can be the screen ratio of the target terminal, that is, the aspect ratio. The target pulling stream address can be determined from at least one pulling stream address based on the aspect ratio. That is, the target pulling stream address is the storage address of the video stream that matches the device parameters.
[0076] In this embodiment, the device parameters include the size ratio of the target terminal. Based on the device parameters, determining a target pulling stream address from at least one pulling stream address includes: determining a target screen ratio based on the size ratio; if there is a pulling stream address corresponding to the target screen ratio, then use the pulling stream address as the target pulling stream address.
[0077] Among them, the size ratio can be understood as the aspect ratio of the target terminal. Based on the size ratio, the screen ratio when the video screen corresponding to the video stream is displayed on the display screen can be determined and used as the target screen ratio. If there is a pulling stream address corresponding to the target screen ratio, then use this pulling stream address as the target pulling stream address.
[0078] In practical applications, there may be a pulling stream address that does not correspond to the target screen ratio, then the pulling stream address corresponding to the source video stream can be used as the target pulling stream address.
[0079] The advantage of pulling the video stream based on the above method is that if the screen ratio is greater than the screen ratio corresponding to the source video stream, when the source video stream pulled is used for screen display, it is necessary to align the height of the source video stream, and the screen width is enlarged proportionally according to the adjustment ratio of the height. There are some video screens that are not displayed on the display screen, that is, there are problems such as picture redundancy and more pulled video streams. The advantage of determining the transcoded video streams with different screen ratios is that it can reduce the bandwidth occupied resources of the pulled video stream, and the screen ratio of the pulled video stream is more adapted to the screen ratio of the terminal device.
[0080] S330. Obtain a target video stream based on the target pulling stream address, so as to determine the live broadcast picture of the target live broadcast room based on the target video stream.
[0081] Among them, the video stream corresponding to the target pulling stream address is used as the target video stream. The target video stream can be the source video stream or the transcoded video stream. The transcoded video stream is the video stream obtained after cropping the source video stream. The specific video stream pulled corresponds to the device parameters of the terminal device.
[0082] Specifically, after determining the target streaming address, the corresponding target video stream can be pulled from the storage location corresponding to the target streaming 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 broadcast screen based on the terminal.
[0083] Based on the above technical solution, the method further includes: in response to a request for co-broadcasting between the target live broadcast room and at least one co-broadcast live broadcast room, obtaining the pull addresses to be pulled corresponding to the source video streams of the target live broadcast room and the co-broadcast live broadcast rooms; updating the target pull address based on the pull addresses to be pulled, so as to obtain the source video streams based on the updated target pull address.
[0084] Among them, the co-broadcast live broadcast room can be understood as a live broadcast room that needs to co-broadcast. The number of at least one co-broadcast live broadcast room can be one or more. Co-broadcasting can be understood as establishing communication between multiple live broadcast rooms for co-broadcasting. In the co-broadcast scenario, the address of the source video stream of each live broadcast room is used as the pull address to be pulled. That is to say, in the co-broadcast scenario, a stream switching operation needs to be performed, and the main thing pulled is the source video stream corresponding to each live broadcast room.
[0085] It can be understood that during the live broadcast, if there is a situation where the business scenario changes, such as a scenario changing from non-joint live broadcast to co-broadcasting of multiple live broadcast rooms, at this time, for each co-broadcast user, it is not necessary to fill the entire screen in the height direction with the video stream corresponding to him. At this time, a stream switching operation can be performed. Obtain the storage address of the source video stream corresponding to the live broadcast room that needs to switch the stream, and use it as the pull address to be pulled. Based on the pull address 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.
[0086] The technical solution provided by the embodiments of the present disclosure, in response to a request to enter a target live broadcast room, determines whether there are multiple pull addresses for the target live broadcast room, and obtains the device parameters of the target terminal to which the live broadcast viewing user belongs. If there is a pull address corresponding to the device parameters, then use this pull address as the target pull address to pull the target video stream based on the target pull address. At this time, the target video stream is the most suitable for the display screen of the target terminal, which can improve the effect of the user's live broadcast viewing experience.
[0087] As an optional embodiment of the above embodiment, a specific example can be used to further elaborate on the solution provided by the embodiments of the present disclosure. Specifically, it can be:
[0088] The embodiments of the present disclosure can be introduced from two dimensions. One dimension is the host side dimension, and the host side can be understood as the host terminal; the other dimension can be the viewer side dimension, and the viewer side dimension can be the viewer terminal.
[0089] For the host side, it can be: determine whether a live room is a live room to be transcoded according to the viewing object information corresponding to each live room and / or a preset business scenario. A live room to be transcoded can be understood as a live room for which a transcoded video stream needs to be generated. If so, a separate transcoding task can be generated for the live stream of the live room. The transcoding task can be a task of converting the general first aspect ratio corresponding to the source video stream into a set second aspect ratio. Exemplarily, a source video stream with a general first aspect ratio of 9:16 can be transcoded into a transcoded video stream with a set second aspect ratio of 9:20.
[0090] It should be noted that the set second aspect ratio can be determined according to the resolution ratio of the terminal used by the user and can be adjusted as the resolution ratio changes. If a transcoded video stream with a ratio of 9:20 is generated, the video stream with a ratio of 9:16 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 pictures can be reduced, thereby improving the pulling efficiency.
[0091] For the viewer side, when the user triggers an operation to enter a certain live 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.
[0092] Next, it can be determined whether the aspect ratio is greater than a specified ratio. At this time, the specified ratio can be the first aspect ratio corresponding to the source video stream. If so, it is determined whether there is a pulling address corresponding to the aspect ratio. If there is, it can be used as the target pulling address to pull the corresponding target video stream. If not, the source video stream is pulled. During the live broadcast, if the server detects a scenario switch, such as switching to a live broadcast scenario that does not require height alignment, or a scenario of multiple live rooms being broadcast simultaneously, it can be determined whether the flow switching operation is satisfied. For example, whether the video stream pulled by each live room is the source video or the transcoded video stream. If it is the transcoded video stream, it means that the flow switching operation is satisfied. If it is not the transcoded video stream, it means that it is the source video stream and the flow switching operation is not satisfied. Under the condition of satisfying the flow switching operation, the to-be-pulled addresses of the source video streams corresponding to each live room in the multi-room broadcast can be obtained and used as the target pulling addresses to pull the corresponding video streams for display on the display screen. The effect of adapting the display screen to the display ratio of the terminal device screen and the business scenario is achieved.
[0093] Figure 4 The following is a schematic structural diagram of a video processing device provided by an embodiment of the present disclosure, as Figure 4 shown, the device includes: an information acquisition module 410, a pulling address determination module 420, and a video stream display module 430. Among them,
[0094] An information acquisition module 410, configured to obtain at least one streaming address corresponding to the target live broadcast room and device parameters corresponding to the target terminal in response to a request to enter the target live broadcast room; wherein, the at least one streaming address corresponds to video streams of at least one screen ratio; a streaming address determination module 420, configured to determine a target streaming address from the at least one streaming address based on the device parameters; a video stream display module 430, configured to obtain a target video stream based on the target streaming address, so as to determine a live broadcast screen of the target live broadcast room based on the target video stream.
[0095] In the technical solution provided by the embodiments of the present disclosure, in response to a request to enter a target live broadcast room, it is determined whether there are multiple streaming addresses for the target live broadcast room, and device parameters of the target terminal to which the live broadcast viewing user belongs are obtained. If there is a streaming address corresponding to the device parameters, the streaming address is used as the target streaming address to pull a 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 the effect that the video stream displayed on the display screen can be extremely adapted to the display ratio of the display screen without wasting bandwidth resources and picture redundancy. Further, the effect of improving the user's live broadcast viewing experience can be achieved.
[0096] Based on the above technical solution, before the information acquisition unit in the information acquisition module is used to obtain at least one streaming address corresponding to the target live broadcast room and device parameters corresponding to the target terminal, it further includes:
[0097] An identification acquisition subunit, configured to obtain a live broadcast room identification of the target live broadcast room;
[0098] An address acquisition subunit, configured to determine whether the live broadcast room identification includes at least one streaming address;
[0099] An information acquisition subunit, configured to, if so, obtain the at least one streaming address and the device parameters.
[0100] Based on the above technical solutions, the apparatus further includes:
[0101] A transcoding live broadcast room determination module, configured to determine 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; a transcoding video stream generation module, configured to perform 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; a streaming address recording module, configured to store the streaming addresses corresponding to the source video stream and the transcoded video stream.
[0102] Based on the above technical solution, the at least one live broadcast room to be transcoded includes the target live broadcast room.
[0103] Based on the above technical solutions, the transcoded video stream generation module is further configured to: based on the transcoding identifier in the transcoding task, process the source video stream with the first aspect ratio into a transcoded video stream with the second aspect ratio; wherein, different transcoding identifiers correspond to different second aspect ratios.
[0104] 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:
[0105] An aspect ratio determination unit, configured to determine a target aspect ratio based on the size ratio;
[0106] A stream pulling address determination unit, configured to use the stream pulling address as the target stream pulling address if there is a stream pulling address corresponding to the target aspect ratio.
[0107] Based on the above technical solutions, the device further includes: a stream pulling address determination unit, 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 aspect ratio.
[0108] Based on the above technical solutions, the device further includes: a to-be-stream-pulled address determination module, configured to, in response to a request for a joint broadcast of the target live broadcast room and at least one co-broadcast live broadcast room, obtain the to-be-stream-pulled addresses corresponding to the source video streams of the target live broadcast room and the co-broadcast live broadcast rooms;
[0109] A target stream pulling address determination module, configured to update the target stream pulling address based on the to-be-stream-pulled addresses, so as to obtain the source video stream based on the updated target stream pulling address.
[0110] The video processing device provided by the embodiments of the present disclosure can execute the video processing method provided by any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the method.
[0111] It should be noted that the various units and modules included in the above device are only divided according to functional logic, but are not limited to the above 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 mutual distinction and do not limit the protection scope of the embodiments of the present disclosure.
[0112] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. The following refers to Figure 5 , which shows an electronic device suitable for implementing the embodiments of the present disclosure (such as Figure 5Schematic structural diagram of the terminal device or server 500 therein. The terminal device in the embodiments 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. Figure 5 The electronic device shown is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0113] As Figure 5 shown, the electronic device 500 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 501, which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage device 508 into the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. The editing / output (I / O) interface 505 is also connected to the bus 504.
[0114] Generally, 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 wiredly to exchange data. Although Figure 5 the electronic device 500 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.
[0115] Particularly, according to the embodiments of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program may 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 embodiments of the present disclosure are executed.
[0116] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are for illustrative purposes only and are not used to limit the scope of these messages or information.
[0117] The electronic device provided in the embodiments of the present disclosure and the video processing method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be referred to in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0118] The embodiments of the present disclosure provide a computer storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the video processing method provided in the above embodiments.
[0119] It should be noted that the computer-readable medium in the present disclosure may be a computer-readable signal medium, 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, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having 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, and the program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take various 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, and the computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted by any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0120] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed network.
[0121] The above computer-readable medium can be included in the above electronic device; or it can exist separately without being assembled into the electronic device.
[0122] The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to:
[0123] The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to:
[0124] In response to a request to enter a target live broadcast room, obtain at least one streaming address corresponding to the target live broadcast room and device parameters corresponding to the target terminal; wherein, the at least one streaming address corresponds to video streams with at least one screen ratio;
[0125] Based on the device parameters, determine a target streaming address from the at least one streaming address;
[0126] Obtain a target video stream based on the target streaming address to determine the live broadcast screen of the target live broadcast room based on the target video stream.
[0127] Computer program code for performing the operations of the present disclosure can be written in one or more programming languages or combinations thereof. The above programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can 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 can be connected to an external computer (e.g., by using an Internet service provider to connect through the Internet).
[0128] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur in a different order than that noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or by a combination of dedicated hardware and computer instructions.
[0129] The units described in the embodiments of the present disclosure can be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation to the unit itself in some cases. For example, the first acquisition unit can also be described as "the unit for acquiring at least two Internet protocol addresses".
[0130] The functions described above herein can be performed, at least in part, by one or more hardware logic components. For example, by way of non-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 a chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0131] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0132] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
[0133] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0134] 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. On the contrary, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A video processing method, characterized in that, Including: In response to a request to enter a target live broadcast room, obtain at least one pull stream address corresponding to the target live broadcast room and device parameters corresponding to the target terminal; wherein, the at least one pull stream address corresponds to video streams of at least one screen ratio; Based on the device parameters, determine a target pull stream address from the at least one pull stream address; Obtain a target video stream based on the target pull stream address, so as to determine the live broadcast screen of the target live broadcast room based on the target video stream.
2. The method according to claim 1, wherein Before obtaining at least one pull stream address corresponding to the target live broadcast room and device parameters corresponding to the target terminal, the method further includes: Obtain the live broadcast room identifier of the target live broadcast room; Determine whether the live broadcast room identifier includes at least one pull stream address; If so, obtain the at least one pull stream address and the device parameters.
3. The method according to claim 1, wherein Also including: Determine at least one live broadcast room to be transcoded according to object information and / or business scenario information associated with at least one live broadcast room; Perform transcoding processing on the obtained source video stream according to the transcoding task corresponding to the at least one live broadcast room to be transcoded, to obtain a transcoded video stream; Store the source video stream and the pull stream address corresponding to the transcoded video stream.
4. The method according to claim 3, characterized in that, The at least one live broadcast room to be transcoded includes the target live broadcast room.
5. The method according to claim 3, characterized in that, The performing transcoding processing on the obtained source video stream according to the transcoding task corresponding to the at least one live broadcast room to be transcoded, to obtain a transcoded video stream, includes: Based on the transcoding identifier in the transcoding task, process the 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 the size ratio of the target terminal, and the determining a target pull stream address from the at least one pull stream address based on the device parameters includes: Based on the size ratio, determine a target screen ratio; If there is a pull stream address corresponding to the target screen ratio, use the pull stream address as the target pull stream address.
7. The method according to claim 6, wherein Also including: If there is no pull stream address corresponding to the target screen ratio, use the pull stream address corresponding to the source video stream as the target pull stream address.
8. The method according to claim 1, wherein Also including: In response to a request for a joint broadcast between the target live broadcast room and at least one joint broadcast live broadcast room, obtain the pull stream addresses to be obtained corresponding to the source video streams of the target live broadcast room and the joint broadcast live broadcast rooms; Update the target pull stream address based on the pull stream addresses to be obtained, so as to obtain the source video stream based on the updated target pull stream address.
9. A video processing device, characterized in that, Including: An information acquisition module, configured to, in response to a request to enter a target live broadcast room, obtain at least one pull stream address corresponding to the target live broadcast room and device parameters corresponding to the target terminal; wherein, the at least one pull stream address corresponds to video streams of at least one screen ratio; A pull stream address determination module, configured to determine a target pull stream address from the at least one pull stream address based on the device parameters; A video stream display module, configured to obtain a target video stream based on the target pull stream address, so as to determine the live broadcast screen of the target live broadcast room based on the target video stream.
10. An electronic device, characterized in that, The electronic device includes: 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, such that the one or more processors implement the video processing method according to any one of claims 1-8.
11. A storage medium containing computer-executable instructions that, when executed by a computer processor, are used to execute the video processing method according to any one of claims 1-8.