Trending November 2023 # Why Can’t You Watch Private Videos On Youtube? # Suggested December 2023 # Top 18 Popular

You are reading the article Why Can’t You Watch Private Videos On Youtube? updated in November 2023 on the website Cancandonuts.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested December 2023 Why Can’t You Watch Private Videos On Youtube?

YouTube is today the 2nd most visited website in the world, with tens of billions of visits per month. As the largest video site in the world, there are 800 million videos on the platform as of 2023. However, not every video on YouTube is viewable by default. If you come across a YouTube video that displays “Video unavailable – This video is private”, it means the video has been set to private.

This guide explains why you can’t play private videos on YouTube, how one may allow others to watch his/her private videos, and how to change the visibility of a video to public, unlisted or private on YouTube.

Also see: How to Share and Collaborate a Playlist on YouTube with Friends

A private video on YouTube is a video that was marked as “Private” visibility by the uploader. As everyone can view your uploaded videos on YouTube, privacy is a great concern here. Therefore, YouTube allows users to freely set the visibility of each video they upload.

If the you set a video you upload as “private”, no one else can view the video except yourself and those you invited. Those who do not have the permission to access the video will see the “Video unavailable – This video is private” error message.

If you are not logged in to YouTube or your Google account, you will see a different message that says “Private video – sign in if you’ve been granted access to this video“.

The only way to watch a private video or stream on YouTube is to request permission from the uploader. The uploader will need to send an invite link to your Google account, and then you can view the video via the invite link.

Another way a private YouTube video can be viewable is when the uploader change the visibility of the video from Private to Public or Unlisted. That way everyone will have the permission to access the video.

Simply put, you cannot watch a private video without permission of the uploader. The same goes to your own videos. You can set a video as private so that no one else can view the video you upload.

Recommended Tip: How to Set YouTube to Always Play Highest Video Quality

To share a private YouTube video with a specific user, follow the steps below (screenshots are as of 2023).

In the Invitees column, enter the email addresses of users you want to invite to view your private video.

You may want to enable the “Notify via email” option to notify the users you invite by email.

Related: How to Undo or Clear YouTube “Not Interested” Feedback

After you’ve granted the permission from the uploader to access and watch the private YouTube video, you can directly open the URL to the private video on YouTube and you should be able to play it.

Note that you will need to sign in to your Google account in order to view the video if that account has been granted access to the private video.

Public means everyone on the Internet can view the video, whereas Unlisted means everyone can view the video but it won’t be listed anywhere on YouTube (e.g. YouTube Home, Suggestions, Related Videos and Searches). Unlisted videos can only be discovered and opened by manually visiting the video’s URL.

You're reading Why Can’t You Watch Private Videos On Youtube?

Everything You Should Know About Youtube: Private Vs Unlisted

Everything You Should Know About YouTube: Private vs Unlisted

Having said that, there are times when you (as a video uploader) don’t want the whole YouTube family to watch your video. There can be various reasons that can be categorized in different sections and you want a particular section of viewers to watch the same video. In those cases, you can use the customization settings to make the video available to people as YouTube Private or Unlisted. Yeah!!

YouTube Video Types & YouTube Platform

Everyone is using the same platform (YouTube), yet, many of them are getting reviews in millions & others are in thousands. Obviously, the time, content, video quality, & supporting things matter, however, the video-type-leveraging also plays a vital role that can boost your business (if you are into business). These video types can be as simple as Public to as specific as Private that limits your viewers & let you control your audience.

If you are running a business, there are plenty of questions that go through your mind while posting videos on YouTube. Should I make this public so my friends can also see the video along with the clients? Do I need to make a separate video for clients or share a webinar with them? Do I want my family to see these videos or just the people I’m working with?

So many questions yet you need to find ways to meet all the expectations and publish your videos as well. And the simplest & approachable way is, publishing your videos as Private or Unlisted so you will have full control over the viewers.

What Do You Mean By YouTube Private vs Unlisted? YouTube Private

As the name suggests, YouTube Private is all about keeping your video visible to a certain number of people (50 in total)    . That too, you will need to invite so choose the people wisely before sending the invitation for the video visibility. This goes without say but the YouTube Private videos don’t get listed under video recommendations & search results.

Additionally, it’s not a chain system where the invitees can send the invite link to other people so they can watch the video. Even after saying so, the invitee sends the link to another person, he/she won’t be able to watch it unless they have got the direct link from the uploader.

