CN114554291A - Multi-video playing control method based on unity plug-in - Google Patents

Multi-video playing control method based on unity plug-in Download PDF

Info

Publication number
CN114554291A
CN114554291A CN202210144912.0A CN202210144912A CN114554291A CN 114554291 A CN114554291 A CN 114554291A CN 202210144912 A CN202210144912 A CN 202210144912A CN 114554291 A CN114554291 A CN 114554291A
Authority
CN
China
Prior art keywords
video
playing
unity
plug
player
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210144912.0A
Other languages
Chinese (zh)
Inventor
徐张杰
季晓枫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Magic Digital Creative Technology Co ltd
Original Assignee
Shanghai Magic Digital Creative Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Magic Digital Creative Technology Co ltd filed Critical Shanghai Magic Digital Creative Technology Co ltd
Priority to CN202210144912.0A priority Critical patent/CN114554291A/en
Publication of CN114554291A publication Critical patent/CN114554291A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • H04N21/4431OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB characterized by the use of Application Program Interface [API] libraries
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • H04N21/4438Window management, e.g. event handling following interaction with the user interface

Abstract

The invention relates to a multi-video playing control method based on unity plug-in, which comprises the following steps: the method comprises the steps of presetting a unity plug-in, wherein the unity plug-in provides a front-end visual control panel and function logic called by a background; importing and loading a unity plug-in unity software, taking a video as an object, inputting attribute information of the object and inputting playing sequence information among the objects on a control panel; analyzing data input by a control panel, transmitting the values obtained by analysis into a background, transmitting variable parameter values, calling a function based on background logic, and generating a control program script; the player executes the control program script to play the multi-video. Compared with the prior art, the multi-video playing control method and the multi-video playing control system have the advantages that the multi-video playing control is realized in the uinty through the plug-in, manpower and material resources are saved, relevant workers can easily input relevant parameter setting through the plug-in and obtain the control program script executed by the player, the difficulty of multi-video control is greatly reduced, and the manufacture of the multi-video playing control program is accelerated.

Description

