Screen recording on imx8


Is that possible to record screen in toradex imx8m? if yes then how to do?.
I have used gstreamer, but it gives black screen only.

gst-launch-1.0 ximagesrc startx=0 use-damage=0 xid=0x61 ! videoscale ! video/x-raw, width=1280, height=720, rate=25/1 ! videoconvert ! v4l2h264enc ! video/x-h264, profile=high ! avimux ! filesink location=capture.avi

Please help!

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!


I understand you’re trying to record the screen on an iMX8M module using GStreamer but are encountering a black screen issue.

For screen recording on iMX8M platforms using GStreamer, it’s crucial to ensure that the pipeline is correctly set up for the specific hardware and software environment. The ximagesrc element you’re using is typically for capturing from an X11 display, which might not be compatible or properly configured for capturing the screen in your current setup, especially if you’re running a Wayland compositor or if there’s an issue with the X11 configuration.

Given the hardware, a more suitable approach might involve using the kmssink element, which is designed for use with the Linux Kernel Mode Setting (KMS). However, for screen capturing (as opposed to playback), you might need to look into alternatives that are compatible with the iMX8M’s graphical output methods.

One potential solution is to use the v4l2src element if there’s a virtual video device that mirrors the screen output. However, this requires specific driver support that might not be available by default.

Another approach could involve capturing the framebuffer directly, but this method is less common with modern graphics stacks and might not provide the functionality or performance you’re looking for.

Without more details on your specific setup, including the version of the TorizonCore you are using and whether you’re running an X11 or Wayland compositor, it’s challenging to provide a precise solution. The iMX8M series, with its advanced multimedia capabilities, certainly supports screen recording, but the method to achieve this can vary based on the software environment.

If you’re consistently getting a black screen, it might also be worth checking for any error messages in the GStreamer debug output (you can increase the verbosity with the -v flag) and ensuring that your system has the necessary permissions to capture the screen content.

For a more tailored solution, consider experimenting with different GStreamer elements that are compatible with your display server or looking into any iMX8M-specific utilities or configurations recommended by NXP for screen capture.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Audio (Linux) | Toradex Developer Center.

How did you like my response?

:+1: :-1:

Hi @vivek338,

Weston has a built-in screencast recording, please check below link.

Best Regards
Ritesh Kumar


Thanks for replying its working but I want to do by command line. How can I do that?

Hi @ritesh.tx,

I also want to know how I can do by using QT.

Please help!!

Hi @vivek338,

Unfortunately we have not tested any such example for screen recording using qt framework. From a quick google search we found below link which talks about same.

Please note above link is not from Toradex and we have not validated same.

Best Regrads
Ritesh Kumar