Docker-selenium: Docs for simple video recording solution?

Created on 14 Jan 2016  路  4Comments  路  Source: SeleniumHQ/docker-selenium

I've seen a few mentions of people rolling their own video recording solution using this project.

Just wondering if enough best practices exist to either create some docs, or possibly just rattle off some suggested packages to stitch together to make this possible.

We're currently relying exclusively on Browser-as-a-Service vendors, and would like to augment with our own internal browser farm. The video recording piece is a huge value-add of the vendor service.

Thanks!

Most helpful comment

Here鈥檚 how we at @taskworld managed to perform video recording into an MP4 file using docker-selenium.

Install FFmpeg and MP4Box

Create a new image based off docker-selenium and install ffmpeg and gpac:

apt-get update && apt-get install -y ffmpeg gpac && rm -rf /var/lib/apt/lists/*
  • FFmpeg is used to record the screen
  • MP4Box (from package gpac) is used to clean up the recorded file

Take screen recording

Use docker exec -ti bash to spawn a new shell inside a running container. Run this command to record the video:

ffmpeg -video_size 1360x1020 -framerate 15 -f x11grab -i :99.0 /path/to/recording.mp4

Clean up the MP4 file

I might be wrong, but after ffmpeg recorded the video, the generated file is not optimized for HTTP streaming. For example, the video will not start until fully loaded and seeking will not work, etc. MP4Box is used to fix this:

MP4Box -isma -inter 500 /path/to/recording.mp4


Hope this helps! Cheers :D

All 4 comments

Here鈥檚 how we at @taskworld managed to perform video recording into an MP4 file using docker-selenium.

Install FFmpeg and MP4Box

Create a new image based off docker-selenium and install ffmpeg and gpac:

apt-get update && apt-get install -y ffmpeg gpac && rm -rf /var/lib/apt/lists/*
  • FFmpeg is used to record the screen
  • MP4Box (from package gpac) is used to clean up the recorded file

Take screen recording

Use docker exec -ti bash to spawn a new shell inside a running container. Run this command to record the video:

ffmpeg -video_size 1360x1020 -framerate 15 -f x11grab -i :99.0 /path/to/recording.mp4

Clean up the MP4 file

I might be wrong, but after ffmpeg recorded the video, the generated file is not optimized for HTTP streaming. For example, the video will not start until fully loaded and seeking will not work, etc. MP4Box is used to fix this:

MP4Box -isma -inter 500 /path/to/recording.mp4


Hope this helps! Cheers :D

Thanks for pointing to MP4Box @dtinth I successfully implemented it and seems to have fixed my bad-ending-time video issues on Zalenium

Should we keep this issue open @ddavison ? I think if we agree to leave video recording out of the scope of this project we can close this one.

Users can still get video recording by using Zalenium

@diemol has even implemented per-test video recording so you can pass the capability recordVideo: 'true' which is even compatible with Sauce Labs and enable/disable videos per tests:

capabilities: {
    browserName: 'chrome',
    screenResolution: '1680x1050',

    // Record video in Zalenium?
    recordVideo: 'true'
}

correct, we won't be putting video recording in these images

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Manolo2014 picture Manolo2014  路  3Comments

vikramvi picture vikramvi  路  6Comments

matthewsamari picture matthewsamari  路  4Comments

rosskevin picture rosskevin  路  5Comments

jdiprizio picture jdiprizio  路  5Comments