Recording a Dockerized headless browser above 1024x768 produces distorted videos. Try this alternative command set:
xvfb-run --server-args="-screen 0 1400x900x16" &
ffmpeg -hide_banner -video_size 1400x900 -r 30 -f x11grab -i :99 record_output.mp4 &
Based on my own experimentation with using Dockerized headless browsers, I found that issues with distorted recordings often stem from mismatches in the virtual display settings and the expectations of ffmpeg. For instance, I had to tweak the virtual screen parameters so that both the xvfb-run and the ffmpeg grab were in sync with the dimensions. I settled on a strategy that involved adjusting the color depth and frame rate to ensure a better match, and running ffmpeg in the foreground for clearer error messages. Reviewing logs carefully helped identify the device misconfigurations, which eventually led to a stable resolution recording.
I’ve experienced similar issues with distorted video outputs when using Dockerized headless browsers. My approach involved verifying that the virtual display settings match the video capture parameters exactly. It helped to run initial tests with a smaller resolution to ensure that the frame grabber and virtual display were in sync and then gradually scaling up to the desired output size. In one instance, adjusting the color depth and frame rate parameters provided a rough clue toward resolving the distortions. Consistent logging and incremental tests were key to identifying the configuration mismatch.
hey, i noticed that tweaking the xvfb settings a bit helped me. i switched to a custom x11grab cmd that matched docker’s env vars better, and it solved the distortions. sometimes a lil trial n error with logging really does the trick.