SafeUpload is a cutting-edge application that prioritizes user safety and content integrity. With advanced NSFW (Not Safe for Work) checks, it ensures that only safe and appropriate videos are allowed for upload,
This project is a comprehensive content moderation and storage solution designed to ensure the safe and secure upload of videos. The primary goal is to prevent the dissemination of explicit or inappropriate content on platforms that rely on user-generated videos.
The project utilizes a combination of powerful technologies and APIs to achieve its objectives. It incorporates NSFW (Not Safe for Work) checks, leveraging machine learning and computer vision algorithms to analyze video frames and identify potentially objectionable content. By employing the NSFWJS library, it accurately assesses the presence of adult, sexual, or NSFW elements within the videos.
To enable seamless integration with existing video streaming platforms, the project incorporates Livepeer, a robust and scalable video streaming infrastructure. This integration allows for efficient video delivery and ensures a smooth viewing experience for users.
In addition to content moderation, the project prioritizes data security and privacy by integrating with Web3 Storage, a decentralized storage solution powered by Web3 technologies. By leveraging Web3 Storage, user videos are stored in a distributed and encrypted manner, ensuring data integrity and protection from unauthorized access.
The project's workflow begins with a video being uploaded to the system. Upon upload, the server triggers NSFW checks using the NSFWJS library, generating snapshots of the video at a specified frame rate. These snapshots are then analyzed, and if any NSFW content is detected with a high probability, appropriate action is taken, such as flagging the video or notifying the user.
If the video passes the NSFW checks, it is deemed safe for upload. The project then proceeds to upload the video to Livepeer, leveraging its powerful infrastructure for efficient transcoding, adaptive bitrate streaming, and content delivery. This ensures that the uploaded videos are optimized for various devices and network conditions, providing an excellent viewing experience.
Simultaneously, the project initiates the process of uploading the video to Web3 Storage, ensuring the decentralized and encrypted storage of user content. This approach enhances data privacy, as the user's videos are securely stored in a distributed network of nodes, with no single point of failure.
Overall, this project combines advanced content moderation techniques, seamless integration with Livepeer for video streaming, and the use of Web3 Storage for secure and private decentralized storage. By leveraging these technologies, it provides a robust and reliable solution for platforms aiming to ensure safe content uploads while maintaining data security and user privacy.
This project is built using a combination of various technologies and libraries that work together seamlessly to achieve its functionality. Here are the key technologies and their roles in the project:
Node.js and Express: The server-side of the application is built using Node.js and Express framework. Node.js allows for efficient and scalable server-side JavaScript execution, while Express simplifies the creation of RESTful APIs and handles HTTP requests and responses.
FFmpeg: FFmpeg is a powerful multimedia framework used for handling video-related operations. In this project, FFmpeg is utilized to generate snapshots from videos at a specified frame rate.
TensorFlow.js: TensorFlow.js is a JavaScript library that enables machine learning in the browser. It provides access to pre-trained models and allows for efficient inference on images and videos. NSFWJS, a TensorFlow.js library, is used in this project for NSFW content detection in the generated video snapshots.
Cors: The Cors library is used to handle Cross-Origin Resource Sharing (CORS) and allows the server to accept requests from different domains, enabling client-side applications to interact with the server.
Axios: Axios is a popular JavaScript library used for making HTTP requests. It is utilized in this project for sending POST requests from the client-side code to the server.
Livepeer: Livepeer is an open-source video infrastructure platform that simplifies video encoding, transcoding, and streaming. It is integrated into the project to facilitate efficient video delivery and streaming capabilities.
Web3 Storage: Web3 Storage is a decentralized storage solution powered by Web3 technologies. It is used in this project to securely store and distribute user-uploaded videos, ensuring data privacy and integrity.
viem to resolve ens
The project's workflow can be summarized as follows:
The client-side code initiates an HTTP POST request to the server's /nsfwcheck endpoint, providing the video path as the payload.
The server, built with Node.js and Express, receives the request and performs NSFW checks. It uses FFmpeg to generate snapshots from the video and NSFWJS to analyze the snapshots for NSFW content.
If NSFW content is detected with a high probability, appropriate actions can be taken, such as flagging the video or notifying the user.
If the video passes the NSFW checks, it proceeds to the next step. The server uploads the video to Livepeer using the Livepeer API. This leverages Livepeer's infrastructure for efficient video transcoding, adaptive bitrate streaming, and content delivery.
Simultaneously, the server initiates the process of uploading the video to Web3 Storage. It uses the Web3 Storage library to securely store the video in a decentralized and encrypted manner. This ensures data privacy and protection from unauthorized access.
Throughout the process, the server communicates with the client-side code using HTTP responses, providing relevant information such as NSFW content analysis results, Livepeer asset details, and Web3 Storage root CID (Content Identifier)