Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to capture screencast frame and convert it to AVI movie #614

Closed
wants to merge 2 commits into from
Closed

Add ability to capture screencast frame and convert it to AVI movie #614

wants to merge 2 commits into from

Conversation

muhibbudins
Copy link

This PR aims to resolve issue #22 regarding the ability to record processes on a running page, this function is like using the Screenshot function but with two additional functions as a trigger.

Example usage

func main() {
	browser := rod.New().MustConnect()

	defer browser.MustClose()
	
	page := browser.MustPage(g.blank()).MustWaitLoad()
	
	// ScreenCastRecord listen PageScreenCastFrame and convert it directly into AVI Movie
	_, errorRecord := page.ScreenCastRecord("sample.avi", 6) // Only support .avi video file & frame per second
	
	if errorRecord != nil {
		return errorRecord
	}
	// ScreenCastStart start listening ScreenCastRecord
	_, errorStart := page.ScreenCastStart(100, 1) // Image quality & frame per second
	
	if errorStart != nil {
		return errorStart
	}
	
	errorNavigate := page.Navigate("https://google.com")
	
	if errorNavigate != nil {
		return errorNavigate
	}
	
	time.Sleep(3 * time.Second)
	
	// ScreenCastStop stop listening ScreenCastRecord
	_, errorStop := page.ScreenCastStop()
	
	if errorStop != nil {
		return errorStop
	}
	
	page.MustClose()	
}

@alexferrari88
Copy link
Contributor

do you need any help moving this forward?

@ysmood
Copy link
Member

ysmood commented Aug 30, 2022

It will be great if you can pick it up. We also need to add ffmpeg to the rod docker image.

@alexferrari88
Copy link
Contributor

sounds good, I will have a look as I have some time

@ysmood ysmood force-pushed the master branch 8 times, most recently from 108edef to 49cd11c Compare April 19, 2023 02:30
@ysmood ysmood deleted the branch go-rod:master May 15, 2023 01:17
@ysmood ysmood closed this May 15, 2023
@ysmood
Copy link
Member

ysmood commented May 15, 2023

I renamed the master branch to main, the master branch doesn't exist anymore, Github will auto close PR for non-exist branch.

Sorry for the inconvenient, could you please remake a PR and link it to this old one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants