Skip to content

Commit 49e1e42

Browse files
committed
Change default format to .mkv and fixate version
See also #266
1 parent 832f375 commit 49e1e42

File tree

8 files changed

+27
-9
lines changed

8 files changed

+27
-9
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 2.0.0
2+
_Major version bump due to default video container format change_
3+
* Pinned recorder container to `selenium/video:ffmpeg-8.0-20260202` because the currently latest version of the container is not shutting down properly
4+
* Changed default video container format to `mkv`
5+
* This format allows to play the videos even when they are incomplete
6+
* Update default Selenium version to `4.41.0`
7+
* Updated dependencies
8+
19
# 1.5.3
210
* Improve error message when browser name can't be matched
311
* Updated dependencies

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A re-implementation of [Testcontainer Selenium/WebDriver](https://java.testconta
99
* No VNC Server started in the browser container (unless explicitly stated) → Saves memory
1010
* Uses [Selenium's implementation](https://github.com/SeleniumHQ/docker-selenium/tree/trunk/Video) and isn't [based](https://github.com/testcontainers/vnc-recorder) on [some python code from 2010](https://pypi.org/project/vnc2flv/#history)
1111
* Way more customization options for e.g. ``framerate``, ``codec``, ``preset`` ...
12-
* Uses ``mp4`` as default recording format (wider support in comparison to ``flv``)
12+
* Uses ``mkv`` as default recording format (wider support in comparison to ``flv``)
1313
* [Renders while saving the video](https://github.com/SeleniumHQ/docker-selenium/blob/4c572afd1173b5bd49fa2def3b54ea552fccee85/Video/video.sh#L126) (not when finished which takes additional time)
1414
* Stops the recorder before saving the file so that there is no way that [it runs forever](https://github.com/testcontainers/testcontainers-java/discussions/6229).
1515
* Automatically tries to select a alternative Selenium version for the docker image if it [doesn't exist](https://github.com/SeleniumHQ/docker-selenium/issues/1979).
@@ -25,6 +25,13 @@ Usage is very similar to [Testcontainers default implementation](https://java.te
2525
Make sure to remove the original Testcontainer Webdrivers dependency to avert any mix ups while using the library.
2626
For more information take a look at [our demo](./testcontainers-selenium-demo/src/main/java/software/xdev/Application.java).
2727

28+
### Why are videos recorded as `.mkv` and how can I open them?
29+
30+
In version 2 `.mp4` was replaced with `.mkv` as the default video container format.<br/>
31+
This was done because `.mp4` requires finalization as otherwise the file/container will be consider corrupt. `.mkv` has no such problems.
32+
33+
[Most video players](https://en.wikipedia.org/wiki/Matroska#Support) (including browsers) can play `.mkv` files out of the box.
34+
2835
## Installation
2936
[Installation guide for the latest release](https://github.com/xdev-software/testcontainers-selenium/releases/latest#Installation)
3037

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>software.xdev</groupId>
88
<artifactId>testcontainers-selenium-root</artifactId>
9-
<version>1.5.4-SNAPSHOT</version>
9+
<version>2.0.0-SNAPSHOT</version>
1010
<packaging>pom</packaging>
1111

1212
<organization>

testcontainers-selenium-demo/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<parent>
88
<groupId>software.xdev</groupId>
99
<artifactId>testcontainers-selenium-root</artifactId>
10-
<version>1.5.4-SNAPSHOT</version>
10+
<version>2.0.0-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>testcontainers-selenium-demo</artifactId>
14-
<version>1.5.4-SNAPSHOT</version>
14+
<version>2.0.0-SNAPSHOT</version>
1515
<packaging>jar</packaging>
1616

1717
<organization>

testcontainers-selenium/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>software.xdev</groupId>
88
<artifactId>testcontainers-selenium</artifactId>
9-
<version>1.5.4-SNAPSHOT</version>
9+
<version>2.0.0-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

1212
<name>testcontainers-selenium</name>

testcontainers-selenium/src/main/java/software/xdev/testcontainers/selenium/containers/browser/SeleniumUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public final class SeleniumUtils
3838
private static final Logger LOG = LoggerFactory.getLogger(SeleniumUtils.class);
3939

4040
// as of 2026-01
41-
public static final String DEFAULT_SELENIUM_VERSION = "4.40.0";
41+
public static final String DEFAULT_SELENIUM_VERSION = "4.41.0";
4242
private static String cachedVersion;
4343

4444
private SeleniumUtils()

testcontainers-selenium/src/main/java/software/xdev/testcontainers/selenium/containers/recorder/SeleniumRecordingContainer.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
@SuppressWarnings("java:S2160")
3232
public class SeleniumRecordingContainer extends RecordingContainer<SeleniumRecordingContainer>
3333
{
34-
public static final DockerImageName DEFAULT_IMAGE = DockerImageName.parse("selenium/video");
34+
public static final DockerImageName DEFAULT_IMAGE =
35+
// Workaround https://github.com/SeleniumHQ/docker-selenium/issues/3093
36+
// As of 2026-03 the latest version of the container is not shutting down properly
37+
DockerImageName.parse("selenium/video:ffmpeg-8.0-20260202");
3538

3639
// https://github.com/SeleniumHQ/docker-selenium/blob/033f77c02dde9d61d1a4d44be7526ef689244606/Video/Dockerfile#L103-L110
3740
public static final String ENV_DISPLAY_CONTAINER_NAME = "DISPLAY_CONTAINER_NAME";
@@ -47,7 +50,7 @@ public class SeleniumRecordingContainer extends RecordingContainer<SeleniumRecor
4750
protected String displayContainerName;
4851
protected String videoFileName;
4952
protected boolean resolutionConfigured;
50-
protected String fileExtension = "mp4";
53+
protected String fileExtension = "mkv";
5154

5255
public SeleniumRecordingContainer(final BrowserWebDriverContainer<?> target)
5356
{

testcontainers-selenium/src/test/java/software/xdev/testcontainers/selenium/SimpleContainerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public String getFilesystemFriendlyName()
8585
final String recordedFileName = recorded.getFileName().toString();
8686

8787
Assertions.assertAll(
88-
() -> Assertions.assertTrue(recordedFileName.endsWith(".mp4")),
88+
() -> Assertions.assertTrue(recordedFileName.endsWith(".mkv")),
8989
() -> Assertions.assertTrue(recordedFileName.startsWith("PASSED-")),
9090
() -> Assertions.assertTrue(Files.size(recorded) > 0));
9191
}

0 commit comments

Comments
 (0)