Theta Digest
Description
Theta Digest is a web application that allows users to upload videos and receive concise text summaries. Utilizing the power of AI and blockchain technology, Theta Digest offers an efficient and cost-effective way to digest video content. Users can pay for the service using TFuel, Theta's cryptocurrency, ensuring secure and decentralized transactions.
Future enhancements will include allowing users to convert videos they like from platforms such as YouTube, Instagram, Farcaster, and more. Additionally, Theta Digest will support a variety of content types including streams, TED Talks, community calls, and developer conferences in Web3. With integration into Theta Edge Cloud for improved scalability and performance, as well as robust security and privacy ensured by Theta's blockchain infrastructure.
Architecture
Frontend
- Technologies: HTML, CSS, JavaScript
- Purpose: User interface for video upload, payment processing, and displaying summaries.
Backend
- Technologies: Node.js, Express.js
- Purpose: Handle video uploads, interact with the summarization model, process payments, and manage API endpoints.
Model
- Model:
sshleifer/distilbart-cnn-12-6 - Type: BART-based encoder and decoder for text summarization.
- Purpose: Convert extracted video text to concise summaries.
Host
- Platform: Theta Edge Network
- Purpose: Decentralized and scalable hosting of the web application.
Payment
- Integration: MetaMask
- Currency: TFuel
- Purpose: Secure and decentralized payment processing for video summarization services.
What It Does
- Users upload a video file through the frontend interface.
- The backend processes the video to extract audio and convert it to text.
- The extracted text is sent to the
sshleifer/distilbart-cnn-12-6model for summarization. - The summarized text is returned to the user and displayed on the frontend.
- Users can make payments using TFuel through MetaMask integration, ensuring a smooth and secure transaction.
Revenue Model
- Pricing: 50 TFuel for 10 video summaries.
- Payment Process:
- Users connect their MetaMask wallet.
- Upon successful payment, users are credited with the ability to process 10 video summaries.
- Payments are securely handled using the Theta blockchain, ensuring transparency and trust.
Theta video api implementation
const axios = require('axios');
const THETA_API_URL = 'https://api.thetatoken.org/v1'; // Replace with the actual Theta API URL
const THETA_API_KEY = 'your_theta_api_key'; // Replace with your actual Theta API key
// Function to upload a video to Theta
async function uploadVideoToTheta(videoFilePath) {
try {
const formData = new FormData();
formData.append('file', fs.createReadStream(videoFilePath));
const response = await axios.post(`${THETA_API_URL}/upload`, formData, {
headers: {
'Content-Type': 'multipart/form-data',
'Authorization': `Bearer ${THETA_API_KEY}`,
},
});
console.log('Video upload result:', response.data);
return response.data;
} catch (error) {
console.error('Error uploading video to Theta:', error);
return 'Error uploading video to Theta';
}
}
// Function to get the status of a video stream on Theta
async function getThetaStreamStatus(videoId) {
try {
const response = await axios.get(`${THETA_API_URL}/streams/${videoId}`, {
headers: {
'Authorization': `Bearer ${THETA_API_KEY}`,
},
});
console.log('Stream status result:', response.data);
return response.data;
} catch (error) {
console.error('Error getting stream status from Theta:', error);
return 'Error getting stream status from Theta';
}
}
// Endpoint to upload a video and get its status
app.post('/theta/upload', async (req, res) => {
const { videoFilePath } = req.body; // Path to the video file
// Upload the video to Theta
const uploadResult = await uploadVideoToTheta(videoFilePath);
if (uploadResult.error) {
return res.status(500).json({ error: uploadResult.error });
}
// Get the status of the uploaded video stream
const streamStatus = await getThetaStreamStatus(uploadResult.videoId);
res.json({ uploadResult, streamStatus });
});
Log in or sign up for Devpost to join the conversation.