Also Read: How to Use YouTube in Picture-in-Picture Mode

YouTube Unlisted

Apart from the YouTube Private, another video type YouTube offers is Unlisted that is somewhere between the Private & Public category. Any YouTube video that comes under the YouTube Unlisted video category can’t be seen in video suggestions or search results. However, whoever has the link to the video can watch as well as share the video easily.

That means, in Youtube Unlisted videos, it can work like a chain system where viewers can watch & share the video link to other users as well.

Public

Last but not the least, the Public video category is another section of videos YouTube offers to its uploaders. If you are going ahead with Public type while publishing the video, sky’s the limit for you. You have the whole YouTube world to view your video and more viewers or subscribers is the key to the right direction, we believe. Setting the video’s category Public will bring your video in Google Search results (if someone types in the right keywords). With the right kind of strategic decisions, the Public video category can profit you in many ways.

Difference Between YouTube Private & Unlisted

Now that we have got an idea about the YouTube video types, we can take the decision accordingly while publishing videos. Having said that, the above explanation is just an intro to what the video type means. If you are planning to stay on YouTube for a long time & we believe that you do, knowing about them in depth is a necessity. So here we will be talking about the differences between both types of videos, YouTube Private & YouTube Unlisted.

Also Read: YouTube Loading Slow: Here’s How to Fix

Advantages of Creating a Video, “YouTube Private”

1. Own Video Library

Obviously, if you are sharing your personal videos to a limited number of people, those are close to you. And since you have all the control over those videos, soon it will become your own video library. Please know that those videos can be anything from secret project to comic books or art because YouTube doesn’t limit you to not put specific content videos unless they are compromising ones. So whenever you feel like watching them, go to your account and they are easily accessible to you, your own video library.

2. Organization Info Store

3. Video Sharing With Loved Ones

4. Storage Space Saving

Advantages of Creating a Video, “YouTube Unlisted”

1. Portfolio Sharing With Possibly-Future-Employers

Without a doubt, everyone of us would agree that the Unlisted YouTube category is a gift for users. More than 70% of people are doing jobs in the whole world & they don’t want the current employer to know that they are looking for other options. YouTube Unlisted can help you put in your portfolio in front of prospective employers and your current employer wouldn’t have a slightest idea about it. Isn’t this cool!!

2. Feedback Sharing For Co-Workers

Feedbacks are a very important aspect of running a business (no matter small or big) & it needs to be kept away from people you wouldn’t want to get access to. In case you have a running business where the employee strength is more than 50 people or simply a section you want to share the feedback with, go with Unlisted YouTube videos.

3. YouTube Page Redesigning

Not everyone is too happy with the video he/she made in the starting phase of posting videos on YouTube. So in case you want to untie yourself from those old videos that are embarrassing for you now, the Unlisted YouTube feature is for you. Plus, there are possibilities that the video has been shared or embedded by any of the users and it can be accessed again. So in those cases, if you switch to Unlisted YouTube video, the video visibility will be gone hence no access. Voila!!

Limitations of YouTube Unlisted Videos

Not every feature, app or software is perfect because users have their own expectations & manufacturers cannot amend accordingly. With YouTube Unlisted, one of the limitations is if your video is on playlist, it might appear publicly. Another limitation is a bit riskier because the unlisted YouTube videos get shared on other websites as there is a dedicated website for YouTube Unlisted videos altogether.

How to Change The YouTube Video Privacy Settings

Now that we have learnt about the video types that one can publish on YouTube, it’s important to know how to do so. You need to start the process by logging into the YouTube account & tap on the “Video & +” sign nearby the account profile picture.

Post doing so, choose the Upload Video option from the list & on the same page, you will see the list of making it either Public, Unlisted, or Private.

Choose your appropriate video type accordingly and go ahead with uploading the video on YouTube.

Wrapping Up:

Privacy protection is very important while you are on the internet & one loose end can give you nightmares. From Facebook to Instagram & YouTube, every one of those platforms are popular among users, however, while creating & uploading content, you need to be extra careful. For example, if you want to upload videos on YouTube & control your viewers, set the video privacy settings accordingly.

From YouTube Private to Unlisted YouTube & Public categories define your YouTube family so be careful while doing so.

Next Read

How To Make A GIF From A YouTube Video

How To Download YouTube Videos On Mac

Quick Reaction:

About the author

Ankit Agarwal

How To Host A Private Live Stream On Youtube: 4 Steps

If you’re looking to host a live stream, YouTube is a great platform for it.

However, are you able to host a private or an unlisted live stream on YouTube?

The answer is yes—YouTube allows streamers to change the privacy settings of their live stream.

Streamers can do so before they go live on YouTube by changing their live stream’s “Visibility” setting.

However, the “Visibility” setting is hard to find.

Once you’re able to find the setting, you’ll be able to change the privacy setting of your live stream.

In this guide, you’ll learn how to host a private live stream on YouTube.

How to private live stream on YouTube

After you’ve changed the “Visibility” setting to “Private”, you need to invite others by email.

When your video is live, your invitees will be notified via email to join it.

Below is a step-by-step guide (with screenshots) on how you can host a private live stream on YouTube:

Firstly, open YouTube on a desktop.

This will open up a menu with two options including “Upload video” and “Go live”.

The “Upload video” option allows you to upload a video to your YouTube channel.

On the other hand, the “Go live” option allows you to go live on YouTube.

Keep in mind that you’re only able to live stream on YouTube on a desktop.

If you’re looking to live stream on YouTube on a mobile device, you need to have at least 1k subscribers.

On the other hand, there is no requirement for you to live stream on the desktop version of YouTube.

2. Select “Right now”, then select “Built-in webcam”

Select your preferred time to live stream (“Right now” recommended).

On the YouTube Live Control Room, you’ll be given two options including “Right now” and “Later date”.

The “Right now” option allows you to live stream now, but you can review your settings before going live.

If you want to schedule your stream for a later time, you can select the “Later date” option.

Select the type of stream (“Built-in software” recommended).

After you’ve selected the “Right now” option, you’ll have to choose between a couple of stream types.

The first stream type is “Built-in webcam” while the second stream type is “Streaming software”.

If you want to stream using your webcam and microphone, select the “Built-in webcam” option.

This option is also recommended for first-time creators as it is simpler.

However, if you want to live stream using a streaming software like OBS, select the “Streaming software” option.

To make things simpler, select the “Built-in” webcam option.

Move on to the next steps to learn how to change your live stream to a private one.

Once you’ve chosen when you want to go live and your preferred type of stream, you’ll land on your live streaming dashboard.

On your live streaming dashboard, you’ll see your video’s information (title, category, privacy, etc.).

You’ll also see your stream settings, analytics, and stream health.

On your video’s information, you’ll see an “Edit” button on the top right of it.

As your channel’s information contains your video’s privacy settings, you need to edit it.

On the “Details” tab, you’ll see your video’s title, description, visibility, and more.

Scroll down until you see the “Visibility” option.

The “Visibility” option allows you to change who can watch your live stream.

By default, the option is set to “Public”, which means that everyone will be able to watch your live stream on YouTube.

Proceed to the last step to learn how to private your live stream so that only selected people can watch it.

4. Select “Private” & invite others by email

There are three visibility options that you can choose from including “Private”, “Unlisted”, and “Public”.

The “Private” option allows you to invite a selected number of people via email to join your live stream.

If you select “Unlisted”, only people with the link to your live stream will be able to watch it.

Lastly, the “Public” option allows anyone on YouTube to watch your live stream.

Select the “Private” option to private your live stream.

Then, you’re required to invite others to your live stream.

You can do so by entering their email addresses on the “Invitees” field.

Simply enter the email addresses of the people that you want to invite to your live stream and hit “Enter” on your keyboard.

If you’ve successfully entered an email, there’ll be an “x” icon next to it.

This will allow YouTube to send an email to your invitees when you are live.

You’ve successfully learned how to host a private live stream on YouTube!

Conclusion

Due to the rising popularity of working from home and home-based learning, online meetings are more prevalent.

Going live on YouTube is a unique way to conduct an online meeting with your colleagues, classmates, etc.

But with dedicated video communication tools like Zoom and Microsoft Teams, people are starting to make the switch to them.

Although YouTube live is normally used for gaming, you can also use it to conduct video/web conferencing.

Further Reading

How To Find Your YouTube Stream Key (2023)

How to Hide Your Subscribers on YouTube

Do You Have to Pay to Subscribe to a YouTube Channel?

Youtube Recap: My Favorite 9To5Mac Videos Of 2023

