Skip to content

Commit a20f104

Browse files
authored
Merge pull request #5 from hakotaco/main
Readme fixes
2 parents d598b4b + bfb4f78 commit a20f104

File tree

1 file changed

+68
-50
lines changed

1 file changed

+68
-50
lines changed

README.md

Lines changed: 68 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
21
<!-- PROJECT SHIELDS -->
32
<!--
43
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
54
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
65
-->
6+
77
[![PyPI version][pypi-shield]][pypi-url]
88
[![Stargazers][stars-shield]][stars-url]
99
[![Issues][issues-shield]][issues-url]
1010
[![Website][website-shield]][website-url]
1111

12-
1312
<!-- PROJECT LOGO -->
1413
<br />
1514
<p align="center">
@@ -34,38 +33,46 @@
3433
</p>
3534

3635
<!-- ABOUT THE PROJECT -->
36+
3737
# VideoDB Python SDK
38-
VideoDB Python SDK allows you to interact with the VideoDB serverless database. Manage videos as intelligent data, not files. It's scalable, cost efficient & optimized for AI applications and LLM integration.
38+
39+
VideoDB Python SDK allows you to interact with the VideoDB serverless database. Manage videos as intelligent data, not files. It's scalable, cost-efficient & optimized for AI applications and LLM integration.
3940

