I am trying to get video feed from one of other participant through track_subscribed event (as code below)
async def receive_frames(stream: rtc.VideoStream):
async for frame in video_stream:
print(len(frame))
@room.on("track_subscribed")
def on_track_subscribed(track: rtc.Track, publication: rtc.RemoteTrackPublication, participant: rtc.RemoteParticipant):
if track.kind == rtc.TrackKind.KIND_VIDEO:
nonlocal video_stream
if video_stream is not None:
# only process the first stream received
return
print(f"subscribed to track: {track.name} pub id {publication.sid}")
video_stream = rtc.VideoStream(track)
task = asyncio.create_task(receive_frames(video_stream))
tasks.add(task)
task.add_done_callback(tasks.remove)`
But I got the error below and does not receive any frame
[2023-11-12T12:03:51Z ERROR libwebrtc] (h264_decoder_impl.cc:312): FFmpeg H.264 decoder not found.
[2023-11-12T12:03:51Z ERROR libwebrtc] (decoder_database.cc:148): Failed to initialize decoder.
I am using python3.10 and latest version of LiveKit-sdk (install through pip install livekit and pip install livekit-api
Hello,
I am trying to get video feed from one of other participant through track_subscribed event (as code below)
But I got the error below and does not receive any frame
I am using python3.10 and latest version of LiveKit-sdk (install through
pip install livekit
andpip install livekit-api
Could you please guide me how to fix this error.
Thank you!