I’d never tried the Philips Hue Lightstrip before this video, but it’s safe to say that it immediately made me a firm believer. In nearly every video since then, the Hue Lightstrip Plus, with its ever-changing color, has been present in the background.

The Lightstrip Plus, along with other Hue-enabled HomeKit-compatible smart lights, can instantly lend some much-needed spice to a drab interior space. Sure, I’ve probably overdone it with the color schemes here and there, but it’s fun to paint the walls and other surfaces with light.

Prior to this video I had no earthly idea that so many people cared about installing Windows on Mac.  Almost a million views later, and it’s safe to say that the interest is very much alive and well.

I’ve done several eGPU videos over the past year, but this was by far my favorite build due to the customized fan and the small, compact form factor of the Akitio Thunder3.

iOS 11 has been out for several months now, but this was the first in-depth hands-on look at many of the exciting new features and changes that Apple introduced back at WWDC 2023.

The 10.5-inch iPad Pro is, in my opinion, the best iPad iteration ever. Its new form factor, speed, and screen enhancements make it a no-brainer for those looking to do “real work” from an iPad. Coupled with iOS 11, which introduces the biggest change ever to the iPad from a software perspective, and you have a clear winner. That said, I’m very much looking to a slimmer-bezel design that ditches the Home button and adopts Face ID.

I didn’t make a lot of Mac hardware videos in 2023, but felt compelled to share how easy it was to upgrade the 5K iMac’s RAM for cheap. Apple charges an inordinate price for its RAM upgrades, so you stand to save some serious coin by performing the upgrade yourself. It’s just sad that the new iMac Pro doesn’t feature user-upgradable RAM.

It’s not everyday that a game-changing professional app lands on the iPad, but that’s just what happened with LumaFusion. A video editing app that includes many power-user features normally associated with desktop NLEs, LumaFusion continues to evolve into a competent mobile video editing solution, and is an outright steal at only $17.99.

When macOS High Sierra launched for developers, we were super excited to learn that Apple would officially be supporting external GPUs for the first time. Although said support is still in its early stages, the latest macOS High Sierra betas have shown considerable promise. The good news is that 2023 will bring forth even more eGPU milestones.

After using the iPhone X for a month, I’m happy with all of its new gesture based controls, OLED screen, and overall design. It’s easy to say that the latest iPhone is the best iPhone, but in this case I really mean it; it’s clearly the best one yet. In fact, it might be my favorite new product of 2023.

Video recap

2023 was a huge year for our YouTube channel, and it will only get better in 2023. We have lots of new goodies planned for subscribers, including recurring shows and increased interaction with viewers. If you’ve yet to subscribe, you can use this link to do so now.

FTC: We use income earning auto affiliate links. More.

Build A Chatgpt For Youtube Videos With Langchain

Introduction

Have you ever wondered how good it would be to chat with a video? As a blog person myself, it often bores me to watch an hour-long video to find relevant information. Sometimes it feels like a job to watch a video to get any useful information out of it. So, I built a chatbot that lets you chat with YouTube videos or any video. This was made possible by GPT-3.5-turbo, Langchain, ChromaDB, Whisper, and Gradio. So, in this article, I will do a code walk-through of building a functional chatbot for YouTube videos with Langchain.

Learning Objectives

Build the web interface using Gradio

Handle YouTube videos and extract textual data from them using Whisper

Process and format texts appropriately

Create embeddings of text data

Configure Chroma DB to store data

Initialize a Langchain conversation chain with OpenAI chatGPT, ChromaDB, and embeddings function

Finally, querying and streaming answers to the Gradio chatbot

Before getting to the coding part, let’s get familiarized with the tools and technologies we will use.

This article was published as a part of the Data Science Blogathon.

Langchain

The Langchain is an open-source tool written in Python that makes Large Language Models data aware and agentic. So, what does that even mean? Most of the commercially available LLMs, such as GPT-3.5 and GPT-4, have a limit on the data they are trained on. For example, ChatGPT can only answer questions that it has already seen. Anything after September 2023 is unknown to it. This is the core issue that Langchain solves. Be it a Word doc or any personal PDF, we can feed the data to an LLM and get a human-like response. It has wrappers for tools like Vector DBs, Chat models, and embedding functions, which make it easy to build an AI application using just Langchain.

Langchain also allows us to build Agents – LLM bots. These autonomous agents can be configured for multiple tasks, including data analysis, SQL querying, and even writing basic codes. There are a lot of things we can automate using these agents. This is helpful as we can outsource low-level knowledge work to an LLM, saving us time and energy.