Multi-video playing control method based on unity plug-in
Technical Field
The invention relates to the technical field of video playing, in particular to a multi-video playing control method based on unity plug-ins.
Background
At present, playing tools such as Media Player of Windows, players provided by movies and televisions or other manufacturers such as storm videos, perfect decoding and the like are often used for playing videos, but these players can only play a single video, and when playing multiple videos, smooth switching, custom switching, button switching and other operations cannot be achieved.
In some project scenes, a plurality of videos need to be played within a certain time period, in unity, plug-ins helpful for video processing are not rare, but plug-ins for playing the videos are rare, most of the plug-ins are plug-ins made by foreign manufacturers, and cannot provide description documents, timely difficult answers and technical support, and language difficulties exist in use.
If the video is created by itself without any plug-in, if the high-definition video has higher requirements on the performance of the computer, the phenomenon of resource waste is possibly caused, in the video playing project, in order to support the high-resolution and high-code-rate video, the performance of a memory, a CPU and a GPU is more expensive, and if a problem occurs, the problem is difficult to be eliminated. Moreover, each creation is carried out according to the video logic, the playing requirement and the like of the project, the reuse rate is low, and the method not only wastes manpower resources, but also is not beneficial to subsequent modification and maintenance.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a multi-video playing control method based on a unity plug-in, so that the difficulty of multi-video control is greatly reduced, and the production of a multi-video playing control program is accelerated.
The purpose of the invention can be realized by the following technical scheme:
a multi-video playing control method based on unity plug-in includes the following steps:
presetting a unity plug-in, wherein the unity plug-in provides a control panel with a visual front end and a function logic called by a background;
importing and loading a unity plug-in unity software, taking a video as an object, inputting attribute information of the object and inputting playing sequence information among the objects on a control panel;
analyzing data input by a control panel, transmitting the values obtained by analysis into a background, transmitting variable parameter values, calling a function based on background logic, and generating a control program script;
the player executes the control program script to play the multi-video;
specifically, the attribute information of the objects includes a number index, a video storage path video path, a video type, a video name, a Loop number Loop, and an Auto-play attribute Auto, and the play order information between the objects is determined by the size of the number index.
Further, the video type defaults to MP4 format, and also includes video formats supported by the player.
Further, the Loop time Loop is not less than 1, if the Loop is greater than 1, the player completes playing the video after the video automatically plays the Loop time in a Loop cycle manner, and if the Loop is equal to 1, the player completes playing the video after the video plays for 1 time.
Further, the Auto-play attribute Auto is default to be selected, if the Auto is in a selected state, the player acquires and loads the next video to be played according to the play sequence information in the video play process, the next video is automatically played after the video play is completed, and if the Auto is in an unselected state, the player stops the last frame of the video after the video play is completed.
Further, the player finds the next video to be played in the folder corresponding to the video storage path video path based on the video name and the video type.
Further, the attribute information of the object further includes a switching effect, where the switching effect is a switching effect between the video and a next video, and includes a black screen transition, a white screen transition, a superimposition transition, and the like.
Further, the unity plug-in also supports a jump function, and the plug-in has an open function PlayVideo (), and the input of the function PlayVideo () is the number index of the jumped video.
Furthermore, the jump function is realized by using a button of unity, the jump of the video playing sequence is realized by clicking the button to call a function PlayVideo (), the videos can be manually switched through the jump function, and the multi-video playing process can be manually ended by inputting a specific index value.
Furthermore, the control panel also inputs the video playing pixel size of the object, thereby controlling the definition of the video playing.
Further, the control panel also inputs the video playing speed of the object, so as to control the playing speed during video playing.
Compared with the prior art, the invention has the following beneficial effects:
(1) the multi-video playing control is realized in the uinty through the plug-in, manpower and material resources are saved, related workers can easily input related parameter setting through the plug-in and obtain a control program script executed by the player, the difficulty of multi-video control is greatly reduced, and the manufacture of a multi-video playing control program is accelerated.
(2) The plug-in is provided with a detailed description document, so that no language barrier exists, and timely problematic solution and technical support can be provided.
(3) The skip function is realized through the function call of the PlayVideo (), the video to be played next can be directly and manually skipped and switched, the freedom degree of multi-video control is higher, and the playing can be manually finished through the skip function.
(4) The use of the unity and unity plug-ins avoids the trial and error iteration process in the control program manufacturing process, and uses codes for saving computer resources and computing performance, so that the computer hardware requirement can be reduced, and the situations of video blocking, dead halt and rushing caused by insufficient computer performance can be avoided as much as possible.
(5) According to the playing sequence information, the video is loaded in advance, so that the smooth switching of the video can be controlled, and the seamless switching can be achieved.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a diagram illustrating specific parameters of the unit using the plug-in;
FIG. 3 is a diagram illustrating a procedure call in the process of using a plug-in by a unit.
Detailed Description
The invention is described in detail below with reference to the figures and specific embodiments. The present embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation manner and a specific operation process are given, but the scope of the present invention is not limited to the following embodiments.
In the drawings, structurally identical elements are represented by like reference numerals, and structurally or functionally similar elements are represented by like reference numerals throughout the several views. The size and thickness of each component shown in the drawings are arbitrarily illustrated, and the present invention is not limited to the size and thickness of each component. Parts are exaggerated in the drawing where appropriate for clarity of illustration.
Example 1:
a multiple video playing control method based on unity plugin, as shown in fig. 1, includes the following steps:
(1) the method comprises the steps that a unity plug-in is preset, and the unity plug-in provides a front-end visual control panel and function logic called by a background;
(2) importing and loading a unity plug-in unity software, taking a video as an object, inputting attribute information of the object and inputting playing sequence information among the objects on a control panel;
specifically, the attribute information of the objects includes a number index, a video storage path video path, a video type, a video name, a Loop number Loop, and an automatic playing attribute Auto, and the playing sequence information between the objects is determined by the size of the number index;
wherein:
the serial number index uniquely identifies the video object, and if the skip function is not set, the plurality of videos are sequentially played according to the value sequence of the index.
The video storage path is a video path, and can specify a folder, and all videos used in the multiple video playing are put into the folder;
the video type defaults to MP4 format and also includes video formats supported by the player, such as mkv.
The video name is the name of the video, and the names of different videos are different, so that the corresponding video can be found in the folder according to the video name.
The player finds the next video to be played in the folder corresponding to the video storage path video path based on the video name and the video type.
The Loop time Loop is more than or equal to 1 and represents the number of times of Loop playing of the video, if the Loop is greater than 1, the player completes playing of the video after the video is automatically played in a Loop mode for multiple times, and if the Loop is equal to 1, the player completes playing of the video after the video is played for 1 time.
The Auto playing attribute Auto is in a selected state by default, if the Auto is in the selected state, the player acquires and loads the next video to be played according to the playing sequence information in the video playing process, the next video is automatically played after the video playing is finished, and if the Auto is in an unselected state, the player stops at the last frame of the video after the video playing is finished and waits for a signal.
In addition, the attribute information of the object also includes a switching effect, the switching effect is a switching effect between the video and the next video, and includes black screen transition, white screen transition, overlapping transition and the like, and according to the options on the control panel, the player will realize the corresponding switching effect in the shader.
The user can also input the video playing pixel size of the object through the control panel, so that the definition of the video playing is controlled; the user can also input the video playing speed of the object through the control panel, so that the playing speed of the video playing is controlled.
The unity plug-in also supports a jump function, the plug-in has an open function PlayVideo (int VideoNum), the input of the function PlayVideo () is the number index of the video to be jumped, and the function can be added into the corresponding function according to the requirement. The function would first preload the video and seamlessly switch the player to the specified video. The skip function can be realized by using a button of unity, the button is clicked to call a function PlayVideo () to skip the video playing sequence, videos can be manually switched through the skip function, and the multi-video playing process can be manually ended by inputting a specific index value.
Generally, dragging in videos in sequence generates indexes according to the dragging sequence to determine the playing sequence, or manually dragging the videos to adjust the playing sequence, or inputting video names, editing list lists and customizing the video playing sequence.
(3) Analyzing data input by a control panel, transmitting the values obtained by analysis into a background, namely transmitting variable parameter values, calling a function based on background logic, and generating a control program script;
(4) the player executes the control program script to play the multi-video.
Taking the user as an example, the multi-video control using the pre-designed plug-in is explained as follows:
firstly, unit software is used, a newly-built project is created after the unit is opened, a designed unit plug-in is found, the plug-in can be imported by double clicking after the unit plug-in is completed, a folder of Multi-Video control can be seen after the import, two C # code files are arranged in the folder, two render textures can adjust the size of a Video playing pixel and a prefabricated body Video control, a Canvas is newly built in a unit scene, and the Video control is dragged to the Canvas in a Hierachy panel.
Clicking the dragged VideoController object can see the operation panel (i.e. the control panel provided by plug-in loading) which we will use in the instector panel on the right, wherein VideoConfig is the component we will use. As shown in FIG. 2, the "add object" can be clicked to add a video bar, which has the following information: index, video path, video type, video name, Loop, Auto. The index is a video number, and if jump playing is made, the video path is a video path which is defaulted to be a Streaming Assets folder of a project, namely, a video file can be directly added into the Streaming Assets folder of a project, so that the size of software is saved, reading is convenient, and mistakes are not easy to make. The video type is a type of video, defaults to an MP4 file, and can also support formats such as mkv. The video name is the most important information, which represents which video this video column will read. Loop represents whether the video loops, if so, the number of loops, etc. may be specified. Auto indicates whether the video plays the next one automatically, and if not selected, the video will stop at the last frame to wait for the signal.
Next, how to perform video jumping is described, first, a button (here, the button is used, and may be implemented by other methods, and the key point is that a video jumping function of a plug-in needs to be called) is newly created under canvas, parameters of the button are as shown in fig. 3, an plus sign is clicked at an onclick of the button, a VideoController is dragged in, a PlayVideo () function in a VideoConfig code is referred to, and the video number index mentioned above is filled in. Clicking on this button jumps to the specified video.
The plug-in provides the following functions:
the video objects are added or reduced through the buttons, the attribute information of the editing objects is input, and a user can fill in the video names, define addresses and file formats, check whether circulation is needed or not, whether automatic playing is needed or not, select the video switching effect and the like.
After the plug-in is loaded in unity, a video playing control panel for filling is generated by using the entity's instance, a corresponding video file is obtained from the Streaming Assets folder according to the name filled in on the control panel, in order to control the smooth switching of the video, the video with the next number is loaded in advance according to the video number to achieve seamless switching, and the alternate playing of the video is controlled according to the ' circulation ' option and the ' automatic switching ' option on the panel:
if the video is not circulated and switched automatically, the video automatically enters the next frame, and if the video is circulated and switched automatically, the video is played circularly until the set circulation times and then enters the next frame automatically, and if the video is circulated and switched manually, the video is played circularly until the set circulation times and stops at the last frame until the video is switched manually. In the above playing process, a button can be clicked to jump from the current video to the specified video or to end the playing.
Related steps and use descriptions in the unit use process are completely and clearly introduced above, and related practitioners can understand that, similarly, the unit plug-in may further add a switching effect, a speed doubling effect, a definition, a volume adjustment, a brightness adjustment, and the like, which are not described herein again.
The invention provides a multi-video playing control method based on unity plugins. When the plug-in is designed, one function logic on video switching processing in the background is realized, and the other function logic is realized by exposing the function call on the unit install panel, so that any user can use any function after simply reading.
Even if the relevant staff who does not have the programming language basis, can also input the corresponding parameter on the control panel that the plug-in loads, the parameter is transmitted to the backstage supporter, produce the corresponding control program script, therefore, has accelerated the making efficiency of the control software of playing the multi-video greatly, has greatly reduced the control and realization difficulty of playing the multi-video, and, the plug-in provides perfect backstage logic, the staff only involves the relevant parameter setting in the input of the control panel, does not involve algorithm and relevant control logic, has avoided the iterative process of trial and error in the procedure making process, experience good for the front end user.
The use of unity and unity plug-ins avoids the trial-and-error iteration process in the control program manufacturing process, and uses codes which save computer resources and computational performance, so that the computer hardware requirements can be reduced, the performances of a memory, a CPU and a GPU are reserved, and the situations of video blocking, halt and rushing caused by insufficient computer performance are avoided as far as possible. And the code is concise and easy to understand, the marking description is clean and clear, and the method is friendly to subsequent maintenance and development.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.

