dgrubb
Posts: 8
Joined: Wed Mar 02, 2016 5:25 pm

Screen capture from VideoCore?

Wed Sep 12, 2018 5:49 pm

I need to capture video of an application I've built using Kivy, which renders using the gl provider without an X session. Consequently, I can't just record /dev/fb0 with something like avconv -f fbdev -i /dev/fb0 as (I think) the gl backend uses the VideoCore directly. I can take screenshots with Andrew's raspi2png, is it also possible to extract video?

N.B: I'm using the official Raspberry Pi Touchscreen, rather than HDMI output.

Cheers,
Dave.

dgrubb
Posts: 8
Joined: Wed Mar 02, 2016 5:25 pm

Re: Screen capture from VideoCore?

Wed Sep 12, 2018 9:42 pm

Found a solution, courtesy of uv4l: https://www.linux-projects.org/document ... raspidisp/

CCx266
Posts: 3
Joined: Sat Mar 23, 2019 10:18 pm

Re: Screen capture from VideoCore?

Sat Mar 23, 2019 10:26 pm

Hello @dgrubb,
I find myself in the very same situation (I build an openFrameworks app using openGL)
and I'm trying to record with uv4l-raspidisp when I found out about it.
If someone has an other option to record on card the hdmi output I'm also interested of course.

Could you elaborate on the command lines you use ? I'm trying this without success:

Code: Select all

 uv4l --auto-video_nr --driver raspidisp --framerate 24 --resolution 3
and then to record a 10s video :

Code: Select all

dd if=/dev/uv4l of=video.h264 bs=1M & pid=$! ; sleep 10; kill $pid
all I get for now is a non valid .h264 file, unreadable.

I would gladly appreciate any help,
Thanks
Last edited by CCx266 on Sun Mar 24, 2019 11:16 am, edited 1 time in total.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26714
Joined: Sat Jul 30, 2011 7:41 pm

Re: Screen capture from VideoCore?

Sun Mar 24, 2019 7:58 am

Google for dispmanx_snapshot, orcsimilar. That should snapshot the output.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

CCx266
Posts: 3
Joined: Sat Mar 23, 2019 10:18 pm

Re: Screen capture from VideoCore?

Sun Mar 24, 2019 11:15 am

Hello,
thanks for your reply, but I need to capture video and not just a snapshot, also X is not implied

CCx266
Posts: 3
Joined: Sat Mar 23, 2019 10:18 pm

Re: Screen capture from VideoCore?

Sun Mar 24, 2019 12:54 pm

I found a working solution for now, with 720p resolution (raspi-config)
When 1080p ffmpeg is complaining, and downscaling is neither a good idea. better have same resolution screen/capture

install uv4l:
https://www.linux-projects.org/uv4l/installation/

create virtual input (see options https://www.linux-projects.org/document ... raspidisp/):

Code: Select all

uv4l --auto-video_nr --driver raspidisp  --resolution 7
record with ffmpeg:

Code: Select all

ffmpeg -f video4linux2 -video_size 1280x720 -i /dev/video0 -c:v copy -strict experimental -y -pix_fmt yuv420p out.mp4
works pretty good.

Return to “Graphics, sound and multimedia”