In this project, we will use Langchain tools to build a chat app for videos. For more information regarding Langchain, visit their official site.

Whisper

Whisper is another progeny of OpenAI. It is a general-purpose speech-to-text model that can convert audio or videos into text. It is trained on a large amount of diverse audio to perform multi-lingual translation, speech recognition, and classification.

The model is available in five different sizes tiny, base, medium, small, and large, with speed and accuracy tradeoffs. The performance of models also depends on the language. The figure below shows a WER (Word Error Rate) breakdown by languages of Fleur’s dataset using the large-v2 model.

Vector Databases

Most machine learning algorithms cannot process raw unstructured data like images, audio, video, and texts. They have to be converted into matrices of vector embeddings. These vector embeddings represent the said data in a multi-dimensional plane. To get embeddings, we need highly efficient deep-learning models capable of capturing the semantic meaning of data. This is highly important for making any AI app. To store and query this data, we need databases capable of handling them effectively. This resulted in the creation of specialized databases called vector databases. There are multiple open-source databases are there. Chroma, Milvus, Weaviate, and FAISS are some of the most popular.

Another USP of vector stores is that we can perform high-speed search operations on unstructured data. Once we get the embeddings, we can use them for clustering, searching, sorting, and classification. As the data points are in a vector space, we can calculate the distance between them to know how closely they are related. Multiple algorithms like Cosine Similarity, Euclidean Distance, KNN, and ANN (Approximate Nearest Neighbour) are used to find similar data points.

We will use Chroma vector store – an open-source vector database. Chroma also has Langchain integration, which will come in very handy.

Gradio

The fourth horseman of our app Gradio is an open-source library to share machine learning models easily. It can also help build demo web apps with its components and events with Python.

If you are unfamiliar with Gradio and Langchain, read the following articles before moving ahead.

Let’s now start building it.

Setup Dev Env

To set up the development environment, create a Python virtual environment or create a local dev environment with Docker.

Now install all these dependencies

pytube==15.0.0 gradio == 3.27.0 openai == 0.27.4 langchain == 0.0.148 chromadb == 0.3.21 tiktoken == 0.3.3 openai-whisper==20230314 Import Libraries import os import tempfile import whisper import datetime as dt import gradio as gr from langchain.embeddings import OpenAIEmbeddings from langchain.vectorstores import Chroma from langchain.chat_models import ChatOpenAI from langchain.chains import ConversationalRetrievalChain from pytube import YouTube from typing import TYPE_CHECKING, Any, Generator, List Create Web Interface

We will use Gradio Block and components to build the front end of our application. So, here’s how you can make the interface. Feel free to customize as you see fit.

with gr.Blocks() as demo: with gr.Row(): # with gr.Group(): with gr.Column(scale=0.70): api_key = gr.Textbox(placeholder='Enter OpenAI API key', show_label=False, interactive=True).style(container=False) with gr.Column(scale=0.15): change_api_key = gr.Button('Change Key') with gr.Column(scale=0.15): remove_key = gr.Button('Remove Key') with gr.Row(): with gr.Column(): chatbot = gr.Chatbot(value=[]).style(height=650) query = gr.Textbox(placeholder='Enter query here', show_label=False).style(container=False) with gr.Column(): video = gr.Video(interactive=True,) start_video = gr.Button('Initiate Transcription') gr.HTML('OR') yt_link = gr.Textbox(placeholder='Paste a YouTube link here', show_label=False).style(container=False) yt_video = gr.HTML(label=True) start_ytvideo = gr.Button('Initiate Transcription') gr.HTML('Please reset the app after being done with the app to remove resources') reset = gr.Button('Reset App') if __name__ == "__main__": demo.launch()

The interface will appear like this

Here, we have a textbox that takes the OpenAI key as input. And also two keys for changing the API key and deleting the key. We also have a chat UI on the left and a box for rendering local videos on the right. Immediately below the video box, we have a box asking for a YouTube link and buttons that say “Initiate Transcription.”

Gradio Events

Now we will define events to make the app interactive. Add the below codes at the end of the gr.Blocks().