Claims (10)

1. A multi-video playing control method based on unity plug-in is characterized by comprising the following steps:
presetting a unity plug-in, wherein the unity plug-in provides a control panel with a visual front end and a function logic called by a background;
importing and loading a unity plug-in unity software, taking a video as an object, inputting attribute information of the object and inputting playing sequence information among the objects on a control panel;
analyzing data input by a control panel, transmitting the values obtained by analysis into a background, transmitting variable parameter values, calling a function based on background logic, and generating a control program script;
the player executes the control program script to play the multi-video;
specifically, the attribute information of the objects includes a number index, a video storage path video path, a video type, a video name, a Loop number Loop, and an Auto-play attribute Auto, and the play order information between the objects is determined by the size of the number index.
2. The method for controlling multiple video players based on unity plugin according to claim 1, wherein the video type defaults to MP4 format, further including video formats supported by the player.
3. The method of claim 1, wherein a Loop number Loop is greater than or equal to 1, if Loop >1, the player completes playing the video after the video is automatically played in a Loop number, and if Loop is 1, the player completes playing the video after the video is played 1 time.
4. The multi-video playing control method based on unity plugin according to claim 1 is characterized in that Auto playing attribute Auto default is selected, if Auto is in selected state, the player will obtain and load the next video to be played according to playing sequence information in the video playing process, after the video playing is completed, the player will automatically play the next video, if Auto is in unselected state, the player will stop the last frame of the video after the video playing is completed.
5. The method as claimed in claim 4, wherein the player finds the next video to be played in the folder corresponding to the video storage path video path based on the video name and the video type.
6. The method according to claim 1, wherein the attribute information of the object further includes a switching effect, and the switching effect is a switching effect between the video and a next video, and includes a black screen transition, a white screen transition, and a superimposition transition.
7. The multiple video playing control method based on unity plugin according to claim 1, characterized in that the unity plugin also supports a jump function, and there is an open function PlayVideo () in plugin, and the input of the function PlayVideo () is the number index of the jumped video.
8. The method according to claim 7, wherein the jump function is implemented using a button of unity, and clicking the button calls a function PlayVideo () to implement a jump in the video playback order.
9. The method as claimed in claim 1, wherein the control panel further inputs a video playing pixel size of the object.
10. The method as claimed in claim 1, wherein the control panel further inputs a video playback speed of the object.
CN202210144912.0A 2022-02-17 2022-02-17 Multi-video playing control method based on unity plug-in Pending CN114554291A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210144912.0A CN114554291A (en) 2022-02-17 2022-02-17 Multi-video playing control method based on unity plug-in

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210144912.0A CN114554291A (en) 2022-02-17 2022-02-17 Multi-video playing control method based on unity plug-in

Publications (1)

Publication Number Publication Date
CN114554291A true CN114554291A (en) 2022-05-27

Family

ID=81675192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210144912.0A Pending CN114554291A (en) 2022-02-17 2022-02-17 Multi-video playing control method based on unity plug-in

Country Status (1)

Country Link
CN (1) CN114554291A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040018712A (en) * 2002-08-26 2004-03-04 삼성전자주식회사 Set Top Box and controlling method thereof
US20050069280A1 (en) * 2003-09-29 2005-03-31 Inventec Corporation Method of controlling multimedia audio and video playback
WO2015020494A1 (en) * 2013-08-09 2015-02-12 넥스트리밍(주) Method of distributing plug-in for setting effect in mobile video editing tool
US20150347164A1 (en) * 2012-12-25 2015-12-03 Beijing Qihoo Technology Company Limited Method and Device for Playing Plug-in in Browser
US9583142B1 (en) * 2015-07-10 2017-02-28 Musically Inc. Social media platform for creating and sharing videos
CN109640153A (en) * 2018-12-12 2019-04-16 安徽科大国创软件科技有限公司 A kind of method and device thereof that the browser multiwindow based on VLC plays
CN110798722A (en) * 2019-09-27 2020-02-14 深圳市虚拟现实科技有限公司 Playing tool for VR video
CN112770164A (en) * 2020-12-22 2021-05-07 上海幻维数码创意科技股份有限公司 Video synchronous playing method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040018712A (en) * 2002-08-26 2004-03-04 삼성전자주식회사 Set Top Box and controlling method thereof
US20050069280A1 (en) * 2003-09-29 2005-03-31 Inventec Corporation Method of controlling multimedia audio and video playback
US20150347164A1 (en) * 2012-12-25 2015-12-03 Beijing Qihoo Technology Company Limited Method and Device for Playing Plug-in in Browser
WO2015020494A1 (en) * 2013-08-09 2015-02-12 넥스트리밍(주) Method of distributing plug-in for setting effect in mobile video editing tool
US9583142B1 (en) * 2015-07-10 2017-02-28 Musically Inc. Social media platform for creating and sharing videos
CN109640153A (en) * 2018-12-12 2019-04-16 安徽科大国创软件科技有限公司 A kind of method and device thereof that the browser multiwindow based on VLC plays
CN110798722A (en) * 2019-09-27 2020-02-14 深圳市虚拟现实科技有限公司 Playing tool for VR video
CN112770164A (en) * 2020-12-22 2021-05-07 上海幻维数码创意科技股份有限公司 Video synchronous playing method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
EDINBURGH_YX: "使用AVPro Video插件完成切换多个视频播放功能", pages 1, Retrieved from the Internet <URL:https://blog.csdn.net/Edinburgh_yx/article/details/71080667> *
想飞的小李子: "Unity播放视频——使用AVProVideo插件", pages 1, Retrieved from the Internet <URL:https://blog.csdn.net/lyb19940526/article/details/86640164> *

