@umituz/react-native-ai-generation-content 1.17.232 → 1.17.233
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.
- package/README.md +236 -261
- package/package.json +1 -1
- package/src/domains/content-moderation/README.md +239 -296
- package/src/domains/creations/README.md +242 -325
- package/src/domains/face-detection/README.md +228 -307
- package/src/domains/prompts/README.md +242 -312
- package/src/features/ai-hug/README.md +381 -219
- package/src/features/ai-kiss/README.md +388 -219
- package/src/features/anime-selfie/README.md +327 -256
- package/src/features/audio-generation/README.md +352 -309
- package/src/features/colorization/README.md +332 -228
- package/src/features/couple-future/README.md +387 -212
- package/src/features/future-prediction/README.md +391 -221
- package/src/features/hd-touch-up/README.md +339 -252
- package/src/features/image-captioning/README.md +359 -299
- package/src/features/image-to-image/README.md +398 -357
- package/src/features/image-to-video/README.md +337 -292
- package/src/features/inpainting/README.md +348 -244
- package/src/features/meme-generator/README.md +350 -269
- package/src/features/remove-background/README.md +335 -234
- package/src/features/remove-object/README.md +341 -288
- package/src/features/replace-background/README.md +353 -236
- package/src/features/script-generator/README.md +358 -287
- package/src/features/shared/README.md +254 -223
- package/src/features/sketch-to-image/README.md +331 -234
- package/src/features/style-transfer/README.md +336 -237
- package/src/features/text-to-video/README.md +360 -193
- package/src/features/text-to-voice/README.md +382 -272
|
@@ -1,369 +1,414 @@
|
|
|
1
|
-
# Image to Video
|
|
1
|
+
# Image to Video Feature
|
|
2
2
|
|
|
3
3
|
Convert static images into animated videos using AI.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 📍 Import Path
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- Natural movement patterns
|
|
11
|
-
- High-quality output
|
|
7
|
+
```typescript
|
|
8
|
+
import { useImageToVideoFeature } from '@umituz/react-native-ai-generation-content';
|
|
9
|
+
```
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
**Location**: `src/features/image-to-video/`
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
## 🎯 Feature Purpose
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
npm install @umituz/react-native-ai-generation-content
|
|
19
|
-
```
|
|
15
|
+
Transform static photos into dynamic animated videos using AI. Supports multiple motion types including zoom in/out, pan, and 3D parallax effects for creating engaging video content from still images.
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
---
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
## 📋 Usage Strategy
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
import { useImageToVideoFeature } from '@umituz/react-native-ai-generation-content';
|
|
27
|
-
import * as ImagePicker from 'react-native-image-picker';
|
|
28
|
-
|
|
29
|
-
function ImageToVideoScreen() {
|
|
30
|
-
const [image, setImage] = useState<string | null>(null);
|
|
31
|
-
|
|
32
|
-
const feature = useImageToVideoFeature({
|
|
33
|
-
config: {
|
|
34
|
-
motionType: 'zoom-in',
|
|
35
|
-
duration: 4,
|
|
36
|
-
onProcessingStart: () => console.log('Creating video...'),
|
|
37
|
-
onProcessingComplete: (result) => console.log('Complete:', result),
|
|
38
|
-
onError: (error) => console.error('Error:', error),
|
|
39
|
-
},
|
|
40
|
-
onSelectImage: async () => {
|
|
41
|
-
const result = await ImagePicker.launchImageLibrary({ mediaType: 'photo' });
|
|
42
|
-
if (result.assets && result.assets[0].uri) {
|
|
43
|
-
const base64 = await convertToBase64(result.assets[0].uri);
|
|
44
|
-
setImage(base64);
|
|
45
|
-
return base64;
|
|
46
|
-
}
|
|
47
|
-
return null;
|
|
48
|
-
},
|
|
49
|
-
onSaveVideo: async (videoUrl) => {
|
|
50
|
-
await saveToGallery(videoUrl);
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<View>
|
|
56
|
-
<PhotoUploadCard
|
|
57
|
-
image={image}
|
|
58
|
-
onSelectImage={feature.selectImage}
|
|
59
|
-
title="Select Image to Animate"
|
|
60
|
-
/>
|
|
61
|
-
|
|
62
|
-
<MotionTypeSelector
|
|
63
|
-
selectedType={feature.state.motionType}
|
|
64
|
-
onSelectType={feature.setMotionType}
|
|
65
|
-
/>
|
|
66
|
-
|
|
67
|
-
<DurationSelector
|
|
68
|
-
selectedDuration={feature.state.duration}
|
|
69
|
-
onSelectDuration={feature.setDuration}
|
|
70
|
-
/>
|
|
71
|
-
|
|
72
|
-
<Button
|
|
73
|
-
title="Create Video"
|
|
74
|
-
onPress={feature.process}
|
|
75
|
-
disabled={!feature.isReady || feature.state.isProcessing}
|
|
76
|
-
/>
|
|
77
|
-
|
|
78
|
-
{feature.state.isProcessing && (
|
|
79
|
-
<View>
|
|
80
|
-
<Text>Progress: {feature.state.progress}%</Text>
|
|
81
|
-
<ProgressBar progress={feature.state.progress} />
|
|
82
|
-
</View>
|
|
83
|
-
)}
|
|
84
|
-
|
|
85
|
-
{feature.state.result && (
|
|
86
|
-
<Video source={{ uri: feature.state.result.videoUrl }} />
|
|
87
|
-
)}
|
|
88
|
-
</View>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
```
|
|
21
|
+
### When to Use This Feature
|
|
92
22
|
|
|
93
|
-
|
|
23
|
+
✅ **Use Cases:**
|
|
24
|
+
- Creating social media content from photos
|
|
25
|
+
- Adding motion to product images
|
|
26
|
+
- Creating photo slideshows
|
|
27
|
+
- Enhancing storytelling with movement
|
|
28
|
+
- Dynamic video presentations
|
|
94
29
|
|
|
95
|
-
|
|
96
|
-
|
|
30
|
+
❌ **When NOT to Use:**
|
|
31
|
+
- Video from text descriptions (use Text to Video)
|
|
32
|
+
- Video editing of existing footage (use video editing software)
|
|
33
|
+
- Complex video effects (use professional video tools)
|
|
34
|
+
- Adding overlays/text to video (use video editing tools)
|
|
97
35
|
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<AIFeatureScreen
|
|
101
|
-
featureId="image-to-video"
|
|
102
|
-
userId="user-123"
|
|
103
|
-
/>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
```
|
|
36
|
+
### Implementation Strategy
|
|
107
37
|
|
|
108
|
-
|
|
38
|
+
1. **Select static image** to animate
|
|
39
|
+
2. **Choose motion type** (zoom-in, zoom-out, pan-left, pan-right, 3D)
|
|
40
|
+
3. **Set duration** and intensity level
|
|
41
|
+
4. **Generate animated video** with progress tracking
|
|
42
|
+
5. **Preview result** and offer regeneration
|
|
43
|
+
6. **Save or share** final video
|
|
109
44
|
|
|
110
|
-
|
|
45
|
+
---
|
|
111
46
|
|
|
112
|
-
|
|
113
|
-
interface ImageToVideoFeatureConfig {
|
|
114
|
-
motionType?: 'zoom-in' | 'zoom-out' | 'pan-left' | 'pan-right' | '3d';
|
|
115
|
-
duration?: number; // Video duration in seconds (2-8)
|
|
116
|
-
onProcessingStart?: () => void;
|
|
117
|
-
onProcessingComplete?: (result: ImageToVideoResult) => void;
|
|
118
|
-
onError?: (error: string) => void;
|
|
119
|
-
}
|
|
120
|
-
```
|
|
47
|
+
## ⚠️ Critical Rules (MUST FOLLOW)
|
|
121
48
|
|
|
122
|
-
###
|
|
49
|
+
### 1. Image Requirements
|
|
50
|
+
- **MUST** provide ONE image to animate
|
|
51
|
+
- **MUST** use high-quality images (min 512x512 recommended)
|
|
52
|
+
- **MUST** have clear focal point for best motion results
|
|
53
|
+
- **MUST NOT** exceed file size limits (10MB max)
|
|
54
|
+
- **MUST NOT** use extremely blurry or low-resolution images
|
|
123
55
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
```
|
|
56
|
+
### 2. Configuration
|
|
57
|
+
- **MUST** provide valid `userId` for tracking
|
|
58
|
+
- **MUST** specify `motionType` (zoom-in, zoom-out, pan-left, pan-right, 3D)
|
|
59
|
+
- **MUST** set `duration` in seconds (2-8 range)
|
|
60
|
+
- **MUST** implement `onError` callback
|
|
61
|
+
- **MUST** implement `onSelectImage` callback
|
|
132
62
|
|
|
133
|
-
|
|
63
|
+
### 3. State Management
|
|
64
|
+
- **MUST** check `isReady` before enabling generate button
|
|
65
|
+
- **MUST** display progress during video generation
|
|
66
|
+
- **MUST** handle long processing times
|
|
67
|
+
- **MUST** display `error` state with clear messages
|
|
68
|
+
- **MUST** implement proper cleanup on unmount
|
|
134
69
|
|
|
135
|
-
###
|
|
70
|
+
### 4. Performance
|
|
71
|
+
- **MUST** implement image compression before upload
|
|
72
|
+
- **MUST** show progress indicator for processing
|
|
73
|
+
- **MUST** cache generated videos locally
|
|
74
|
+
- **MUST** allow users to cancel processing
|
|
75
|
+
- **MUST NOT** generate multiple videos simultaneously
|
|
136
76
|
|
|
137
|
-
|
|
77
|
+
### 5. Content Quality
|
|
78
|
+
- **MUST** provide video preview before save
|
|
79
|
+
- **MUST** allow duration adjustment
|
|
80
|
+
- **MUST** support various motion types
|
|
81
|
+
- **MUST** handle intensity adjustment
|
|
82
|
+
- **MUST** offer motion regeneration
|
|
138
83
|
|
|
139
|
-
|
|
140
|
-
const result = await feature.process({
|
|
141
|
-
motionType: 'zoom-in',
|
|
142
|
-
duration: 4,
|
|
143
|
-
intensity: 0.7,
|
|
144
|
-
});
|
|
145
|
-
```
|
|
84
|
+
---
|
|
146
85
|
|
|
147
|
-
|
|
86
|
+
## 🚫 Prohibitions (MUST AVOID)
|
|
148
87
|
|
|
149
|
-
|
|
88
|
+
### Strictly Forbidden
|
|
150
89
|
|
|
151
|
-
|
|
152
|
-
const result = await feature.process({
|
|
153
|
-
motionType: 'zoom-out',
|
|
154
|
-
duration: 5,
|
|
155
|
-
intensity: 0.6,
|
|
156
|
-
});
|
|
157
|
-
```
|
|
90
|
+
❌ **NEVER** do the following:
|
|
158
91
|
|
|
159
|
-
|
|
92
|
+
1. **No Missing Images**
|
|
93
|
+
- Always validate image is selected
|
|
94
|
+
- Never call process() without image
|
|
160
95
|
|
|
161
|
-
|
|
96
|
+
2. **No Auto-Processing**
|
|
97
|
+
- Never start animation without user action
|
|
98
|
+
- Always require explicit "Create Video" button press
|
|
99
|
+
- Show preview before processing
|
|
162
100
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
duration: 4,
|
|
167
|
-
intensity: 0.7,
|
|
168
|
-
});
|
|
169
|
-
```
|
|
101
|
+
3. **No Hardcoded Credentials**
|
|
102
|
+
- Never store API keys in component files
|
|
103
|
+
- Use environment variables or secure storage
|
|
170
104
|
|
|
171
|
-
|
|
105
|
+
4. **No Unhandled Errors**
|
|
106
|
+
- Never ignore generation failures
|
|
107
|
+
- Always explain what went wrong
|
|
108
|
+
- Provide retry or alternative options
|
|
172
109
|
|
|
173
|
-
|
|
110
|
+
5. **No Memory Leaks**
|
|
111
|
+
- Never store both original and video simultaneously
|
|
112
|
+
- Clean up temporary video files
|
|
113
|
+
- Implement proper video disposal
|
|
174
114
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
intensity: 0.7,
|
|
180
|
-
});
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
### 3D Motion
|
|
115
|
+
6. **No Blocked UI**
|
|
116
|
+
- Never block main thread with video processing
|
|
117
|
+
- Always show progress indicator
|
|
118
|
+
- Allow cancellation
|
|
184
119
|
|
|
185
|
-
|
|
120
|
+
7. **No Copyright Issues**
|
|
121
|
+
- Never claim copyrighted content as original
|
|
122
|
+
- Allow only user-provided images
|
|
123
|
+
- Implement proper attribution
|
|
186
124
|
|
|
187
|
-
|
|
188
|
-
const result = await feature.process({
|
|
189
|
-
motionType: '3d',
|
|
190
|
-
duration: 5,
|
|
191
|
-
intensity: 0.8,
|
|
192
|
-
});
|
|
193
|
-
```
|
|
125
|
+
---
|
|
194
126
|
|
|
195
|
-
##
|
|
127
|
+
## 🤖 AI Agent Directions
|
|
196
128
|
|
|
197
|
-
|
|
198
|
-
2. Choose **Motion Type** - Select the animation style
|
|
199
|
-
3. Set **Duration** - Choose video length
|
|
200
|
-
4. Tap **Create Video** - Start the animation
|
|
201
|
-
5. View Result - Watch the generated video
|
|
202
|
-
6. Save or Share - Save to gallery or share
|
|
129
|
+
### For AI Code Generation Tools
|
|
203
130
|
|
|
204
|
-
|
|
131
|
+
When using this feature with AI code generation tools, follow these guidelines:
|
|
205
132
|
|
|
206
|
-
|
|
133
|
+
#### Prompt Template for AI Agents
|
|
207
134
|
|
|
208
|
-
```
|
|
209
|
-
|
|
135
|
+
```
|
|
136
|
+
You are implementing an image to video feature using @umituz/react-native-ai-generation-content.
|
|
137
|
+
|
|
138
|
+
REQUIREMENTS:
|
|
139
|
+
1. Import from: @umituz/react-native-ai-generation-content
|
|
140
|
+
2. Use the useImageToVideoFeature hook
|
|
141
|
+
3. Select motion type (zoom-in, zoom-out, pan-left, pan-right, 3D)
|
|
142
|
+
4. Implement image selection UI
|
|
143
|
+
5. Set duration (2-8 seconds)
|
|
144
|
+
6. Adjust intensity level (0.0 to 1.0)
|
|
145
|
+
7. Validate image before generation
|
|
146
|
+
8. Show video preview with playback controls
|
|
147
|
+
9. Handle long processing times with progress
|
|
148
|
+
10. Implement proper error handling
|
|
149
|
+
11. Implement cleanup on unmount
|
|
150
|
+
|
|
151
|
+
CRITICAL RULES:
|
|
152
|
+
- MUST validate image before calling generate()
|
|
153
|
+
- MUST show video preview with playback controls
|
|
154
|
+
- MUST handle motion type selection
|
|
155
|
+
- MUST adjust duration appropriately
|
|
156
|
+
- MUST implement debouncing (300ms)
|
|
157
|
+
- MUST allow motion regeneration
|
|
158
|
+
|
|
159
|
+
CONFIGURATION:
|
|
160
|
+
- Provide valid userId (string)
|
|
161
|
+
- Set motionType: 'zoom-in' | 'zoom-out' | 'pan-left' | 'pan-right' | '3d'
|
|
162
|
+
- Set duration: 2-8 (seconds)
|
|
163
|
+
- Set intensity: 0.0 to 1.0 (default: 0.7)
|
|
164
|
+
- Set fps: 30 (frames per second)
|
|
165
|
+
- Implement onSelectImage callback
|
|
166
|
+
- Implement onSaveVideo callback
|
|
167
|
+
- Configure callbacks: onProcessingStart, onProcessingComplete, onError
|
|
168
|
+
|
|
169
|
+
OPTIONS:
|
|
170
|
+
- motionType: Select animation style
|
|
171
|
+
- duration: 2-8 seconds
|
|
172
|
+
- intensity: 0.0 (subtle) to 1.0 (strong motion)
|
|
173
|
+
- fps: Frames per second (default: 30)
|
|
174
|
+
|
|
175
|
+
STRICTLY FORBIDDEN:
|
|
176
|
+
- No missing image validation
|
|
177
|
+
- No auto-processing without user action
|
|
178
|
+
- No hardcoded API keys
|
|
179
|
+
- No unhandled errors
|
|
180
|
+
- No memory leaks
|
|
181
|
+
- No blocking UI
|
|
182
|
+
- No copyright violations
|
|
183
|
+
|
|
184
|
+
QUALITY CHECKLIST:
|
|
185
|
+
- [ ] Image selection implemented
|
|
186
|
+
- [ ] Motion type selector added
|
|
187
|
+
- [ ] Duration control included
|
|
188
|
+
- [ ] Intensity slider added
|
|
189
|
+
- [ ] Video preview with playback
|
|
190
|
+
- [ ] Progress indicator during processing
|
|
191
|
+
- [ ] Error display with retry option
|
|
192
|
+
- [ ] Download/share functionality
|
|
193
|
+
- [ ] Motion regeneration option
|
|
194
|
+
```
|
|
210
195
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
]
|
|
196
|
+
#### AI Implementation Checklist
|
|
197
|
+
|
|
198
|
+
Use this checklist when generating code:
|
|
199
|
+
|
|
200
|
+
- [ ] Feature imported from correct path
|
|
201
|
+
- [ ] Image selection implemented
|
|
202
|
+
- [ ] Motion type selector added
|
|
203
|
+
- [ ] Duration control implemented
|
|
204
|
+
- [ ] Intensity slider included
|
|
205
|
+
- [ ] Validation before generate()
|
|
206
|
+
- [ ] Video preview with playback
|
|
207
|
+
- [ ] Progress indicator during processing
|
|
208
|
+
- [ ] Error display with user-friendly message
|
|
209
|
+
- [ ] Download/share buttons
|
|
210
|
+
- [ ] Motion regeneration option
|
|
211
|
+
- [ ] Cleanup on unmount
|
|
212
|
+
- [ ] Original image preserved
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 🛠️ Configuration Strategy
|
|
217
|
+
|
|
218
|
+
### Essential Configuration
|
|
219
|
+
|
|
220
|
+
```typescript
|
|
221
|
+
// Required fields
|
|
222
|
+
{
|
|
223
|
+
userId: string
|
|
224
|
+
motionType: 'zoom-in' | 'zoom-out' | 'pan-left' | 'pan-right' | '3d'
|
|
225
|
+
duration: number // 2-8 seconds
|
|
226
|
+
onSelectImage: () => Promise<string | null>
|
|
227
|
+
}
|
|
218
228
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
229
|
+
// Optional callbacks
|
|
230
|
+
{
|
|
231
|
+
onProcessingStart?: () => void
|
|
232
|
+
onProcessingComplete?: (result) => void
|
|
233
|
+
onError?: (error: string) => void
|
|
234
|
+
}
|
|
224
235
|
```
|
|
225
236
|
|
|
226
|
-
###
|
|
237
|
+
### Recommended Settings
|
|
238
|
+
|
|
239
|
+
1. **Motion Types**
|
|
240
|
+
- Zoom In: Gradually zoom into focal point
|
|
241
|
+
- Zoom Out: Gradually zoom out from image
|
|
242
|
+
- Pan Left: Slowly pan image to the left
|
|
243
|
+
- Pan Right: Slowly pan image to the right
|
|
244
|
+
- 3D: Add depth with parallax effect
|
|
245
|
+
|
|
246
|
+
2. **Duration Settings**
|
|
247
|
+
- Short: 2-3s (social media, quick views)
|
|
248
|
+
- Medium: 4-5s (standard content)
|
|
249
|
+
- Long: 6-8s (presentations, detailed views)
|
|
250
|
+
|
|
251
|
+
3. **Intensity Levels**
|
|
252
|
+
- 0.3-0.5: Subtle motion
|
|
253
|
+
- 0.6-0.8: Balanced animation (recommended)
|
|
254
|
+
- 0.9-1.0: Strong motion effects
|
|
255
|
+
|
|
256
|
+
4. **Image Quality**
|
|
257
|
+
- Minimum: 512x512 resolution
|
|
258
|
+
- Recommended: 1024x1024 or higher
|
|
259
|
+
- Format: JPEG or PNG
|
|
260
|
+
- Max size: 10MB
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## 📊 State Management
|
|
265
|
+
|
|
266
|
+
### Feature States
|
|
267
|
+
|
|
268
|
+
**isReady**: boolean
|
|
269
|
+
- Image selected and validated
|
|
270
|
+
- Check before enabling generate button
|
|
271
|
+
|
|
272
|
+
**isProcessing**: boolean
|
|
273
|
+
- Video generation in progress
|
|
274
|
+
- Show loading/progress indicator
|
|
275
|
+
- Disable generate button
|
|
276
|
+
|
|
277
|
+
**progress**: number (0-100)
|
|
278
|
+
- Generation progress percentage
|
|
279
|
+
- Update progress bar
|
|
280
|
+
|
|
281
|
+
**error**: string | null
|
|
282
|
+
- Error message if generation failed
|
|
283
|
+
- Display to user with clear message
|
|
284
|
+
|
|
285
|
+
**result**: {
|
|
286
|
+
videoUrl: string
|
|
287
|
+
thumbnailUrl?: string
|
|
288
|
+
duration?: number
|
|
289
|
+
motionType?: string
|
|
290
|
+
intensity?: number
|
|
291
|
+
metadata?: any
|
|
292
|
+
}
|
|
227
293
|
|
|
228
|
-
|
|
229
|
-
import { DurationSelector, createDurationOptions } from '@umituz/react-native-ai-generation-content';
|
|
294
|
+
---
|
|
230
295
|
|
|
231
|
-
|
|
296
|
+
## 🎨 Best Practices
|
|
232
297
|
|
|
233
|
-
|
|
234
|
-
selectedDuration={duration}
|
|
235
|
-
onSelectDuration={setDuration}
|
|
236
|
-
durations={durations}
|
|
237
|
-
/>
|
|
238
|
-
```
|
|
298
|
+
### Image Selection
|
|
239
299
|
|
|
240
|
-
|
|
300
|
+
1. **Image Quality**
|
|
301
|
+
- Good: High-resolution, clear focal point
|
|
302
|
+
- Bad: Blurry, cluttered images
|
|
241
303
|
|
|
242
|
-
|
|
243
|
-
|
|
304
|
+
2. **Motion Matching**
|
|
305
|
+
- Match motion to image content
|
|
306
|
+
- Consider subject for motion direction
|
|
307
|
+
- Landscape vs portrait considerations
|
|
244
308
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
onValueChange={setIntensity}
|
|
251
|
-
/>
|
|
309
|
+
3. **Duration**
|
|
310
|
+
- Start with medium duration (4-5s)
|
|
311
|
+
- Adjust based on content complexity
|
|
312
|
+
- Shorter for social media
|
|
313
|
+
- Longer for presentations
|
|
252
314
|
|
|
253
|
-
|
|
254
|
-
|
|
315
|
+
4. **Intensity**
|
|
316
|
+
- Use moderate intensity (0.6-0.8) for natural motion
|
|
317
|
+
- Lower intensity for subtle effects
|
|
318
|
+
- Higher intensity for dramatic motion
|
|
255
319
|
|
|
256
|
-
|
|
320
|
+
### User Experience
|
|
257
321
|
|
|
258
|
-
|
|
322
|
+
1. **Motion Preview**
|
|
323
|
+
- Show examples of each motion type
|
|
324
|
+
- Preview motion before applying
|
|
325
|
+
- Explain motion characteristics
|
|
259
326
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
intensity: 0.8,
|
|
265
|
-
fps: 30,
|
|
266
|
-
});
|
|
267
|
-
```
|
|
327
|
+
2. **Progress Feedback**
|
|
328
|
+
- Show estimated time remaining
|
|
329
|
+
- Update progress regularly
|
|
330
|
+
- Allow cancellation
|
|
268
331
|
|
|
269
|
-
|
|
332
|
+
3. **Video Playback**
|
|
333
|
+
- Support standard video controls
|
|
334
|
+
- Loop preview for continuous viewing
|
|
335
|
+
- Show video metadata
|
|
270
336
|
|
|
271
|
-
|
|
272
|
-
const { state } = useImageToVideoFeature({ ...config });
|
|
337
|
+
---
|
|
273
338
|
|
|
274
|
-
|
|
275
|
-
// - Analyzing image (0-20%)
|
|
276
|
-
// - Generating motion (20-60%)
|
|
277
|
-
// - Rendering frames (60-90%)
|
|
278
|
-
// - Finalizing video (90-100%)
|
|
279
|
-
```
|
|
339
|
+
## 🐛 Common Pitfalls
|
|
280
340
|
|
|
281
|
-
###
|
|
341
|
+
### Quality Issues
|
|
282
342
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
import { useRef } from 'react';
|
|
343
|
+
❌ **Problem**: Poor animation quality
|
|
344
|
+
✅ **Solution**: Use higher quality images, try different motion type or intensity
|
|
286
345
|
|
|
287
|
-
|
|
346
|
+
### Motion Issues
|
|
288
347
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
source={{ uri: feature.state.result.videoUrl }}
|
|
292
|
-
useNativeControls
|
|
293
|
-
resizeMode="contain"
|
|
294
|
-
style={{ width: '100%', height: 300 }}
|
|
295
|
-
/>
|
|
296
|
-
```
|
|
348
|
+
❌ **Problem**: Motion doesn't match image content
|
|
349
|
+
✅ **Solution**: Try different motion type, adjust intensity, consider focal point
|
|
297
350
|
|
|
298
|
-
|
|
351
|
+
### Performance Issues
|
|
299
352
|
|
|
300
|
-
|
|
353
|
+
❌ **Problem**: Slow generation
|
|
354
|
+
✅ **Solution**: Compress images, show progress, allow cancellation
|
|
301
355
|
|
|
302
|
-
|
|
303
|
-
// Create animated posts
|
|
304
|
-
const result = await feature.process({
|
|
305
|
-
motionType: 'zoom-in',
|
|
306
|
-
duration: 4,
|
|
307
|
-
});
|
|
308
|
-
```
|
|
356
|
+
### Memory Issues
|
|
309
357
|
|
|
310
|
-
|
|
358
|
+
❌ **Problem**: App crashes with large images
|
|
359
|
+
✅ **Solution**: Compress images, clean up properly, optimize memory
|
|
311
360
|
|
|
312
|
-
|
|
313
|
-
// Animate photos for slideshows
|
|
314
|
-
const result = await feature.process({
|
|
315
|
-
motionType: 'pan-right',
|
|
316
|
-
duration: 5,
|
|
317
|
-
});
|
|
318
|
-
```
|
|
361
|
+
---
|
|
319
362
|
|
|
320
|
-
|
|
363
|
+
## 📦 Related Components
|
|
321
364
|
|
|
322
|
-
|
|
323
|
-
// Create dynamic product videos
|
|
324
|
-
const result = await feature.process({
|
|
325
|
-
motionType: '3d',
|
|
326
|
-
duration: 6,
|
|
327
|
-
intensity: 0.8,
|
|
328
|
-
});
|
|
329
|
-
```
|
|
365
|
+
Use these components from the library:
|
|
330
366
|
|
|
331
|
-
|
|
367
|
+
- **PhotoUploadCard**: Upload image interface
|
|
368
|
+
- **MotionTypeSelector**: Choose animation style
|
|
369
|
+
- **DurationSelector**: Set video length
|
|
370
|
+
- **IntensitySlider**: Adjust motion intensity
|
|
371
|
+
- **ProgressBar**: Progress display
|
|
372
|
+
- **VideoPlayer**: Video playback component
|
|
332
373
|
|
|
333
|
-
|
|
334
|
-
// Add motion to story images
|
|
335
|
-
const result = await feature.process({
|
|
336
|
-
motionType: 'zoom-out',
|
|
337
|
-
duration: 5,
|
|
338
|
-
});
|
|
339
|
-
```
|
|
374
|
+
Located at: `src/presentation/components/`
|
|
340
375
|
|
|
341
|
-
|
|
376
|
+
---
|
|
342
377
|
|
|
343
|
-
|
|
344
|
-
2. **Subject Focus**: Choose motion that highlights the main subject
|
|
345
|
-
3. **Duration**: Shorter durations (3-5s) work well for social media
|
|
346
|
-
4. **Intensity**: Moderate intensity (0.6-0.8) produces natural motion
|
|
347
|
-
5. **Testing**: Try different motion types to find the best fit
|
|
378
|
+
## 🔄 Migration Strategy
|
|
348
379
|
|
|
349
|
-
|
|
380
|
+
If migrating from previous implementation:
|
|
350
381
|
|
|
351
|
-
|
|
352
|
-
|
|
382
|
+
1. **Update imports** to new path
|
|
383
|
+
2. **Add motion type selector**
|
|
384
|
+
3. **Implement duration control**
|
|
385
|
+
4. **Update state handling** for new structure
|
|
386
|
+
5. **Add video preview component**
|
|
387
|
+
6. **Test all motion types**
|
|
353
388
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## 📚 Additional Resources
|
|
392
|
+
|
|
393
|
+
- Main documentation: `/docs/`
|
|
394
|
+
- API reference: `/docs/api/`
|
|
395
|
+
- Examples: `/docs/examples/basic/image-to-video/`
|
|
396
|
+
- Architecture: `/ARCHITECTURE.md`
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
**Last Updated**: 2025-01-08
|
|
401
|
+
**Version**: 2.0.0 (Strategy-based Documentation)
|
|
360
402
|
|
|
361
|
-
|
|
403
|
+
---
|
|
362
404
|
|
|
363
|
-
|
|
364
|
-
- [Text to Image](../text-to-image) - Generate images from text
|
|
365
|
-
- [Upscaling](../upscaling) - Increase image resolution before video creation
|
|
405
|
+
## 📝 Changelog
|
|
366
406
|
|
|
367
|
-
|
|
407
|
+
### v2.0.0 - 2025-01-08
|
|
408
|
+
- **BREAKING**: Documentation format changed to strategy-based
|
|
409
|
+
- Removed extensive code examples
|
|
410
|
+
- Added rules, prohibitions, and AI agent directions
|
|
411
|
+
- Focus on best practices and implementation guidance
|
|
368
412
|
|
|
369
|
-
|
|
413
|
+
### v1.0.0 - Initial Release
|
|
414
|
+
- Initial feature documentation
|