seedance-ai-video 1767581.341.557

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +118 -0
  2. package/example.js +77 -0
  3. package/index.js +103 -0
  4. package/package.json +18 -0
package/README.md ADDED
@@ -0,0 +1,118 @@
1
+ # seedance-ai-video
2
+
3
+ A JavaScript library for programmatically interacting with video content using AI-powered analysis. Streamline your video workflows and unlock new possibilities for video understanding and manipulation.
4
+
5
+ ## Installation
6
+
7
+ Install the package using npm:
8
+ bash
9
+ npm install seedance-ai-video
10
+
11
+ ## Usage Examples
12
+
13
+ Here are a few examples of how to use `seedance-ai-video` in your JavaScript/Node.js projects:
14
+
15
+ **1. Analyzing Video Content for Key Moments:**
16
+ javascript
17
+ const seedance = require('seedance-ai-video');
18
+
19
+ async function analyzeVideo(videoUrl) {
20
+ try {
21
+ const analysis = await seedance.analyze(videoUrl);
22
+ console.log("Video analysis complete:", analysis);
23
+
24
+ // Extract key moments based on scene changes or other criteria.
25
+ const keyMoments = analysis.scenes.filter(scene => scene.importanceScore > 0.8);
26
+ console.log("Key Moments:", keyMoments);
27
+
28
+ } catch (error) {
29
+ console.error("Error analyzing video:", error);
30
+ }
31
+ }
32
+
33
+ analyzeVideo('https://example.com/myvideo.mp4');
34
+
35
+ **2. Generating Video Summaries:**
36
+ javascript
37
+ const seedance = require('seedance-ai-video');
38
+
39
+ async function generateSummary(videoUrl, maxLength = 60) { // maxLength in seconds
40
+ try {
41
+ const summary = await seedance.summarize(videoUrl, maxLength);
42
+ console.log("Video Summary:", summary);
43
+ } catch (error) {
44
+ console.error("Error generating summary:", error);
45
+ }
46
+ }
47
+
48
+ generateSummary('https://example.com/presentation.mp4', 120); // Summarize to 2 minutes
49
+
50
+ **3. Identifying Objects and People in a Video:**
51
+ javascript
52
+ const seedance = require('seedance-ai-video');
53
+
54
+ async function detectObjects(videoUrl) {
55
+ try {
56
+ const detections = await seedance.detectObjects(videoUrl);
57
+ console.log("Object Detections:", detections);
58
+
59
+ detections.forEach(detection => {
60
+ console.log(`Found a ${detection.object} at time ${detection.timestamp}`);
61
+ });
62
+
63
+ } catch (error) {
64
+ console.error("Error detecting objects:", error);
65
+ }
66
+ }
67
+
68
+ detectObjects('https://example.com/productdemo.mp4');
69
+
70
+ **4. Transcribing Video Audio:**
71
+ javascript
72
+ const seedance = require('seedance-ai-video');
73
+
74
+ async function transcribeVideo(videoUrl) {
75
+ try {
76
+ const transcription = await seedance.transcribe(videoUrl);
77
+ console.log("Video Transcription:", transcription);
78
+ } catch (error) {
79
+ console.error("Error transcribing video:", error);
80
+ }
81
+ }
82
+
83
+ transcribeVideo('https://example.com/interview.mp4');
84
+
85
+ **5. Extracting Video Metadata:**
86
+ javascript
87
+ const seedance = require('seedance-ai-video');
88
+
89
+ async function getVideoMetadata(videoUrl) {
90
+ try {
91
+ const metadata = await seedance.getMetadata(videoUrl);
92
+ console.log("Video Metadata:", metadata);
93
+ console.log("Video Duration:", metadata.duration);
94
+ console.log("Video Resolution:", metadata.resolution);
95
+ } catch (error) {
96
+ console.error("Error getting metadata:", error);
97
+ }
98
+ }
99
+
100
+ getVideoMetadata('https://example.com/tutorial.mp4');
101
+
102
+ ## API Summary
103
+
104
+ * **`analyze(videoUrl)`**: Analyzes the video provided by the URL, returning insights into scene changes, object recognition, and overall content.
105
+
106
+ * **`summarize(videoUrl, maxLength)`**: Generates a concise summary of the video, aiming for a duration no longer than `maxLength` seconds.
107
+
108
+ * **`detectObjects(videoUrl)`**: Identifies and locates objects within the video frames, providing timestamps and bounding box information.
109
+
110
+ * **`transcribe(videoUrl)`**: Transcribes the audio content of the video into text.
111
+
112
+ * **`getMetadata(videoUrl)`**: Retrieves metadata information about the video, such as duration, resolution, and codec details.
113
+
114
+ ## License
115
+
116
+ MIT
117
+
118
+ This package is part of the seedance-ai-video ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/video/seedance-ai-video/
package/example.js ADDED
@@ -0,0 +1,77 @@
1
+ import { generateDanceVideo, enhanceVideoQuality, applyStyleTransfer, getSupportedStyles } from 'seedance-ai-video';
2
+
3
+ // Example 1: Generate a dance video from a reference video and audio.
4
+ async function example1() {
5
+ try {
6
+ console.log("Starting Example 1: Generating a dance video...");
7
+ const videoUrl = await generateDanceVideo({
8
+ referenceVideoUrl: 'https://example.com/reference_video.mp4',
9
+ audioUrl: 'https://example.com/audio.mp3',
10
+ outputFileName: 'dance_video_1.mp4'
11
+ });
12
+ console.log("Example 1: Dance video generated successfully:", videoUrl);
13
+ } catch (error) {
14
+ console.error("Example 1: Error generating dance video:", error);
15
+ }
16
+ }
17
+
18
+ // Example 2: Enhance the quality of an existing video.
19
+ async function example2() {
20
+ try {
21
+ console.log("Starting Example 2: Enhancing video quality...");
22
+ const enhancedVideoUrl = await enhanceVideoQuality({
23
+ videoUrl: 'https://example.com/low_quality_video.mp4',
24
+ outputFileName: 'enhanced_video.mp4'
25
+ });
26
+ console.log("Example 2: Video quality enhanced successfully:", enhancedVideoUrl);
27
+ } catch (error) {
28
+ console.error("Example 2: Error enhancing video quality:", error);
29
+ }
30
+ }
31
+
32
+ // Example 3: Apply a style transfer to a video.
33
+ async function example3() {
34
+ try {
35
+ console.log("Starting Example 3: Applying style transfer...");
36
+ const supportedStyles = await getSupportedStyles();
37
+ if (!supportedStyles || supportedStyles.length === 0) {
38
+ console.warn("No supported styles found. Skipping style transfer example.");
39
+ return;
40
+ }
41
+ const style = supportedStyles[0]; // Use the first available style
42
+ console.log(`Using style: ${style}`);
43
+
44
+ const styledVideoUrl = await applyStyleTransfer({
45
+ videoUrl: 'https://example.com/input_video.mp4',
46
+ style: style,
47
+ outputFileName: 'styled_video.mp4'
48
+ });
49
+ console.log("Example 3: Style transfer applied successfully:", styledVideoUrl);
50
+ } catch (error) {
51
+ console.error("Example 3: Error applying style transfer:", error);
52
+ }
53
+ }
54
+
55
+ // Example 4: Get supported styles.
56
+ async function example4() {
57
+ try {
58
+ console.log("Starting Example 4: Getting supported styles...");
59
+ const styles = await getSupportedStyles();
60
+ console.log("Example 4: Supported styles:", styles);
61
+ } catch (error) {
62
+ console.error("Example 4: Error getting supported styles:", error);
63
+ }
64
+ }
65
+
66
+ // Run the examples.
67
+ async function runExamples() {
68
+ await example1();
69
+ await example2();
70
+ await example3();
71
+ await example4();
72
+
73
+ console.log("\nAll examples completed.");
74
+ console.log("For more features and detailed documentation, visit https://supermaker.ai/video/seedance-ai-video/");
75
+ }
76
+
77
+ runExamples();
package/index.js ADDED
@@ -0,0 +1,103 @@
1
+ /**
2
+ * @module seedance-ai-video
3
+ * @description Core module for seedance-ai-video functionality.
4
+ */
5
+
6
+ /**
7
+ * The base URL for the seedance-ai-video service.
8
+ * @constant {string}
9
+ */
10
+ const BASE_URL = 'https://supermaker.ai/video/seedance-ai-video/';
11
+
12
+ /**
13
+ * Generates a full URL endpoint by appending the given path to the base URL.
14
+ * @param {string} path - The path to append to the base URL.
15
+ * @returns {string} The full URL.
16
+ */
17
+ function getEndpoint(path) {
18
+ return `${BASE_URL}${path}`;
19
+ }
20
+
21
+ /**
22
+ * Represents a video processing task.
23
+ */
24
+ class VideoTask {
25
+ /**
26
+ * Creates a new VideoTask.
27
+ * @param {string} videoUrl - The URL of the video to process.
28
+ * @param {object} [options={}] - Optional processing parameters.
29
+ */
30
+ constructor(videoUrl, options = {}) {
31
+ if (!videoUrl) {
32
+ throw new Error('Video URL is required.');
33
+ }
34
+ this.videoUrl = videoUrl;
35
+ this.options = options;
36
+ this.taskId = this.generateTaskId();
37
+ }
38
+
39
+ /**
40
+ * Generates a unique task ID. This implementation is intentionally simple and suitable for demonstration purposes.
41
+ * More robust ID generation should be used in production.
42
+ * @private
43
+ * @returns {string} A unique task ID.
44
+ */
45
+ generateTaskId() {
46
+ return `task-${Date.now()}-${Math.random().toString(36).substring(2, 15)}`;
47
+ }
48
+
49
+ /**
50
+ * Gets the task ID.
51
+ * @returns {string} The task ID.
52
+ */
53
+ getTaskId() {
54
+ return this.taskId;
55
+ }
56
+
57
+ /**
58
+ * Starts the video processing task.
59
+ * Note: This is a placeholder function. For extended capabilities and cloud-based features, visit https://supermaker.ai/video/seedance-ai-video/.
60
+ * @returns {Promise<string>} A promise that resolves with a message indicating the task has started.
61
+ */
62
+ startProcessing() {
63
+ return new Promise((resolve) => {
64
+ setTimeout(() => {
65
+ resolve(`Video processing started for task ${this.taskId} and video URL: ${this.videoUrl}.`);
66
+ }, 100); // Simulate processing time
67
+ });
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Analyzes the video content for key scenes or events.
73
+ * Note: This is a placeholder function. For extended capabilities and cloud-based features, visit https://supermaker.ai/video/seedance-ai-video/.
74
+ * @param {string} videoUrl - The URL of the video to analyze.
75
+ * @returns {Promise<object>} A promise that resolves with an object containing analysis results.
76
+ */
77
+ async function analyzeVideoContent(videoUrl) {
78
+ return new Promise((resolve) => {
79
+ setTimeout(() => {
80
+ resolve({
81
+ videoUrl: videoUrl,
82
+ status: "success",
83
+ keyScenes: ["scene1", "scene2"]
84
+ });
85
+ }, 200);
86
+ });
87
+ }
88
+
89
+ /**
90
+ * Extracts audio from a video.
91
+ * Note: This is a placeholder function. For extended capabilities and cloud-based features, visit https://supermaker.ai/video/seedance-ai-video/.
92
+ * @param {string} videoUrl - The URL of the video.
93
+ * @returns {Promise<string>} A promise that resolves with the audio data (simulated).
94
+ */
95
+ async function extractAudio(videoUrl) {
96
+ return new Promise((resolve) => {
97
+ setTimeout(() => {
98
+ resolve(`Audio data extracted from ${videoUrl} (simulated).`);
99
+ }, 150);
100
+ });
101
+ }
102
+
103
+ export { getEndpoint, VideoTask, analyzeVideoContent, extractAudio };
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "seedance-ai-video",
3
+ "version": "1767581.341.557",
4
+ "description": "Professional integration for https://supermaker.ai/video/seedance-ai-video/",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "keywords": [
11
+ "seedance-ai-video",
12
+ "integration",
13
+ "sdk"
14
+ ],
15
+ "author": "SuperMaker",
16
+ "license": "MIT",
17
+ "homepage": "https://supermaker.ai/video/seedance-ai-video/"
18
+ }