Web-based video effect addition
The present disclosure provides methods and apparatuses for implementing video effect addition. At a target application, an original video frame may be obtained from a video source; the original video frame may be provided to a video effect processing application, the video effect processing application being a Web application; and a processed video frame to which a video effect is applied may be obtained from the video effect processing application. At a video effect processing application, an original video frame may be obtained from a target application; a video effect may be applied to the original video frame to obtain a processed video frame; and the processed video frame may be provided to the target application.
1 . A method for implementing video effect addition, the method being performed at a target application, and the method comprising:
obtaining an original video frame from a video source;
providing the original video frame to a video effect processing application, the video effect processing application being a Web application executed inside a sandboxed Web content container, wherein the sandboxed Web content container is instantiated in a restricted environment that denies the video effect processing application direct access to operating-system resources other than a designated shared-memory or MessageChannel port; and
obtaining, from the video effect processing application, a processed video frame to which a video effect is applied.
2 . The method of claim 1 , wherein
the target application is a Web application.
3 . The method of claim 2 , wherein
the providing the original video frame comprises: providing the original video frame to the video effect processing application in an approach of transferrable ArrayBuffer, and
the obtaining a processed video frame comprises: obtaining, from the video effect processing application, the processed video frame in an approach of transferrable ArrayBuffer.
4 . The method of claim 1 , wherein
the target application is a desktop application.
5 . The method of claim 4 , wherein
the providing the original video frame comprises: providing the original video frame to the video effect processing application through a shared memory, and
the obtaining a processed video frame comprises: obtaining, from the video effect processing application, the processed video frame through the shared memory.
6 . The method of claim 5 , further comprising:
implementing, through inter-process communication, synchronous access to the shared memory from the target application and the video effect processing application.
7 . An apparatus for implementing video effect addition, comprising:
at least one processor; and
a memory storing computer-executable instructions that, when executed, cause the at least one processor to perform the step of the method of claim 1 .
8 . A method for implementing video effect addition, the method being performed at a video effect processing application, the video effect processing application being a Web application, and the method comprising:
obtaining an original video frame from a target application;
executing the video effect processing application inside a sandboxed Web content container, wherein the sandboxed Web content container is instantiated in a restricted environment that denies the video effect processing application direct access to operating-system resources other than a designated shared-memory or MessageChannel port:
applying a video effect to the original video frame to obtain a processed video frame; and
providing the processed video frame to the target application.
9 . The method of claim 8 , wherein
the video effect processing application runs in a Web content container.
10 . The method of claim 9 , wherein
the target application is a Web application, and the Web content container is iframe.
11 . The method of claim 10 , wherein
the obtaining an original video frame comprises: obtaining the original video frame from the target application in an approach of transferrable ArrayBuffer, and
the providing the processed video frame comprises: providing the processed video frame to the target application in an approach of transferrable ArrayBuffer.
12 . The method of claim 9 , wherein
the target application is a desktop application, and the Web content container is Webview.
13 . The method of claim 12 , wherein
the obtaining an original video frame comprises: obtaining the original video frame from the target application through a shared memory, and
the providing the processed video frame comprises: providing the processed video frame to the target application through the shared memory.
14 . The method of claim 12 , wherein
the video effect processing application runs in a sandbox environment.
15 . At least one non-transitory machine-readable medium, comprising instructions that when executed by at least one processor, cause the at least one processor to perform operations to:
obtain an original video frame from a video source;
provide the original video frame to a video effect processing application, the video effect processing application being a Web application executed inside a sandboxed Web content container, wherein the sandboxed Web content container is instantiated in a restricted environment that denies the video effect processing application direct access to operating-system resources other than a designated shared-memory or MessageChannel port; and
obtain, from the video effect processing application, a processed video frame to which a video effect is applied.
16 . The at least one non-transitory medium of claim 15 , wherein the target application is a Web application.
17 . The at least one non-transitory medium of claim 16 , wherein
the instructions to provide the original video frame further comprises instructions to provide the original video frame to the video effect processing application in an approach of transferrable ArrayBuffer, and
the instructions to obtain a processed video frame further comprises instructions to obtain, from the video effect processing application, the processed video frame in an approach of transferrable ArrayBuffer.
18 . The at least one non-transitory medium of claim 16 , wherein the target application is a desktop application.
19 . The at least one non-transitory medium of claim 18 , wherein the instructions to provide the original video frame further comprises instructions to provide the original video frame to the video effect processing application through a shared memory, and the instructions to obtain a processed video frame further comprises instructions to obtain, from the video effect processing application, the processed video frame through the shared memory.
20 . The at least one non-transitory medium of claim 19 , further comprising instructions that when executed by at least one processor, cause the at least one processor to perform operations to:
implement, through inter-process communication, synchronous access to the shared memory from the target application and the video effect processing application.