4041
<!-- Documentation -->
4142
<!-- ## Documentation
4243
The documentation for the package can be found [here](https://videodb.io/) -->
4344

4445
<!-- Installation -->
46+
4547
## Installation
48+
4649
To install the package, run the following command in your terminal:
50+
4751
```
4852
pip install videodb
4953
```
5054

51-
5255
<!-- USAGE EXAMPLES -->
56+
5357
## Quick Start
58+
5459
### Creating a Connection
55-
Get API key from [VideoDB console](https://console.videodb.io). Free for first 50 uploads. _(No credit card required)_
60+
61+
Get an API key from the [VideoDB console](https://console.videodb.io). Free for first 50 uploads _(No credit card required)_.
5662

5763
```python
5864
import videodb
5965
conn = videodb.connect(api_key="YOUR_API_KEY")
6066
```
61-
## Working with a single Video
67+
68+
## Working with a Single Video
6269

6370
---
6471

65-
⬆️ **Uploading a Video**
72+
### ⬆️ Uploading a Video
6673

67-
Now that you have established a connection to VideoDB, you can upload your videos using `conn.upload()`
68-
You can directly upload from `youtube`, `any public url`, `S3 bucket` or `local file path`. A default collection is created when you create a new connection.
74+
Now that you have established a connection to VideoDB, you can upload your videos using `conn.upload()`.
75+
You can directly upload from `youtube`, `any public url`, `S3 bucket` or a `local file path`. A default collection is created when you create your first connection.
6976

7077
`upload` method returns a `Video` object.
7178

@@ -78,60 +85,62 @@ video_f = conn.upload(file_path="./my_video.mp4")
7885

7986
```
8087

81-
### 📺 Viewing your video
88+
### 📺 View your Video
8289

83-
Your video is instantly available for viewing 720p resolution ⚡️
90+
Once uploaded, your video is immediately available for viewing in 720p resolution. ⚡️
8491

85-
* Generate a streamable url for video using video.generate_stream()
86-
* Preview the video using video.play(). This will open the video in your default browser/notebook
92+
- Generate a streamable url for the video using video.generate_stream()
93+
- Preview the video using video.play(). This will open the video in your default browser/notebook
8794

8895
```python
8996
video.generate_stream()
9097
video.play()
9198
```
9299

93-
### ⛓️ Stream Sections of videos
100+
### ⛓️ Stream Specific Sections of Videos
94101

95-
You can easily clip specific sections of a video by passing timeline of start and end sections.
96-
It accepts seconds. For example, Here’s we are streaming only first `10 seconds` and then `120` to `140 second` of a video
102+
You can easily clip specific sections of a video by passing a timeline of the start and end timestamps (in seconds) as a parameter.
103+
For example, this will generate and play a compilation of the first `10 seconds` and the clip between the `120th` and the `140th` second.
97104

98105
```python
99-
stream_link = video.generate_stream(timeline=[[0,10], [120,140]])
106+
stream_link = video.generate_stream(timeline=[[0,10], [120,140]])
100107
play_stream(stream_link)
101108
```
102109

103-
### 🔍 Searching inside a video
110+
### 🔍 Search Inside a Video
111+
112+
To search bits inside a video, you have to `index` the video first. This can be done by a simple command.
113+
_P.S. Indexing may take some time for longer videos._
104114

105-
To search bits inside a video — you have to index the video first. This can be done by a simple command.
106-
_Indexing may take some time for longer videos._
107115
```python
108116
video.index_spoken_words()
109117
result = video.search("Morning Sunlight")
110118
result.play()
111119
video.get_transcript()
112120
```
113-
`Videodb` is launching more indexes in upcoming versions.
114-
Currently it offers semantic index - Index by spoken words.
115121

116-
In future you can also index videos using:
117-
1. **Scene** - Visual concepts and events.
122+
`Videodb` is launching more indexing options in upcoming versions. As of now you can try the `semantic` index - Index by spoken words.
123+
124+
In the future you'll be able to index videos using:
125+
126+
1. **Scene** - Visual concepts and events.
118127
2. **Faces**.
119-
3. **Specific domain Index** like Football, Baseball, Drone footage, Cricket etc.
128+
3. **Specific domain Index** like Football, Baseball, Drone footage, Cricket etc.
120129

121-
### Viewing Search Results :
130+
### Viewing Search Results
122131

123-
`video.search()` will return a `SearchResults` object, which contains the sections/shots of videos which semantically match your search query
132+
`video.search()` returns a `SearchResults` object, which contains the sections or as we call them, `shots` of videos which semantically match your search query.
124133

125-
* `result.get_shots()` Returns a list of Shot that matched search query
126-
* `result.play()` Returns a playable url for video (similar to video.play() you can open this link in browser, or embed it into your website using iframe)
134+
- `result.get_shots()` Returns a list of Shot(s) that matched the search query.
135+
- `result.play()` Returns a playable url for the video (similar to video.play(); you can open this link in the browser, or embed it into your website using an iframe).
127136

128137
## RAG: Search inside Multiple Videos
129138

130139
---
131140

132-
`VideoDB` can store and search inside multiple videos with ease. By default, videos are uploaded to your default collection.
141+
`VideoDB` can store and search inside multiple videos with ease. By default, videos are uploaded to your default collection.
133142

134-
### 🔄 Using Collection to upload multiple Videos
143+
### 🔄 Using Collection to Upload Multiple Videos
135144

136145
```python
137146
# Get the default collection
@@ -142,17 +151,17 @@ coll.upload(url="https://www.youtube.com/watch?v=lsODSDmY4CY")
142151
coll.upload(url="https://www.youtube.com/watch?v=vZ4kOr38JhY")
143152
coll.upload(url="https://www.youtube.com/watch?v=uak_dXHh6s4")
144153
```
145-
* `conn.get_collection()` : Returns Collection object, the default collection
146-
* `coll.get_videos()` : Returns list of Video, all videos in collections
147-
* `coll.get_video(video_id)`: Returns Video, respective video object from given `video_id`
148-
* `coll.delete_video(video_id)`: Deletes the video from Collection
149154

150-
### 📂 Search inside collection
155+
- `conn.get_collection()` : Returns a Collection object; the default collection.
156+
- `coll.get_videos()` : Returns a list of Video objects; all videos in the collections.
157+
- `coll.get_video(video_id)`: Returns a Video object, corresponding video from the provided `video_id`.
158+
- `coll.delete_video(video_id)`: Deletes the video from the Collection.
159+
160+
### 📂 Search Inside Collection
161+
162+
You can simply Index all the videos in a collection and use the search method to find relevant results.
163+
Here we are indexing the spoken content of a collection and performing semantic search.
151164

152-
You can simply Index all the videos in a collection and use
153-
search method on collection to find relevant results.
154-
Here we are indexing spoken content of a
155-
collection and performing semantic search.
156165
```python
157166
# Index all videos in collection
158167
for video in coll.get_videos():
@@ -162,49 +171,57 @@ for video in coll.get_videos():
162171
results = coll.search(query = "What is Dopamine?")
163172
results.play()
164173
```
165-
The result here has all the matching bits in a single stream from your collection. You can use these results in your application right away.
174+
175+
The result here has all the matching bits in a single stream from your collection. You can use these results in your application right away.
166176

167177
### 🌟 Explore the Video object
168178

169179
There are multiple methods available on a Video Object, that can be helpful for your use-case.
170180

171-
**Access Transcript**
181+
**Get the Transcript**
182+
172183
```python
173184
# words with timestamps
174185
text_json = video.get_transcript()
175186
text = video.get_transcript_text()
176187
print(text)
177188
```
178189

179-
**Add Subtitle to a video**
190+
**Add Subtitles to a video**
191+
192+
It returns a new stream instantly with subtitles added to the video.
180193

181-
It returns a new stream instantly with subtitle added into the video.
182194
```python
183195
new_stream = video.add_subtitle()
184196
play_stream(new_stream)
185197
```
186-
**Get Thumbnail of Video:**
198+
199+
**Get Thumbnail of a Video:**
187200

188201
`video.generate_thumbnail()`: Returns a thumbnail image of video.
189202

190203
**Delete a video:**
191204

192-
`video.delete()`: Delete a video.
205+
`video.delete()`: Deletes the video.
193206

194-
Checkout more examples and tutorials 👉 [Build with VideoDB](https://docs.videodb.io/build-with-videodb-35) to explore what you can
195-
build with `VideoDB`
207+
Checkout more examples and tutorials 👉 [Build with VideoDB](https://docs.videodb.io/build-with-videodb-35) to explore what you can build with `VideoDB`.
196208

197209
---
210+
198211
<!-- ROADMAP -->
212+
199213
## Roadmap
214+
200215
- Adding More Indexes : `Face`, `Scene`, `Security`, `Events`, and `Sports`
201216
- Give prompt support to generate thumbnails using GenAI.
202217
- Give prompt support to access content.
203-
- Give prompt support to edit videos.
218+
- Give prompt support to edit videos.
204219
- See the [open issues](https://github.com/video-db/videodb-python/issues) for a list of proposed features (and known issues).
205220

206221
---
222+
207223
<!-- CONTRIBUTING -->
224+
208225
## Contributing
209226

210227
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
@@ -219,9 +236,10 @@ Contributions are what make the open source community such an amazing place to b
219236

220237
<!-- MARKDOWN LINKS & IMAGES -->
221238
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
239+
222240
[pypi-shield]: https://img.shields.io/pypi/v/videodb?style=for-the-badge
223241
[pypi-url]: https://pypi.org/project/videodb/
224-
[python-shield]:https://img.shields.io/pypi/pyversions/videodb?style=for-the-badge
242+
[python-shield]: https://img.shields.io/pypi/pyversions/videodb?style=for-the-badge
225243
[stars-shield]: https://img.shields.io/github/stars/video-db/videodb-python.svg?style=for-the-badge
226244
[stars-url]: https://github.com/video-db/videodb-python/stargazers
227245
[issues-shield]: https://img.shields.io/github/issues/video-db/videodb-python.svg?style=for-the-badge

0 commit comments

Comments
 (0)