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

howto add context information to the video recording? #1399

Open
dothebart opened this issue Jan 25, 2024 · 3 comments
Open

howto add context information to the video recording? #1399

dothebart opened this issue Jan 25, 2024 · 3 comments

Comments

@dothebart
Copy link

We have a full lifecycle test @arangodb . So the scripts will create databases, add test data to them, run upgrades between versions etc.
The video recording starts at the very start off all this, and we now have a linear video of ~20 minutes, with episodes of nothing happening.
Its hard to align the current testcase to the moment in the video.
Is there a way to set jump-marks or onscreen info so the video can have a bit more context of the real flow ongoing?

@vania-pooh
Copy link
Member

@dothebart currently we don't have such feature. Selenoid just launched a desktop video recording at the beginning of browser session and stops it once you stop browser session. There is no API to manipulate video recording. Do you have any simple ideas on how this could be implemented \ look from the user perspective?

@dothebart
Copy link
Author

dothebart commented Jan 26, 2024

Solution one could be writing & mixing up a TOC-file (table of contents) like:

MPEG-2 is accepted, but a TOC file is generated in the .bcast directory, and that takes time.
Better alternative (when it works): mpeg3toc -v /path/to/video.mpg video.toc Always make the path absolute, since this path is written in the TOC file. Then load the .toc file (not the .mpg) to Cinelerra.

https://billauer.co.il/blog/2009/01/cinelerra-quick-summary/

I don't know how this works for the video format at hand, but most probably it is similar to adding metadata to a picture.
To keep it portable, a way to add this would be done via the selenium API. Determining the point int time would be the responsibility of selenoid, which would then collect the toc-line, and add it to the video after the end of the recording.

Possibility 2 could be to add an On-Screen display (https://github.com/AndreRenaud/XOSD)[osd_cat] in another container accessing the X-Display the recorder takes the video from - like displayed in this german article: https://www.linux-community.de/ausgaben/linuxuser/2004/07/daten-auf-dem-desktop-visualisieren-mit-x-on-screen-display/

@mg-diego
Copy link

mg-diego commented Jul 16, 2024

Hi @dothebart ,

I did something similar using MKVToolnix with Docker, you will need the following:

  • Original video file (.mp4, .mkv)
  • A TXT file that contains the CHAPTERS info in the following format:
CHAPTER01=00:00:00.000
CHAPTER01NAME=<Name1>
CHAPTER02=00:00:00.005
CHAPTER02NAME=<Name2>
CHAPTER03=00:00:00.058
CHAPTER03NAME=<Name3>
CHAPTER04=00:00:00.134
CHAPTER04NAME=<Name4>
[...]

Then you create a Docker container with MKVToolnix:

docker run -d --name=mkvtoolnix -v /docker/appdata/mkvtoolnix:/config:rw -v /home/user:/storage:rw jlesage/mkvtoolnix

And then integrate the chapters info in the video file as (from the host folder that contains the video and the .txt):

docker cp '<video_name>.mp4' mkvtoolnix:tmp/input.mp4
docker cp '<chapters_name>.txt' mkvtoolnix:tmp/chapters.txt
docker exec mkvtoolnix mkvmerge --chapters chapters.txt -o output.mp4 input.mp4
docker cp mkvtoolnix:tmp/output.mp4 '<video_name_with_chapters>.mp4'

The output file will have the chapters integrated so you can jump directly to the bookmarks:
image

The chapters.txt file can be automatically generated in your automation framework in the @BeforeStep hook (in case you use BDD) or any custom test step fixture.

    @Before
    public void beforeScenario(Scenario scenario) {
         testStartTime = System.nanoTime();
    }

    [...]

    @BeforeStep
    public void beforeStep(Scenario scenario) {
            // Add your logic here to write in the chapters.txt file a new entry.
            var stepTimestamp = System.NanoTime() -  testStartTime;
        }
    }

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

No branches or pull requests

3 participants