From 78eb703340adf8bac20cad683ddeb7b7906af54b Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Sun, 7 Jan 2024 00:23:36 +0530 Subject: [PATCH 1/4] fix(readme): typos and grammar --- README.md | 104 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 61 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 574b97b..d065e07 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,14 @@ - + [![PyPI version][pypi-shield]][pypi-url] [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] [![Website][website-shield]][website-url] -

@@ -34,38 +33,46 @@

+ # VideoDB Python SDK -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. + +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. + ## Installation + To install the package, run the following command in your terminal: + ``` pip install videodb ``` - + ## Quick Start + ### Creating a Connection -Get API key from [VideoDB console](https://console.videodb.io). Free for first 50 uploads. _(No credit card required)_ + +Get an API key from the [VideoDB console](https://console.videodb.io). Free for first 50 uploads _(No credit card required)_. ```python import videodb conn = videodb.connect(api_key="YOUR_API_KEY") ``` + ## Working with a single Video --- ⬆️ **Uploading a Video** -Now that you have established a connection to VideoDB, you can upload your videos using `conn.upload()` -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. +Now that you have established a connection to VideoDB, you can upload your videos using `conn.upload()`. +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. `upload` method returns a `Video` object. @@ -80,10 +87,10 @@ video_f = conn.upload(file_path="./my_video.mp4") ### πŸ“Ί Viewing your video -Your video is instantly available for viewing 720p resolution ⚑️ +Your video is available instantly for viewing in 720p resolution ⚑️ -* Generate a streamable url for video using video.generate_stream() -* Preview the video using video.play(). This will open the video in your default browser/notebook +- Generate a streamable url for the video using video.generate_stream() +- Preview the video using video.play(). This will open the video in your default browser/notebook ```python video.generate_stream() @@ -92,44 +99,46 @@ video.play() ### ⛓️ Stream Sections of videos -You can easily clip specific sections of a video by passing timeline of start and end sections. -It accepts seconds. For example, Here’s we are streaming only first `10 seconds` and then `120` to `140 second` of a video +You can easily clip specific sections of a video by passing a timeline of the start and end timestamps (in seconds) as a parameter. +For example, this will generate and play a compilation of the fist `10 seconds` and the clip between the `120th` and the `140th` second. ```python -stream_link = video.generate_stream(timeline=[[0,10], [120,140]]) +stream_link = video.generate_stream(timeline=[[0,10], [120,140]]) play_stream(stream_link) ``` ### πŸ” Searching inside a video -To search bits inside a video β€” you have to index the video first. This can be done by a simple command. -_Indexing may take some time for longer videos._ +To search bits inside a video, you have to `index` the video first. This can be done by a simple command. +_P.S. Indexing may take some time for longer videos._ + ```python video.index_spoken_words() result = video.search("Morning Sunlight") result.play() video.get_transcript() ``` -`Videodb` is launching more indexes in upcoming versions. -Currently it offers semantic index - Index by spoken words. -In future you can also index videos using: -1. **Scene** - Visual concepts and events. +`Videodb` is launching more indexing options in upcoming versions. As of now you can try the `semantic` index - Index by spoken words. + +In the future you'll be able to index videos using: + +1. **Scene** - Visual concepts and events. 2. **Faces**. -3. **Specific domain Index** like Football, Baseball, Drone footage, Cricket etc. +3. **Specific domain Index** like Football, Baseball, Drone footage, Cricket etc. ### Viewing Search Results : -`video.search()` will return a `SearchResults` object, which contains the sections/shots of videos which semantically match your search query +`video.search()` will return a `SearchResults` object, which contains the sections or as we call them, `shots` of videos which semantically match your search query. -* `result.get_shots()` Returns a list of Shot that matched search query -* `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) +- `result.get_shots()` Returns a list of Shot(s) that matched the search query. +- `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. ## RAG: Search inside Multiple Videos --- -`VideoDB` can store and search inside multiple videos with ease. By default, videos are uploaded to your default collection. +`VideoDB` can store and search inside multiple videos with ease. By default, videos are uploaded to your default collection. ### πŸ”„ Using Collection to upload multiple Videos @@ -142,17 +151,17 @@ coll.upload(url="https://www.youtube.com/watch?v=lsODSDmY4CY") coll.upload(url="https://www.youtube.com/watch?v=vZ4kOr38JhY") coll.upload(url="https://www.youtube.com/watch?v=uak_dXHh6s4") ``` -* `conn.get_collection()` : Returns Collection object, the default collection -* `coll.get_videos()` : Returns list of Video, all videos in collections -* `coll.get_video(video_id)`: Returns Video, respective video object from given `video_id` -* `coll.delete_video(video_id)`: Deletes the video from Collection -### πŸ“‚ Search inside collection +- `conn.get_collection()` : Returns a Collection object; the default collection. +- `coll.get_videos()` : Returns a list of Video objects; all videos in the collections. +- `coll.get_video(video_id)`: Returns a Video object, corresponding video from the provided `video_id`. +- `coll.delete_video(video_id)`: Deletes the video from the Collection. + +### πŸ“‚ Search inside Collection + +You can simply Index all the videos in a collection and use the search method to find relevant results. +Here we are indexing the spoken content of a collection and performing semantic search. -You can simply Index all the videos in a collection and use -search method on collection to find relevant results. -Here we are indexing spoken content of a -collection and performing semantic search. ```python # Index all videos in collection for video in coll.get_videos(): @@ -162,13 +171,15 @@ for video in coll.get_videos(): results = coll.search(query = "What is Dopamine?") results.play() ``` -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. + +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. ### 🌟 Explore the Video object There are multiple methods available on a Video Object, that can be helpful for your use-case. -**Access Transcript** +**Get the Transcript** + ```python # words with timestamps text_json = video.get_transcript() @@ -176,35 +187,41 @@ text = video.get_transcript_text() print(text) ``` -**Add Subtitle to a video** +**Add Subtitles to a video** + +It returns a new stream instantly with subtitles added to the video. -It returns a new stream instantly with subtitle added into the video. ```python new_stream = video.add_subtitle() play_stream(new_stream) ``` -**Get Thumbnail of Video:** + +**Get Thumbnail of a Video:** `video.generate_thumbnail()`: Returns a thumbnail image of video. **Delete a video:** -`video.delete()`: Delete a video. +`video.delete()`: Deletes the video. -Checkout more examples and tutorials πŸ‘‰ [Build with VideoDB](https://docs.videodb.io/build-with-videodb-35) to explore what you can -build with `VideoDB` +Checkout more examples and tutorials πŸ‘‰ [Build with VideoDB](https://docs.videodb.io/build-with-videodb-35) to explore what you can build with `VideoDB`. --- + + ## Roadmap + - Adding More Indexes : `Face`, `Scene`, `Security`, `Events`, and `Sports` - Give prompt support to generate thumbnails using GenAI. - Give prompt support to access content. -- Give prompt support to edit videos. +- Give prompt support to edit videos. - See the [open issues](https://github.com/video-db/videodb-python/issues) for a list of proposed features (and known issues). --- + + ## Contributing 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 + [pypi-shield]: https://img.shields.io/pypi/v/videodb?style=for-the-badge [pypi-url]: https://pypi.org/project/videodb/ -[python-shield]:https://img.shields.io/pypi/pyversions/videodb?style=for-the-badge +[python-shield]: https://img.shields.io/pypi/pyversions/videodb?style=for-the-badge [stars-shield]: https://img.shields.io/github/stars/video-db/videodb-python.svg?style=for-the-badge [stars-url]: https://github.com/video-db/videodb-python/stargazers [issues-shield]: https://img.shields.io/github/issues/video-db/videodb-python.svg?style=for-the-badge From 56e79abc596c577dc936eac2ad4bf4ab7a21ad9e Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Sun, 7 Jan 2024 00:37:02 +0530 Subject: [PATCH 2/4] fix(readme): grammar --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d065e07..1557dab 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ video_f = conn.upload(file_path="./my_video.mp4") ### πŸ“Ί Viewing your video -Your video is available instantly for viewing in 720p resolution ⚑️ +Your video is instantly available for viewing in 720p resolution ⚑️ - Generate a streamable url for the video using video.generate_stream() - Preview the video using video.play(). This will open the video in your default browser/notebook From f3ef036d5b8511e7a596a5713302e87a4ec56e62 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Sun, 7 Jan 2024 00:50:10 +0530 Subject: [PATCH 3/4] fix(readme): chatgpt recommended fixes --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1557dab..bb9c806 100644 --- a/README.md +++ b/README.md @@ -65,11 +65,11 @@ import videodb conn = videodb.connect(api_key="YOUR_API_KEY") ``` -## Working with a single Video +## Working with a Single Video --- -⬆️ **Uploading a Video** +### ⬆️ Uploading a Video Now that you have established a connection to VideoDB, you can upload your videos using `conn.upload()`. 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. @@ -85,9 +85,9 @@ video_f = conn.upload(file_path="./my_video.mp4") ``` -### πŸ“Ί Viewing your video +### πŸ“Ί View your Video -Your video is instantly available for viewing in 720p resolution ⚑️ +Once uploaded, your video is immediately available for viewing in 720p resolution. ⚑️ - Generate a streamable url for the video using video.generate_stream() - Preview the video using video.play(). This will open the video in your default browser/notebook @@ -97,17 +97,17 @@ video.generate_stream() video.play() ``` -### ⛓️ Stream Sections of videos +### ⛓️ Stream Specific Sections of Videos You can easily clip specific sections of a video by passing a timeline of the start and end timestamps (in seconds) as a parameter. -For example, this will generate and play a compilation of the fist `10 seconds` and the clip between the `120th` and the `140th` second. +For example, this will generate and play a compilation of the first `10 seconds` and the clip between the `120th` and the `140th` second. ```python stream_link = video.generate_stream(timeline=[[0,10], [120,140]]) play_stream(stream_link) ``` -### πŸ” Searching inside a video +### πŸ” Search Inside a Video To search bits inside a video, you have to `index` the video first. This can be done by a simple command. _P.S. Indexing may take some time for longer videos._ @@ -127,9 +127,9 @@ In the future you'll be able to index videos using: 2. **Faces**. 3. **Specific domain Index** like Football, Baseball, Drone footage, Cricket etc. -### Viewing Search Results : +### Viewing Search Results -`video.search()` will return a `SearchResults` object, which contains the sections or as we call them, `shots` of videos which semantically match your search query. +`video.search()` returns a `SearchResults` object, which contains the sections or as we call them, `shots` of videos which semantically match your search query. - `result.get_shots()` Returns a list of Shot(s) that matched the search query. - `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. @@ -140,7 +140,7 @@ In the future you'll be able to index videos using: `VideoDB` can store and search inside multiple videos with ease. By default, videos are uploaded to your default collection. -### πŸ”„ Using Collection to upload multiple Videos +### πŸ”„ Using Collection to Upload Multiple Videos ```python # Get the default collection @@ -157,7 +157,7 @@ coll.upload(url="https://www.youtube.com/watch?v=uak_dXHh6s4") - `coll.get_video(video_id)`: Returns a Video object, corresponding video from the provided `video_id`. - `coll.delete_video(video_id)`: Deletes the video from the Collection. -### πŸ“‚ Search inside Collection +### πŸ“‚ Search Inside Collection You can simply Index all the videos in a collection and use the search method to find relevant results. Here we are indexing the spoken content of a collection and performing semantic search. From bfb4f785b935c277e7c6092288b445042459a8ed Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Sun, 7 Jan 2024 00:55:29 +0530 Subject: [PATCH 4/4] fix(readme): brackets --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bb9c806..a9a6e30 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ In the future you'll be able to index videos using: `video.search()` returns a `SearchResults` object, which contains the sections or as we call them, `shots` of videos which semantically match your search query. - `result.get_shots()` Returns a list of Shot(s) that matched the search query. -- `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. +- `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). ## RAG: Search inside Multiple Videos