mirror of
https://github.com/browser-use/browser-use
synced 2026-04-22 17:45:09 +02:00
Add video recording configuration options to BrowserSession
- Introduced `record_video_framerate` and `record_video_size` parameters to the BrowserSession class for enhanced video recording capabilities. - Updated example in video_recording.py to reflect changes, switching from BrowserSession to Browser for video recording setup. This update allows users to customize video recording settings more effectively.
This commit is contained in:
@@ -244,6 +244,8 @@ class BrowserSession(BaseModel):
|
||||
record_har_mode: str | None = None,
|
||||
record_har_path: str | Path | None = None,
|
||||
record_video_dir: str | Path | None = None,
|
||||
record_video_framerate: int | None = None,
|
||||
record_video_size: dict | None = None,
|
||||
# From BrowserLaunchPersistentContextArgs
|
||||
user_data_dir: str | Path | None = None,
|
||||
# From BrowserNewContextArgs
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import asyncio
|
||||
from pathlib import Path
|
||||
|
||||
from browser_use import Agent, BrowserProfile, BrowserSession, ChatOpenAI
|
||||
from browser_use import Agent, Browser, ChatOpenAI
|
||||
|
||||
# NOTE: To use this example, install imageio[ffmpeg], e.g. with uv pip install "browser-use[video]"
|
||||
|
||||
|
||||
async def main():
|
||||
# Define a profile that enables video recording
|
||||
video_profile = BrowserProfile(headless=False, record_video_dir=Path('./tmp/recordings'))
|
||||
|
||||
browser_session = BrowserSession(browser_profile=video_profile)
|
||||
browser_session = Browser(record_video_dir=Path('./tmp/recordings'))
|
||||
|
||||
agent = Agent(
|
||||
task='Go to github.com/trending then navigate to the first trending repository and report how many commits it has.',
|
||||
|
||||
Reference in New Issue
Block a user