outputs=[start2, yt_video]).then( fn=embed_video, inputs=

, outputs= ).success( fn=lambda:resume, outputs=[start2]) outputs=[start1,video]).then( fn=embed_yt, inputs=[yt_link], outputs = [yt_video, chatbot]).success( fn=lambda:resume, outputs=[start1]) query.submit(fn=add_text, inputs=[chatbot, query], outputs=[chatbot]).success( fn=QuestionAnswer, inputs=[chatbot,query,yt_link,video], outputs=[chatbot,query]) api_key.submit(fn=set_apikey, inputs=api_key, outputs=api_key)

query: Responsible for streaming response from LLM to the chat UI.

The rest of the events are for handling the API key and resetting the app.

We have defined the events but haven’t defined the functions responsible for triggering events.

Backend

To not make it complicated and messy, we will outline the processes we will be dealing with in the backend.

Handle API keys.

Handle Uploaded video.

Transcribe videos to get texts.

Create chunks out of video texts.

Create embeddings from texts.

Store vector embeddings in the ChromaDB vector store.

Create a Conversational Retrieval chain with Langchain.

Send relevant documents to the OpenAI chat model (gpt-3.5-turbo).

Fetch the answer and stream it on chat UI.

We will be doing all these things along with a few exception handling.

Define a few environment variables.

chat_history = [] result = None chain = None run_once_flag = False call_to_load_video = 0 enable_box = gr.Textbox.update(value=None,placeholder= 'Upload your OpenAI API key', interactive=True) disable_box = gr.Textbox.update(value = 'OpenAI API key is Set', interactive=False) remove_box = gr.Textbox.update(value = 'Your API key successfully removed', interactive=False) pause = gr.Button.update(interactive=False) resume = gr.Button.update(interactive=True) update_video = gr.Video.update(value = None) update_yt = gr.HTML.update(value=None) Handle API Keys enable_box = gr.Textbox.update(value=None,placeholder= 'Upload your OpenAI API key', interactive=True) disable_box = gr.Textbox.update(value = 'OpenAI API key is Set',interactive=False) remove_box = gr.Textbox.update(value = 'Your API key successfully removed', interactive=False) def set_apikey(api_key): os.environ['OPENAI_API_KEY'] = api_key return disable_box def enable_api_box(): return enable_box def remove_key_box(): os.environ['OPENAI_API_KEY'] = '' return remove_box Handle Videos

Next up, we will be dealing with uploaded videos and YouTube links. We will have two different functions dealing with each case. For YouTube links, we will create an iframe embed link. For each case, we will call another function make_chain() responsible for creating chains.

def embed_yt(yt_link: str): # This function embeds a YouTube video into the page. # Check if the YouTube link is valid. if not yt_link: raise gr.Error('Paste a YouTube link') # Set the global variable `run_once_flag` to False. # This is used to prevent the function from being called more than once. run_once_flag = False # Set the global variable `call_to_load_video` to 0. # This is used to keep track of how many times the function has been called. call_to_load_video = 0 # Create a chain using the YouTube link. make_chain(url=yt_link) # Get the URL of the YouTube video. url = yt_link.replace('watch?v=', '/embed/') # Create the HTML code for the embedded YouTube video. embed_html = f"""<iframe width="750" height="315" src="{url}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" # Return the HTML code and an empty list. return embed_html, [] # This function embeds a video into the page. # Check if the video is valid. if not video: raise gr.Error('Upload a Video') # Set the global variable `run_once_flag` to False. # This is used to prevent the function from being called more than once. run_once_flag = False # Create a chain using the video. make_chain(video=video) # Return the video and an empty list. return video, [] Create Chain

This is one of the most important steps of all. This involves creating a Chroma vector store and Langchain chain. We will use a Conversational retrieval chain for our use case. We will use OpenAI embeddings, but for actual deployments, use any free embedding models like Huggingface sentence encoders, etc.

global chain, run_once_flag

# Check if a YouTube link or video is provided if not url and not video: raise gr.Error('Please provide a YouTube link or Upload a video')

if not run_once_flag: run_once_flag = True # Get the title from the YouTube link or video title = get_title(url, video).replace(' ','-')

# Process the text from the video grouped_texts, time_list = process_text(url=url) if url else process_text(video=video)

# Convert time_list to metadata format time_list = [{'source': str(t.time())} for t in time_list]

# Create vector stores from the processed texts with metadata vector_stores = Chroma.from_texts(texts=grouped_texts, collection_name='test', embedding=OpenAIEmbeddings(), metadatas=time_list)

