import gradio as gr from gradio_webrtc import WebRTC from twilio.rest import Client import os import cv2 account_sid = os.environ.get("TWILIO_ACCOUNT_SID") auth_token = os.environ.get("TWILIO_AUTH_TOKEN") if account_sid and auth_token: client = Client(account_sid, auth_token) token = client.tokens.create() rtc_configuration = { "iceServers": token.ice_servers, "iceTransportPolicy": "relay", } else: rtc_configuration = None def generation(): url = "https://download.tsi.telecom-paristech.fr/gpac/dataset/dash/uhd/mux_sources/hevcds_720p30_2M.mp4" cap = cv2.VideoCapture(url) iterating = True while iterating: iterating, frame = cap.read() yield frame with gr.Blocks() as demo: gr.HTML( """