Skip to content

Commit

Permalink
Merge pull request #290 from vania-pooh/master
Browse files Browse the repository at this point in the history
Added ability to override video frame rate (fixes #287)
  • Loading branch information
vania-pooh committed Nov 30, 2017
2 parents cf63adc + f8eaa9d commit 0f96f4a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/special-capabilities.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ You should manually resize window to desired width and height.
You need to use `setSize` method instead.
====

=== Video Recording: enableVideo, videoName, videoScreenSize
=== Video Recording: enableVideo, videoName, videoScreenSize, videoFrameRate

NOTE: This feature requires some preparation. Please refer <<Video Recording>> section for details.

Expand Down Expand Up @@ -69,6 +69,13 @@ resolution is less than actual, screen on video will be trimmed starting from to
videoScreenSize: "1024x768"
----

* Default video frame rate is `12` frames per second. Specifying `videoFrameRate` capability changes this value:

.Type: int
----
videoFrameRate: 24
----

=== Custom Test Name: name

For debugging purposes it is often useful to give a distinct name to every test case.
Expand Down
4 changes: 4 additions & 0 deletions service/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ func startVideoContainer(ctx context.Context, cl *client.Client, requestId uint6
if videoScreenSize != "" {
env = append(env, fmt.Sprintf("VIDEO_SIZE=%s", videoScreenSize))
}
videoFrameRate := caps.VideoFrameRate
if videoFrameRate > 0 {
env = append(env, fmt.Sprintf("FRAME_RATE=%d", videoFrameRate))
}
log.Printf("[%d] [CREATING_VIDEO_CONTAINER] [%s]\n", requestId, videoContainerImage)
videoContainer, err := cl.ContainerCreate(ctx,
&ctr.Config{
Expand Down
2 changes: 2 additions & 0 deletions service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ func createDockerStarter(t *testing.T, env *service.Environment, cfg *config.Con
ScreenResolution: "1024x768",
VNC: true,
Video: true,
VideoScreenSize: "1024x768",
VideoFrameRate: 25,
HostsEntries: "example.com:192.168.0.1,test.com:192.168.0.2",
ApplicationContainers: "one,two",
TimeZone: "Europe/Moscow",
Expand Down
1 change: 1 addition & 0 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Caps struct {
Video bool `json:"enableVideo"`
VideoName string `json:"videoName"`
VideoScreenSize string `json:"videoScreenSize"`
VideoFrameRate uint16 `json:"videoFrameRate"`
TestName string `json:"name"`
TimeZone string `json:"timeZone"`
ContainerHostname string `json:"containerHostname"`
Expand Down

0 comments on commit 0f96f4a

Please sign in to comment.