# Create a ConversationalRetrievalChain from the vector stores chain = ConversationalRetrievalChain.from_llm(ChatOpenAI(temperature=0.0), retriever= vector_stores.as_retriever( search_kwargs={"k": 5}), return_source_documents=True)

return chain

Get texts and metadata from either YouTube URL or video file.

Create a Chroma vector store from texts and metadata.

Build a chain using OpenAI gpt-3.5-turbo and chroma vector store.

Return chain.

Process Texts

In this step, we will do appropriate slicing of texts from videos and also create the metadata object we used in the above chain-building process.

global call_to_load_video

if call_to_load_video == 0: print(‘yes’) # Call the process_video function based on the given video or URL result = process_video(url=url) if url else process_video(video=video) call_to_load_video += 1

texts, start_time_list = [], []

# Extract text and start time from each segment in the result for res in result[‘segments’]: start = res[‘start’] text = res[‘text’]

start_time = dt.datetime.fromtimestamp(start) start_time_formatted = start_time.strftime(“%H:%M:%S”)

texts.append(”.join(text)) start_time_list.append(start_time_formatted)

texts_with_timestamps = dict(zip(texts, start_time_list))

# Convert the timestamp strings to datetime objects formatted_texts = { text: dt.datetime.strptime(str(timestamp), ‘%H:%M:%S’) for text, timestamp in texts_with_timestamps.items() }

grouped_texts = [] current_group = ” time_list = [list(formatted_texts.values())[0]] previous_time = None time_difference = dt.timedelta(seconds=30)

# Group texts based on time difference for text, timestamp in formatted_texts.items():

if previous_time is None or timestamp – previous_time <= time_difference: current_group += text else: grouped_texts.append(current_group) time_list.append(timestamp) current_group = text previous_time = time_list[-1]

# Append the last group of texts if current_group: grouped_texts.append(current_group)

return grouped_texts, time_list

The process_text function takes either a URL or a Video path. This video is then transcribed in the process_video function, and we get the final texts.

We then get the start time of each sentence (from Whisper) and group them in 30 seconds.

We finally return the grouped texts and starting time of each group.

Process Video

In this step, we transcribe video or audio files and get texts. We will use the Whisper base model for transcription.

if url: file_dir = load_video(url) else: file_dir = video

print(‘Transcribing Video with whisper base model’) model = whisper.load_model(“base”) result = model.transcribe(file_dir)

return result

For YouTube videos, as we cannot directly process them, we will have to handle them separately. We will use a library called Pytube to download the audio or video of the YouTube video. So, here’s how you can do it.

# Create a YouTube object for the given URL. yt = YouTube(url)

# Get the target directory. target_dir = os.path.join(‘/tmp’, ‘Youtube’)

# If the target directory does not exist, create it. if not os.path.exists(target_dir): os.mkdir(target_dir)

# Get the audio stream of the video. stream = yt.streams.get_audio_only()

# Download the audio stream to the target directory. stream.download(output_path=target_dir)

# Get the path of the downloaded file. path = target_dir + ‘/’ + yt.title + ‘.mp4’

# Return the path of the downloaded file. return path

Create a YouTube object for the given URL.

Create a temporary target directory path

Check if the path exists else create the directory

Download the audio of the file.

Get the path directory of the video

This was the bottom-up process from getting texts from videos to creating the chain. Now, all that remains is configuring the chatbot.

Configure Chatbot

All we need now is to send a query and a chat_history to it to fetch our answers. So, we will define a function that only triggers when a query is submitted.

def add_text(history, text): if not text: raise gr.Error('enter text') history = history + [(text,'')] return history # This function answers a question using a chain of models. # Check if a YouTube link or a local video file is provided. if video and url: # Raise an error if both a YouTube link and a local video file are provided. raise gr.Error('Upload a video or a YouTube link, not both') elif not url and not video: # Raise an error if no input is provided. raise gr.Error('Provide a YouTube link or Upload a video') # Get the result of processing the video. result = chain({"question": query, 'chat_history': chat_history}, return_only_outputs=True) # Add the question and answer to the chat history. chat_history += [(query, result["answer"])] # For each character in the answer, append it to the last element of the history. for char in result['answer']: history[-1][-1] += char yield history, ''

We provide the chat history with the query to keep the context of the conversation. Finally, we stream the answer back to the chatbot. And don’t forget to define the reset functionality to reset all the values.

So, this was all about it. Now, launch your application and start chatting with videos.

This is how the final product looks

Video Demo:

Real-life Use cases

An application that lets end-user chat with any video or audio can have a wide range of use cases. Here are some of the real-life use cases of this chatbot.

Education: Students often go through hours-long video lectures. This chatbot can aid students in learning from lecture videos and extract useful information quickly, saving time and energy. This will significantly improve the learning experience.

Legal: Law professionals often go through lengthy legal proceedings and depositions to analyze the case, prepare documents, research, or compliance monitoring. A chatbot like this can go a long way in decluttering such tasks.

Content Summarization: This app can analyze video content and generate summarized text versions. This lets the user grasp highlights of the video without watching it entirely.

Customer Interaction: Brands can incorporate a video chatbot feature for their products or services. This can be helpful for businesses that sell products or services that are high-ticket or that require a lot of explanation.

Video Translation: We can translate the text corpus to other languages. This can facilitate cross-lingual communication, language learning, or accessibility for non-native speakers.

These are some of the potential use cases I could think of. There can have a lot more useful applications of a chatbot for videos.

Conclusion

So, this was all about building a functional demo web app for a chatbot for videos. We covered a lot of concepts throughout the article. Here are the key takeaways from the article.

We learned about Langchain – a popular tool for creating AI applications with ease.

Whisper is a potent speech-to-text model by OpenAI. An open-source model that can convert audio and videos to text.

We learned how vector databases facilitate the effective storing and querying of vector embeddings.

We built a completely functional web app from scratch using Langchain, Chroma, and OpenAI models.

We also discussed potential real-life use cases of our chatbot.

This was all about it hope you liked it, and do consider following me on Twitter for more things related to development.

GitHub Repository: sunilkumardash9/chatgpt-for-videos. If you find this helpful, do ⭐ the repository.

Frequently Asked Questions

Related

Why Hulu Watch Party Feature Isn’t Available For You?

The company recently announced a new feature that has us excited. Hulu Watch Party is the new feature by Hulu that allows you and your friends to watch content on Hulu simultaneously in real-time. It also has a chat feature that will allow you and your friends to converse with each other while watching your favorite show.

If you have been looking to avail of this new feature by Hulu and haven’t been able to find it, then there can be multiple reasons why this feature is unavailable to you. Let’s take a look at some of the most common reasons why the Watch Party feature is unavailable to you.

Limited Rollout

Even though Hulu announced the feature officially today, it is still being rolled out to users in batches. This method of making the feature available helps track bugs and issues with the service easily without affecting all of the existing user base.

It also makes it easier for the developers to roll out a stable release without bugs affecting everyone using Hulu in the first place. If you do not have the Watch Party feature available to you, then you should wait for a few days as it is being rolled out to users in small batches.

Under Testing

Watch Party is still a fairly new feature that uses significant bandwidth and resources on your system. Bugs with the service are expected in the initial days which is why developers are slowly making the feature available to everyone.

This will give them a chance to fix upcoming bugs at a steady pace while making sure that any errors or major bugs do not end up affecting Hulu’s entire userbase. Once the feature is out of its testing phase, it will be available to everyone using Hulu.

PC/Web only

If you are trying to access Hulu from a mobile device then chances are that the new Watch Party feature will be unavailable to you. This is because the feature is still in its initial rollout phase which means that currently it has been only released for desktop PCs. You will need access to a desktop browser to access this feature.

Friends and family looking to join you for a watch party on Hulu will also need access to a desktop system and browser to access the Watch Party. Support for mobile devices is expected to come in the future but there is no official word on it yet by Hulu.

US only

Lastly, if you are not in the US and are trying to access this feature then it is likely that it is not available to you. Hulu as a streaming service is currently only available in the US, which means that the Watch Party feature is also only available to the users residing in the US. If you are outside the US and accessing Hulu using a VPN, there is still no guarantee that you will be able to get Watch Party.

Hulu regularly keeps checks on their users’ locations even if they use VPNs which results in many of them being unable to access their accounts regularly. Hulu likely has restricted access for you to its services due to your location being outside the US.

These are the most common reasons why you are unable to access Watch Party as a feature on Hulu. If available, you can try appropriate fixes depending on your reason to try and fix the issue on your end. But we recommend waiting for a few days as Hulu is expected to roll out the feature to all its users in the coming weeks.

Update the detailed information about Why Can’t You Watch Private Videos On Youtube? on the Cancandonuts.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!