CN108462825A - Method for processing video frequency and device - Google Patents
Method for processing video frequency and device Download PDFInfo
- Publication number
- CN108462825A CN108462825A CN201710094655.3A CN201710094655A CN108462825A CN 108462825 A CN108462825 A CN 108462825A CN 201710094655 A CN201710094655 A CN 201710094655A CN 108462825 A CN108462825 A CN 108462825A
- Authority
- CN
- China
- Prior art keywords
- picture
- url
- main thread
- worker
- array
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000012545 processing Methods 0.000 title abstract description 13
- 238000006243 chemical reaction Methods 0.000 claims abstract description 11
- 230000005540 biological transmission Effects 0.000 claims abstract description 7
- 238000003491 array Methods 0.000 claims description 32
- 238000000605 extraction Methods 0.000 claims description 7
- 239000000284 extract Substances 0.000 claims description 5
- 238000004891 communication Methods 0.000 description 6
- 230000009471 action Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000013515 script Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- FGRBYDKOBBBPOI-UHFFFAOYSA-N 10,10-dioxo-2-[4-(N-phenylanilino)phenyl]thioxanthen-9-one Chemical compound O=C1c2ccccc2S(=O)(=O)c2ccc(cc12)-c1ccc(cc1)N(c1ccccc1)c1ccccc1 FGRBYDKOBBBPOI-UHFFFAOYSA-N 0.000 description 1
- VYZAMTAEIAYCRO-UHFFFAOYSA-N Chromium Chemical compound [Cr] VYZAMTAEIAYCRO-UHFFFAOYSA-N 0.000 description 1
- 241001269238 Data Species 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000000151 deposition Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 230000008014 freezing Effects 0.000 description 1
- 238000007710 freezing Methods 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000013442 quality metrics Methods 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 230000001568 sexual effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000007306 turnover Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/698—Control of cameras or camera modules for achieving an enlarged field of view, e.g. panoramic image capture
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72403—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
- H04M1/7243—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages
- H04M1/72439—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages for image or video messaging
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72403—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
- H04M1/72445—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality for supporting Internet browser applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/4402—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
- H04N21/440236—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by media transcoding, e.g. video is transformed into a slideshow of still pictures, audio is converted into text
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Computer Networks & Wireless Communication (AREA)
- Business, Economics & Management (AREA)
- General Business, Economics & Management (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the present application provides a kind of method for processing video frequency and device, described device includes main thread module, for calling main thread to obtain the video data in local or server, and the video data is sent to worker thread module, and after the picture array for receiving the transmission of worker thread module, from the picture array extracting required image data is showed;Worker thread module, library videoconverter.js is handled for loading video code conversion in worker thread Web Worker, the videoconverter.js is called by the Web Worker, the video data is converted into picture array via the videoconverter.js, and the picture array is sent to main thread module.
Description
Technical field
This application involves technical field of video processing, more particularly to a kind of method for processing video frequency and device.
Background technology
With smart mobile phone development with it is universal, the panorama software of mobile terminal comes into being, and the bat of panorama software may be used
Pan video.
In the prior art, panoramic video needs to upload onto the server after the completion of shooting, is converted into using by server
In the picture of panorama sketch, then front end is sent a picture to be shown.
However, server, during being converted to panoramic video, video process flow is longer, the service of expending is needed
Device resource or installation professional video application, and cannot timely preview.
Invention content
A kind of method for processing video frequency of the embodiment of the present application offer and device, described device includes main thread module, for adjusting
The video data in local or server is obtained with main thread, and the video data is sent to worker thread module,
And receive worker thread module transmission picture array after, extracted from the picture array required image data into
Row shows;Worker thread module handles library for loading video code conversion in worker thread Web Worker
Videoconverter.js, and, the videoconverter.js is called by the Web Worker, via described
The video data is converted into picture array by videoconverter.js, and the picture array is sent to main thread mould
Block.The method includes:It calls main thread to obtain the video data in local or server, and video data is sent to
Worker thread Web Worker, wherein load video code conversion in the Web Worker and handle library videoconverter.js;
The Web Worker call the videoconverter.js, via the videoconverter.js by the video counts
According to being converted into picture array, and the picture array is sent to the main thread;The main thread is from the picture array
Picture needed for extraction is showed.
Description of the drawings
Fig. 1 is a kind of browser structure block diagram of the embodiment of the present application;
Fig. 2 is a kind of video processing flow schematic diagram of the embodiment of the present application;
Fig. 2 a are a kind of exemplary object front schematic views of the application;
Fig. 2 b are a kind of exemplary object front schematic views of the application;
Fig. 3 is a kind of step flow chart of method for processing video frequency embodiment of the embodiment of the present application;
A kind of structure diagram of intelligent terminal embodiment of Fig. 4 the application.
Specific implementation mode
In order to make the above objects, features, and advantages of the present application more apparent, below in conjunction with the accompanying drawings and it is specific real
Applying mode, the present application will be further described in detail.
The design of the application is easy to carry out various modifications and alternative form, and specific embodiment is by way of attached drawing
It shows, and will be described in detail herein.It should be appreciated, however, that the above is not for the design of the application to be limited to
Disclosed concrete form, on the contrary, the description of the present application and additional claims are intended to cover all change, equally
With the form of replacement.
" one embodiment " in this specification, " embodiment ", " specific embodiment " etc. indicate described and implement
Example may include a particular feature, structure, or characteristic, but each embodiment may include or may not necessarily include so the specific spy
Sign, structure or characteristic.In addition, such phrase is not necessarily referring to the same embodiment.In addition, in contact one embodiment description
In the case of a particular feature, structure, or characteristic, regardless of whether being expressly recited, it is believed that range known to those skilled in the art
Interior, such feature, structure or characteristic are also related with other embodiment.Also, it should be understood that " A, B and C at least
One " may include following possible project in entry in list included by this form:(A);(B);(C);(A and
B);(A and C);(B and C);Or (A, B and C).Equally, the project that " at least one of A, B or C " this form is listed may anticipate
Taste (A);(B);(C);(A and B);(A and C);(B and C);Or (A, B and C).
In some cases, the disclosed embodiments may be implemented as hardware, firmware, software or its arbitrary combination.Institute
Disclosed embodiment can also be embodied as carrying or be stored in it is one or more temporary or nonvolatile it is machine readable (such as
It is computer-readable) instruction in storage medium, which can be executed by one or more processors.Machine readable storage medium
It may be implemented for storing or transmitting in the form of it can be read by a machine storage device, mechanism or other physics of information
Structure (such as volatibility or nonvolatile memory, dielectric disc or the other physical arrangement devices of other media).
In the accompanying drawings, some structure or method features can be specifically to arrange and/or sequencing display.It is preferable, however, that
Such specific arrangement and/or sequence are not necessary.On the contrary, in some embodiments, such feature can be with not
With mode and/or be ranked sequentially, rather than as shown in the drawing.In addition, specifically in the structure or method feature in attached drawing
Including content, it is not intended to imply that this feature be in all embodiments is necessary, and in some embodiments,
It may not include these features, or these features may be combined with other feature.
The present apparatus may include being not limited to browser, and other than browser, the present apparatus can also be that other web are applied
Program.
Fig. 1 schematically shows browser 100 according to various embodiments.Browser 100 may include various types of
Browser, for example, Google's Chrome browsers, Firefox browser, proud trip browser, Window on the World browser, Internet
Explorer, etc..
Browser 100 at least may include main thread module 102 and worker thread module 104.
Main thread module 102 can be used for calling the main thread in browser, worker thread module 104 to can be used for calling browsing
Web Worker threads in device.
In the implementation, there are one threads, the thread to be known as main thread for tool when each process initiation.
Web Workers are the javascript multithreading solutions that HTML5 is provided, can be by some big calculating
The code of amount transfers to Web Worker operations without freezing user interface.
In the concrete realization, main thread module 102 can call main thread to create Web Worker.Specifically, main line
Journey can load a javascript file to create Web Worker using Worker classes, play the effect for not blocking execution mutually
Fruit.
For main thread, a JS file can be loaded by Worker=new Worker (url) to create one
A Web Worker, while returning to a Worker example;Can by Worker.postMessage (data) methods come to
Web Worker transmission datas;The number that Web Worker are sended over is received by binding Worker.onmessage methods
According to;The execution of Web Worker is terminated using Worker.terminate ().
It, can be by postMessage (data) methods come to main thread transmission data for Web Worker;It is logical
Binding onmessage methods are crossed to receive the data that main thread sends over.
In the embodiment of the present application, video code conversion processing library can be loaded in Web Worker modules 104
Videoconverter.js 105, wherein videoconverter.js 105, which is one, can operate in regarding for browser end
Frequency transcoding and processing library, effect is to convert video data into picture stream.
In the embodiment of the present application, for main thread module 102, it can be used for calling main thread to obtain from local or clothes
The video data being engaged in device, and the video data is sent to worker thread worker thread module 104.
In the concrete realization, video data can be the video shot centered on present terminal or subject.
As a kind of preferable example, which can be panoramic video.Panoramic video is can be arbitrary with 360 degree up and down
The dynamic video of angle dragging viewing, is to develop to extend on the technology of three-dimensional panorama.
In one embodiment, main thread module 102 can pass through HTML's<input>Label obtains terminal local
Video data.
In another embodiment, main thread module 102 can call the camera of terminal to acquire video data.
For example, main thread module 102 can pass through in the page of browser<Input type=" file " accept=
" video/mp4, video/x-m4v, video/* ">The camera of terminal is called, in being with present terminal or subject
The heart shoots one 360 ° of video data.Then, main thread module 102 can pass through the FileReader object acquisitions of HTML5
The video data.Using FileReader objects, the reading that main thread module 102 can be asynchronous is stored in the file of present terminal
(or original data buffer).
It should be noted that main thread module 102 is in addition to that in terminal local reading video data or can call camera
Acquire video data other than, can also use other modes obtain video data, for example, based on user ask, by HTTP come
The video data of server is obtained, the embodiment of the present application is not construed as limiting this.
It, can be by postMessage methods to worker thread module after main thread module 102 gets video data
104 send the video data.
For worker thread module 104, video code conversion processing library can be loaded in Web Worker
videoconverter.js 105.In the implementation, importScripts methods may be used in Web in worker thread module 104
Videoconverter.js105 scripts are loaded in Worker.
It is preferred in one kind of the embodiment of the present application after being loaded with videoconverter.js105 in Web Worker
In embodiment, worker thread module 104 is used to call videoconverter.js by Web Worker, via
Videoconverter.js105 converts video data into picture array.
Specifically, worker thread module 104 is communicated with main thread module 102, worker thread module 104 receives main line
After the video data that journey module 102 is sent, videoconverter.js105 can be called to be provided by Web Worker
Interface, video data is cut by picture array using videoconverter.js105.
It is further preferred that worker thread module 104 is used for:It is called by Web Worker
Videoconverter.js105 is decoded video data via videoconverter.js105, obtains multiple videos
Frame, after the multiple video frame is converted into the image data with a certain picture format respectively, the respectively described image data
Picture name is configured, and the image data and corresponding picture name are organized into picture array.
Specifically, after worker thread module 104 receives the video data that main thread module 102 is sent, Ke Yitong
The interface that Web Worker call videoconverter.js105 to be provided is crossed, via videoconverter.js105 to regarding
Frequency obtains the frame of the video data, frame is then converted into a certain picture format (for example, jpeg formats) according to being decoded
Image data, and the picture name of image data is named as to the title of configuration, finally export picture array.
As an example, videoconver.js105 video data is changed into the command parameter of picture array can be with
For:- i filename.mp4-f image2-vf " transpose=1 "-an out%d.jpeg.
Wherein ,-i:Filename.mp4 indicates that the video file of input is filename.mp4, and-i indicates inlet flow;-f:
Image2 indicates that designated document output type is image2, and-f is output file type, and image2 is image data;-vf:\"
Transpose=1 " indicate specified video stream filter be transpose (transpose be screen overturn filter,
Video frame can be rotated and turn over);- an indicates not recording audio;Out%d.jpeg indicates output picture name format
For index (index)+type suffix of out+ files, %d indicates that picture corresponds to the index of video frame.
The expression of mentioned order parameter is meant:The video file stream that filename is MP4 is inputted, output is comprising entitled
The jpeg picture arrays of out%d, for example, the picture name of output is out1.jpeg.
It should be noted that the image data in the embodiment of the present application is the binary data of picture
(BinaryString)。
In the picture array obtained after videoconver.js105 is handled, each image data can include two
Field, respectively data and name.Data is an ArrayBuffer object, and content is the binary data of a frame picture;
Name is per the corresponding picture name of frame image data.
For example, the image data of first frame can indicate as follows:
{
“name”:“out1.jpeg”,
“data”:ArrayBuffer
}
It, can be with after worker thread module converts video data into picture array by videoconverter.js105
The picture array is transferred in main thread module using postMessage methods.
Can also be other clear it should be noted that the embodiment of the present application is not limited to above-mentioned videoconvert.js
Look at the script bank that can be by Video Quality Metric at picture array of device end operation, such as Broadway.js.
In one implementation, after main thread module 102 receives the picture array that worker thread module 104 is sent,
It can be by the picture storage of array in memory.
In a kind of preferred embodiment of the embodiment of the present application, main thread module 102 is used for in the picture array
Every frame image data, create the corresponding URL objects of the image data, generate picture URL arrays.
Main thread module 102, can be by main thread to each frame in picture array in order to identify picture array
Image data is converted, and the corresponding URL objects of every frame image data are obtained.
Specifically, after main thread module 102 receives picture array, for every frame picture number in the picture array
According to, it can be by the binary data of main thread reading data fields, and be based on the binary data and create Blob (binary
Large object, binary large object) object, wherein Blob is a container that can store binary file, for depositing
Store up the field type of binary file.
In one embodiment, based on data create Blob mode can be:Blob=new Blob
([B.data])。
After obtaining Blob objects, main thread can create the URL objects of the Blob objects.
In one embodiment, main thread can by call window.URL.createObjectUrl (blob),
It reads data from Blob objects, and the URL objects per frame image data is created based on the data, wherein the URL objects can be with
It is used in img labels.
It, can be by all URL objects after image data all in picture array all creates corresponding URL objects
It is organized into picture URL arrays.
In a kind of preferred embodiment of the embodiment of the present application, main thread module 102 from picture array for extracting institute
The image data needed is showed.
After main thread module 102 receives picture array, can be extracted from the picture array by main thread needed for
Picture showed.
It is further preferred that main thread module 102 is for determining the specified angle needed;From the picture URL arrays
Extraction URL objects corresponding with the specified angle;It is shown based on the corresponding image data of the URL object acquisitions.
In the concrete realization, specified angle can be the angle that user currently wants the picture seen.As an example,
The specified angle may range from (- 180 °, 180 °), wherein can set the front of 0 ° of instruction subject.
In one embodiment, main thread module 102 can determine the specified angle needed by the gyroscope of terminal.
Gyroscope is with the moment of momentum sensitivity shell relative inertness space of high-speed rotator around being orthogonal to one of the axis of rotation
Or the angular movement detection device of two axis, main thread module 102 can obtain present terminal according to the gyroscope of present terminal and exist
Drift rate rat on gamma coordinates determines specified angle.
Specifically, main thread module 102 can be by the deviceorientation events of monitoring present terminal, i.e.,
Window.addEventLister (" deviceorientation ", callback, false), to obtain present terminal
Drift rate rat on gamma coordinates.
In practice, in order to which when observing 180 ° of angle, present terminal will not overturn 90 °, can set drift rate
Between value range is 20 ° Dao -20 °, 20 ° are set to if drift rate is more than 20 °, it will if drift rate is less than -20 °
It is set as -20 °.
In the implementation, after obtaining drift rate rat, the specified angle that can currently be needed by following formula
degree:
In another embodiment, it is defeated that main thread module 102 can also receive user to specified angle=rat/20*180
The specified angle entered.
In the implementation, which can be inputted by user by interface.
It should be noted that the embodiment of the present application and it is limited to the mode that above two determines specified angle, art technology
Personnel determine that specified angle is possible using other modes, for example, it is also possible to click the position of screen based on user come really
Determine specified angle.
Based on the specified angle, main thread module 102 can be extracted corresponding with the specified angle from picture URL arrays
URL objects.
In one embodiment, main thread module 102 can extract URL corresponding with specified angle in the following way
Object:
Determine the array length of the picture URL arrays;Based on the array length and the specified angle, institute is calculated
Picture indices of the corresponding URL objects of specified angle in picture URL arrays are stated, and obtain the corresponding URL of the picture indices
Object.
Specifically, main thread module 102 can obtain the array length of picture URL arrays by Array.length
Length is based on length and specified angle degree, can calculate the corresponding URL objects of specified angle in picture URL arrays
In picture indices.
For example, following formula, which may be used, in main thread module 102 calculates picture indices:
parseInt((degree+180)/360*(length-1));
Because the corresponding picture of different angle is stored in an array, the index of array is integer, therefore can be with
Rounding parseInt is carried out to result of calculation.
After obtaining picture indices, picture indices meaning can be obtained from picture URL arrays according to the picture indices
The URL objects shown.
After determining URL objects corresponding with specified angle, the URL objects can be loaded, to show this in a browser
The corresponding picture of URL objects.
In the embodiment of the present application, videoconverter.js can be loaded in Web Worker, has expanded Web
The function of Worker so that browser can independently carry out the cutting of video data, be not necessarily to reliance server, save server
Resource enriches the function of browser, reduces the time that user waits for, and improves picture crawl efficiency.
In order to make those skilled in the art can better understand that the embodiment of the present application, at the video in conjunction with shown in Fig. 2
Flow diagram is managed, the embodiment of the present application is illustrated below by way of a concrete application scene:
The main thread module of mobile phone browser is passed through using main thread<Input type=" file " accept="
video/mp4,video/x-m4v,video/*”>Calling mobile phone camera shoots one centered on mobile phone or subject
A 360 ° of video, main thread module obtain video data by FileReader;
Main thread module sends video data to worker thread module, wherein is loaded in worker thread module
Videoconverter.js scripts;
After worker thread module receives video data, videoconverter.js, warp are called by Web Worker
Video data is decoded by videoconverter.js, is converted into picture array;During conversion, main thread is not
It can be blocked, user still can carry out other operations on the page;
Then, picture array is sent to main thread module by worker thread module;
After main thread module receives picture array, picture array is converted into ObjectUrl arrays;
Main thread module obtains drift rate of the mobile phone on gamma coordinates according to the gyroscope of mobile phone, current to calculate
Angle;
Main thread module obtains the corresponding picture URL of current angular from ObjectUrl arrays;
Corresponding picture is obtained based on picture URL, and shows the picture in a browser.
For example, it is assumed that 0 ° of front for representing object when then current angular is 150 °, is shown in a browser as shown in Figure 2 a
The picture shown is as shown in Figure 2 b.
The process that video is decoded and converted by this example has been put into browser end to do, and can save server resource, drops
The time that low user waits for.
With reference to Fig. 3, a kind of step flow chart of method for processing video frequency embodiment of the application is shown, wherein this method
It is executed by the browser described in Fig. 1.The embodiment of the present application may include:
Box 301 calls main thread to obtain the video data in local or server, and video data is sent to
Worker thread Web Worker, wherein load video code conversion in the Web Worker and handle library videoconverter.js;
Box 302, the Web Worker call the videoconverter.js, via described
The video data is converted into picture array by videoconverter.js, and the picture array is sent to the main line
Journey;
Box 303, the main thread extract required image data from the picture array and are showed.
In a kind of preferred embodiment of the embodiment of the present application, box 302 may further be:Described in calling
Videoconverter.js is decoded the video data via the videoconverter.js, obtains multiple regard
Frequency frame, after the multiple video frame is converted into the image data with a certain designated pictures format respectively, the respectively described figure
Sheet data configures picture name, and the image data and corresponding picture name are organized into picture array.
In a kind of preferred embodiment of the embodiment of the present application, the embodiment of the present application further includes:
Main thread is directed to every frame image data in the picture array, creates the corresponding URL objects of the image data,
Generate picture URL arrays.
In a kind of preferred embodiment of the embodiment of the present application, box 303 is specifically as follows:
The main thread determines the specified angle needed;Extraction and the specified angle pair from the picture URL arrays
The URL objects answered;It is shown based on the corresponding image data of the URL object acquisitions.
In a kind of preferred embodiment of the embodiment of the present application, the extraction from the picture URL arrays and the finger
Determine the corresponding URL objects of angle, including:
Determine the array length of the picture URL arrays;Based on the array length and the specified angle, institute is calculated
Picture indices of the corresponding URL objects of specified angle in picture URL arrays are stated, and obtain the corresponding URL of the picture indices
Object.
In a kind of preferred embodiment of the embodiment of the present application, the main thread is the main thread in browser, the Web
Worker is the Web Worker in browser.
In the embodiment of the present application, video code conversion processing library videoconverter.js is loaded in Web Worker,
After the video data that Web Worker receive main thread transmission, video thread is turned using videoconverter.js
It changes picture array into, and picture array is sent to main thread, it, will be in the picture array after main thread receives picture array
Every frame image data be converted into corresponding URL objects, after determining specified angle, main thread obtain the specified angle correspondence
URL objects, load the URL objects, to show the corresponding picture of the specified angle in a browser, whole process is without clothes
The participation of business device, saves server resource, improves the efficiency of grabgraf.
For embodiment of the method, since it is substantially similar to above-mentioned browser embodiment, so the comparison of description is simple
Single, the relevent part can refer to the partial explaination of embodiments of method.
It should be noted that for embodiment of the method, for simple description, therefore it is all expressed as a series of action group
It closes, but those skilled in the art should understand that, the embodiment of the present application is not limited by the described action sequence, because according to
According to the embodiment of the present application, certain steps can be performed in other orders or simultaneously.Secondly, those skilled in the art also should
Know, embodiment described in this description belongs to preferred embodiment, and involved action not necessarily the application is implemented
Necessary to example.
Embodiment of the disclosure can be implemented as using any suitable hardware, firmware, software, or and its it is arbitrary combine into
The system of the desired configuration of row.Fig. 4 schematically shows showing for each embodiment that can be used for realizing described in the disclosure
Example sexual system (or device) 400.
For one embodiment, Fig. 4 shows exemplary system 400, the system have one or more processors 402,
It is coupled to the system control module (chipset) 404 of at least one of (one or more) processor 402, is coupled to and be
The system storage 406 for control module 404 of uniting is coupled to the nonvolatile memory (NVM) of system control module 404/deposit
Storage equipment 408 is coupled to one or more input-output apparatus 410 of system control module 404, and is coupled to and is
The network interface 412 for control module 406 of uniting.
Processor 402 may include one or more single or multiple core processors, processor 402 may include general processor or
The arbitrary combination of application specific processor (such as graphics processor, application processor, Baseband processor etc.).In some embodiments,
System 400 can be as the browser described in the embodiment of the present application.
In some embodiments, system 400 may include with instruction one or more computer-readable mediums (for example,
System storage 406 or NVM/ storage devices 408) and mutually merge with the one or more computer-readable medium and be configured as
It executes instruction and executes the one or more processors 402 of the action described in the disclosure to realize module.
For one embodiment, system control module 404 may include any suitable interface controller, with to (one or
It is multiple) at least one of processor 402 and/or any suitable equipment or component that are communicated with system control module 404 carries
For any suitable interface.
System control module 404 may include Memory Controller module, to provide interface to system storage 406.Storage
Device controller module can be hardware module, software module and/or firmware module.
System storage 406 can be used for for example, load of system 400 and storage data and/or instruction.For a reality
Example is applied, system storage 406 may include any suitable volatile memory, for example, DRAM appropriate.In some embodiments
In, system storage 406 may include four Synchronous Dynamic Random Access Memory of Double Data Rate type (DDR4SDRAM).
For one embodiment, system control module 404 may include one or more i/o controllers, with to
NVM/ storage devices 408 and (one or more) input-output apparatus 410 provide interface.
For example, NVM/ storage devices 408 can be used for storing data and/or instruction.NVM/ storage devices 408 may include appointing
It anticipates and nonvolatile memory appropriate (for example, flash memory) and/or may include that any suitable (one or more) is non-volatile and deposit
Equipment is stored up (for example, one or more hard disk drives (HDD), one or more CD (CD) drivers and/or one or more
Digital versatile disc (DVD) driver).
NVM/ storage devices 408 may include a part for the equipment being physically mounted on as system 400
Storage resource or its can by the equipment access without the part as the equipment.For example, NVM/ storage devices 408 can
It is accessed via (one or more) input-output apparatus 410 by network.
(one or more) input-output apparatus 410 can be system 400 provide interface with other arbitrary equipment appropriate
Communication, input-output apparatus 410 may include communication component, audio component, sensor module etc..Network interface 412 can be
System 400 provides interfaces with by one or more network communications, system 400 can according to one or more wireless network standards and/
Or arbitrary standards in agreement and/or agreement are carried out wireless communication with the one or more components of wireless network, such as access
Wireless network based on communication standard, such as WiFi, 2G or 3G or combination thereof carry out wireless communication.
For one embodiment, at least one of (one or more) processor 402 can be with system control module 404
The logic of one or more controllers (for example, Memory Controller module) is packaged together.For one embodiment, (one
Or multiple) at least one of processor 402 can be encapsulated in the logic of one or more controllers of system control module 404
Together to form system in package (SiP).For one embodiment, at least one of (one or more) processor 402 can
It is integrated on same mold with the logic of one or more controllers of system control module 404.For one embodiment, (one
It is a or multiple) at least one of processor 402 can be integrated with the logic of one or more controllers of system control module 404
To form system on chip (SoC) on same mold.
In various embodiments, system 400 can be, but not limited to be:Browser, work station, desk-top computing device or movement
Computing device (for example, lap-top computing devices, handheld computing device, tablet computer, net book etc.).In various embodiments,
System 400 can have more or fewer components and/or different frameworks.For example, in some embodiments, system 400 includes
One or more video cameras, keyboard, liquid crystal display (LCD) screen (including touch screen displays), nonvolatile memory port,
Mutiple antennas, graphic chips, application-specific integrated circuit (ASIC) and loud speaker.
Wherein, if display includes touch panel, display screen may be implemented as touch screen displays, be used by oneself with receiving
The input signal at family.Touch panel includes one or more touch sensors to sense the hand on touch, slide, and touch panel
Gesture.The touch sensor can not only sense the boundary of a touch or slide action, but also detect and the touch or sliding
Operate relevant duration and pressure.
The embodiment of the present application also provides a kind of non-volatile readable storage medium, in the storage medium storage there are one or
Multiple modules (programs) when the one or more module is used in terminal device, can make the terminal device execute
The instruction (instructions) of various method steps in the embodiment of the present application.
A kind of device is provided in one example, including:One or more processors;With what is stored thereon has instruction
One or more machine readable medias, when being executed by one or more of processors so that described device execute as this
Apply for the method that browser executes in embodiment.
Additionally provide one or more machine readable medias in one example, be stored thereon with instruction, when by one or
When multiple processors execute so that device executes the method such as browser execution in the embodiment of the present application.
The embodiment of the present application discloses a kind of method and apparatus, and example 1 includes a kind of device, including main thread module, is used
The video data in local or server is obtained in calling main thread, and the video data is sent to worker thread mould
Block, and after the picture array for receiving the transmission of worker thread module, required picture number is extracted from the picture array
According to being showed;Worker thread module handles library for loading video code conversion in worker thread Web Worker
Videoconverter.js calls the videoconverter.js, via described by the Web Worker
The video data is converted into picture array by videoconverter.js, and the picture array is sent to main thread mould
Block.
Example 2 may include the device described in example 1, wherein the worker thread module is used for:Pass through the Web
Worker calls the videoconverter.js, is solved to the video data via the videoconverter.js
Code, obtains multiple video frame, after the multiple video frame is converted into the image data with a certain picture format respectively, respectively
Picture name is configured for the image data, and the image data and corresponding picture name are organized into picture array.
Example 3 may include the device described in example 1 and/or example 2, wherein the main thread module is used for:For described
Every frame image data in picture array creates the corresponding URL objects of the image data, generates picture URL arrays.
Example 4 may include the device described in 3 one or more of example 1- examples, wherein the main thread module is used for:Really
Surely the specified angle needed;URL objects corresponding with the specified angle are extracted from the picture URL arrays;Based on described
The corresponding image data of URL object acquisitions is shown.
Example 5 may include the device described in 4 one or more of example 1- examples, wherein the main thread module is used for:Really
The array length of the fixed picture URL arrays;Based on the array length and the specified angle, the specified angle is calculated
Picture indices of the corresponding URL objects in picture URL arrays, and obtain the corresponding URL objects of the picture indices.
Example 6 may include the device described in 5 one or more of example 1- examples, wherein the main thread is in browser
Main thread, the Web Worker be browser in Web Worker.
Example 7 may include a kind of method, wherein the method includes:It calls main thread to obtain and comes from local or server
In video data, and video data is sent to worker thread Web Worker, wherein load and regard in the Web Worker
Frequency transcoding handles library videoconverter.js;The Web Worker call the videoconverter.js, via institute
It states videoconverter.js and the video data is converted into picture array, and the picture array is sent to the master
Thread;The main thread extracts required image data from the picture array and is showed.
Example 8 may include the method described in example 7, wherein described in the Web Worker are called
The video data is converted into picture array by videoconverter.js via the videoconverter.js, including:
The videoconverter.js is called, the video data is decoded via the videoconverter.js, is obtained
Multiple video frame, after the multiple video frame is converted into the image data with a certain picture format respectively, respectively institute
Image data configuration picture name is stated, and the image data and corresponding picture name are organized into picture array.
Example 9 may include the method described in example 7 and/or example 8, wherein further include:Main thread is directed to the picture number
Every frame image data in group creates the corresponding URL objects of the image data, generates picture URL arrays.
Example 10 may include the method described in 9 one or more of example 7- examples, wherein the main thread is from the picture
Extracting the step of required image data is showed in array includes:The main thread determines the specified angle needed;From institute
It states and extracts URL objects corresponding with the specified angle in picture URL arrays;Based on the corresponding picture of the URL object acquisitions
Data are shown.
Example 11 may include the method described in 10 one or more of example 7- examples, wherein described from the picture URL numbers
The step of extraction URL objects corresponding with the specified angle, includes in group:Determine the array length of the picture URL arrays;
Based on the array length and the specified angle, the corresponding URL objects of the specified angle are calculated in picture URL arrays
Picture indices, and obtain the corresponding URL objects of the picture indices.
Example 12 may include the method described in 11 one or more of example 7- examples, wherein the main thread is browser
In main thread, the Web Worker be browser in Web Worker.
Example 13, a kind of device, including:One or more processors;What is stored thereon has the one or more of instruction
Machine readable media, when being executed by one or more of processors so that described device executes such as claim example 7-
The one or more method of example 12.
Example 14, one or more machine readable medias, are stored thereon with instruction, are executed when by one or more processors
When so that device executes as one or more methods such as claim example 7- examples 12.
Although some embodiments are for the purpose of illustrating and describing, various replacements, and/or equivalent implementation
Scheme calculates to reach the realization that same purpose implementation is exemplified and described, and does not depart from the practical range of the application.This Shen
It please be intended to any modification or variation of the embodiment that covering is discussed herein.It is, therefore, apparent that embodiment described herein only by right
It is required that being limited with their equivalent.
Claims (14)
1. a kind of device, including:
Main thread module, for calling main thread to obtain video data in local or server, and by the video counts
According to being sent to worker thread module, and after the picture array for receiving the transmission of worker thread module, from the picture array
Image data needed for middle extraction is showed;
Worker thread module handles library for loading video code conversion in worker thread Web Worker
Videoconverter.js calls the videoconverter.js, via described by the Web Worker
The video data is converted into picture array by videoconverter.js, and the picture array is sent to main thread mould
Block.
2. the apparatus according to claim 1, the worker thread module is used for:
The videoconverter.js is called by the Web Worker, via the videoconverter.js to institute
It states video data to be decoded, obtains multiple video frame, the multiple video frame is converted into have a certain picture format respectively
Image data after, the respectively image data configures picture name, and by the image data and corresponding picture name
Title is organized into picture array.
3. device according to claim 1 or 2, the main thread module is used for:
For every frame image data in the picture array, the corresponding URL objects of the image data are created, generate picture
URL arrays.
4. device according to claim 3, the main thread module is used for:
Determine the specified angle needed;
URL objects corresponding with the specified angle are extracted from the picture URL arrays;
It is shown based on the corresponding image data of the URL object acquisitions.
5. device according to claim 4, the main thread module is used for:
Determine the array length of the picture URL arrays;
Based on the array length and the specified angle, the corresponding URL objects of the specified angle are calculated in picture URL numbers
Picture indices in group, and obtain the corresponding URL objects of the picture indices.
6. device according to claim 1 or 2, which is characterized in that the main thread is the main thread in browser, described
Web Worker are the Web Worker in browser.
7. a kind of method, including:
It calls main thread to obtain the video data in local or server, and video data is sent to worker thread Web
Worker, wherein load video code conversion in the Web Worker and handle library videoconverter.js;
The Web Worker call the videoconverter.js, are regarded by described in via the videoconverter.js
Frequency evidence is converted into picture array, and the picture array is sent to the main thread;
The main thread extracts required image data from the picture array and is showed.
8. according to the method described in claim 7, the Web Worker call the videoconverter.js, via institute
Stating the step of video data is converted into picture array by videoconverter.js includes:
The videoconverter.js is called, the video data is solved via the videoconverter.js
Code, obtains multiple video frame, after the multiple video frame is converted into the image data with a certain picture format respectively, respectively
Picture name is configured for the image data, and the image data and corresponding picture name are organized into picture array.
9. method according to claim 7 or 8, further includes:
Main thread is directed to every frame image data in the picture array, creates the corresponding URL objects of the image data, generates
Picture URL arrays.
10. according to the method described in claim 9, the main thread extracted from the picture array required image data into
Row the step of showing includes:
The main thread determines the specified angle needed;
URL objects corresponding with the specified angle are extracted from the picture URL arrays;
It is shown based on the corresponding image data of the URL object acquisitions.
11. according to the method described in claim 10, the extraction from the picture URL arrays is corresponding with the specified angle
URL objects the step of include:
Determine the array length of the picture URL arrays;
Based on the array length and the specified angle, the corresponding URL objects of the specified angle are calculated in picture URL numbers
Picture indices in group, and obtain the corresponding URL objects of the picture indices.
12. method according to claim 7 or 8, which is characterized in that the main thread is the main thread in browser, institute
It is the Web Worker in browser to state Web Worker.
13. a kind of device, which is characterized in that including:
One or more processors;With
One or more machine readable medias of instruction are stored thereon with, when being executed by one or more of processors, are made
Obtain the method that described device executes such as claim 7-12 one or more.
14. one or more machine readable medias, are stored thereon with instruction, when executed by one or more processors so that
Device executes the method such as claim 7-12 one or more.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710094655.3A CN108462825A (en) | 2017-02-21 | 2017-02-21 | Method for processing video frequency and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710094655.3A CN108462825A (en) | 2017-02-21 | 2017-02-21 | Method for processing video frequency and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108462825A true CN108462825A (en) | 2018-08-28 |
Family
ID=63229274
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710094655.3A Pending CN108462825A (en) | 2017-02-21 | 2017-02-21 | Method for processing video frequency and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108462825A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111432262A (en) * | 2020-02-24 | 2020-07-17 | 杭州海康威视数字技术股份有限公司 | Page video rendering method and device |
CN111510744A (en) * | 2020-07-01 | 2020-08-07 | 北京美摄网络科技有限公司 | Method and device for processing video and audio, electronic equipment and storage medium |
CN111708630A (en) * | 2020-05-06 | 2020-09-25 | 深圳震有科技股份有限公司 | Multithreading processing method and equipment based on web front-end technology and storage medium |
CN112148675A (en) * | 2020-11-24 | 2020-12-29 | 树根互联技术有限公司 | Data transmission method and device, electronic equipment and storage medium |
CN113342506A (en) * | 2021-07-05 | 2021-09-03 | 湖南快乐阳光互动娱乐传媒有限公司 | Data processing method and device |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1764270A (en) * | 2005-10-10 | 2006-04-26 | 中兴通讯股份有限公司 | Video monitoring method and system based on WAP browser |
US20080172703A1 (en) * | 2007-01-16 | 2008-07-17 | Samsung Electronics Co., Ltd. | Method and apparatus for transmitting and receiving graphical data |
CN201207693Y (en) * | 2007-09-03 | 2009-03-11 | 上海广涌音像制作有限公司 | Mobile phone multimedia innovation studio |
CN101938599A (en) * | 2009-06-30 | 2011-01-05 | 爱国者全景(北京)网络科技发展有限公司 | Method for generating interactive dynamic panoramic image |
CN102075800A (en) * | 2011-01-11 | 2011-05-25 | 中兴通讯股份有限公司 | File play control method and system based on interactive personnel television set top box |
CN102265271A (en) * | 2008-10-29 | 2011-11-30 | 谷歌公司 | System and method for translating timed text in web video |
CN102577327A (en) * | 2011-12-26 | 2012-07-11 | 华为技术有限公司 | Method, apparatus and system for realizing web browsing in remote desk environment |
CN104219584A (en) * | 2014-09-25 | 2014-12-17 | 广州市联文信息科技有限公司 | Reality augmenting based panoramic video interaction method and system |
CN105791882A (en) * | 2016-03-22 | 2016-07-20 | 腾讯科技(深圳)有限公司 | Video coding method and device |
-
2017
- 2017-02-21 CN CN201710094655.3A patent/CN108462825A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1764270A (en) * | 2005-10-10 | 2006-04-26 | 中兴通讯股份有限公司 | Video monitoring method and system based on WAP browser |
US20080172703A1 (en) * | 2007-01-16 | 2008-07-17 | Samsung Electronics Co., Ltd. | Method and apparatus for transmitting and receiving graphical data |
CN201207693Y (en) * | 2007-09-03 | 2009-03-11 | 上海广涌音像制作有限公司 | Mobile phone multimedia innovation studio |
CN102265271A (en) * | 2008-10-29 | 2011-11-30 | 谷歌公司 | System and method for translating timed text in web video |
CN101938599A (en) * | 2009-06-30 | 2011-01-05 | 爱国者全景(北京)网络科技发展有限公司 | Method for generating interactive dynamic panoramic image |
CN102075800A (en) * | 2011-01-11 | 2011-05-25 | 中兴通讯股份有限公司 | File play control method and system based on interactive personnel television set top box |
CN102577327A (en) * | 2011-12-26 | 2012-07-11 | 华为技术有限公司 | Method, apparatus and system for realizing web browsing in remote desk environment |
CN104219584A (en) * | 2014-09-25 | 2014-12-17 | 广州市联文信息科技有限公司 | Reality augmenting based panoramic video interaction method and system |
CN105791882A (en) * | 2016-03-22 | 2016-07-20 | 腾讯科技(深圳)有限公司 | Video coding method and device |
Non-Patent Citations (1)
Title |
---|
GITHUB: "videoconverter.js - Convert Videos In Your Web Browser", 《HTTPS://BGRINS.GITHUB.IO/VIDEOCONVERTER.JS/》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111432262A (en) * | 2020-02-24 | 2020-07-17 | 杭州海康威视数字技术股份有限公司 | Page video rendering method and device |
CN111432262B (en) * | 2020-02-24 | 2022-05-24 | 杭州海康威视数字技术股份有限公司 | Page video rendering method and device |
CN111708630A (en) * | 2020-05-06 | 2020-09-25 | 深圳震有科技股份有限公司 | Multithreading processing method and equipment based on web front-end technology and storage medium |
CN111510744A (en) * | 2020-07-01 | 2020-08-07 | 北京美摄网络科技有限公司 | Method and device for processing video and audio, electronic equipment and storage medium |
CN111510744B (en) * | 2020-07-01 | 2020-10-16 | 北京美摄网络科技有限公司 | Method and device for processing video and audio, electronic equipment and storage medium |
CN112148675A (en) * | 2020-11-24 | 2020-12-29 | 树根互联技术有限公司 | Data transmission method and device, electronic equipment and storage medium |
CN113342506A (en) * | 2021-07-05 | 2021-09-03 | 湖南快乐阳光互动娱乐传媒有限公司 | Data processing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108462825A (en) | Method for processing video frequency and device | |
US20160110090A1 (en) | Gesture-Based Content-Object Zooming | |
US10769849B2 (en) | Use of temporal motion vectors for 3D reconstruction | |
US10032257B2 (en) | Super resolution processing method, device, and program for single interaction multiple data-type super parallel computation processing device, and storage medium | |
CN109194960A (en) | A kind of picture frame rendering method, device and electronic equipment | |
CN112165632B (en) | Video processing method, device and equipment | |
CN103702032A (en) | Image processing method, device and terminal equipment | |
US11785195B2 (en) | Method and apparatus for processing three-dimensional video, readable storage medium and electronic device | |
WO2022022689A1 (en) | Interaction method and apparatus, and electronic device | |
CN112565890B (en) | Video clipping method and device, storage medium and electronic equipment | |
US20170169599A1 (en) | Methods and electronic devices for displaying picture | |
CN107103890A (en) | Display application on fixed-direction display | |
CN112328353A (en) | Display method and device of sub-application player, electronic equipment and storage medium | |
US10424009B1 (en) | Shopping experience using multiple computing devices | |
KR20230133970A (en) | Photography methods, devices and electronics | |
WO2017101390A1 (en) | Picture display method and apparatus | |
EP4329285A1 (en) | Video photographing method and apparatus, electronic device, and storage medium | |
CN113015007A (en) | Video frame insertion method and device and electronic equipment | |
CN114416261B (en) | Information display method, device, equipment and medium | |
CN112351221B (en) | Image special effect processing method, device, electronic equipment and computer readable storage medium | |
WO2018175490A1 (en) | Providing a heat map overlay representative of user preferences relating to rendered content | |
US20170161871A1 (en) | Method and electronic device for previewing picture on intelligent terminal | |
CN109065001B (en) | Image down-sampling method and device, terminal equipment and medium | |
US20140111678A1 (en) | Method and system for capturing, storing and displaying animated photographs | |
CN107506119B (en) | Picture display method, device, equipment and storage medium |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180828 |