Similar Documents

Publication Publication Date Title
CN112184856A (en) Multimedia processing device supporting multi-layer special effect and animation mixing
US10225613B2 (en) Method and apparatus for video playing processing and television
US7403209B2 (en) Rendering images containing video
CN102547069B (en) Mobile terminal and image split-screen processing method therefor
DE202011110525U1 (en) Multifunction display device
CN107105351A (en) Regenerating unit
CN104410918A (en) Method and device for adjusting parameters of live video
CN101884221A (en) System and method for encoding video
JP2006509300A (en) Applet execution apparatus and method
CN110505511A (en) It is a kind of to play the method, apparatus of video, system in webpage and calculate equipment
CN111787412A (en) Method for supporting rapid production of multi-platform digital news short videos
CN111246289A (en) Video generation method and device, electronic equipment and storage medium
JP2013243747A (en) System and method for encoding video
CN114554291A (en) Multi-video playing control method based on unity plug-in
CN114466246A (en) Video processing method and device
US20080270984A1 (en) Script program execution device, script program execution method, and optical disk device
US9495472B1 (en) Systems and methods for newsroom management with electronic-publish-point integration
CN105516816A (en) Method and system for pushing television programs
US9691430B2 (en) Opportunistic frame caching
CN113988039A (en) Method and device for generating webpage through code-free automatic typesetting
CN112365905A (en) Player control method, device, equipment and readable storage medium
CN108600811B (en) Smart television, focus control method and device thereof, and readable storage medium
CN110636332A (en) Video processing method and device and computer readable storage medium
CN116684704B (en) Video processing method and device
CN116567341B (en) High concurrency signal processing platform based on golang

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination