seandepagnier
Posts: 12
Joined: Thu Aug 25, 2016 6:07 pm

screencasting

Sat Mar 10, 2018 4:38 pm

I want to make a video of my desktop on raspberry.

I tried "kazam" it works but the framerate is too low. I want 10 frames per second.

I tired "istanbul" the results were even worse.

I tried "ffmpeg" and command is not found. Even with libav-tools installed.

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: screencasting

Mon Mar 12, 2018 3:10 am

sorry late:
as i have similar requirement i play this too: ( on RPI3, full RASPBIAN )

the video software ffmpeg now get with:
sudo apt-get install -y libav-tools
example: sudo raspi-config set resolution DMT 39 1360x768
to show some mouse and linux window operations 5 snaps/sec is ok and gives small video files
~/Videos $ avconv -f x11grab -r 5 -s 1360x768 -i :0.0 out.avi
say 'y' to overwrite the out.avi file if already exists
say 'q' to stop recording
to replay the recording ( at half screen size ) use
~/Videos $ omxplayer --win "100 100 780 484" out.avi
using avplay gives me some problems, as it not stops playing... must use [ctrl][c]

but video quality still poor?

also no idea how to capture the audio ( HDMI output by some app )

_________________________________________________________________________________
VNC:
-a- you can start video capture same command also from remote putty ( also VNC )
as you snap DISPLAY 0 default
( so that terminal window for start/operation is not in the way)
-b- to play the video via VNC need to enable
VNC server / options /
[Troubleshooting] [click] enable experimental direct capture mode
[OK]
( ps. VNC server is the VNC icon in header RPI menu ( and not the drop down menu / properties /
in header VNC viewer (client)! )
too difficult in words, a video would be nice: youtube
_________________________________________________________________________________
Last edited by KLL on Mon Mar 12, 2018 7:37 am, edited 3 times in total.

seandepagnier
Posts: 12
Joined: Thu Aug 25, 2016 6:07 pm

Re: screencasting

Mon Mar 12, 2018 4:37 am

I think I found some solutions... first way:

Code: Select all

avconv -f x11grab -r 10 -s 800x600 -i :0.0 -vcodec libx264 output.mp4
This works up to 10 frames a second or so, above that, and it drops frames, so the resulting video playback becomes faster than it should be. It uses a lot of cpu. It runs on all 4 cores.

The second way:

Code: Select all

avconv -f x11grab -r 15  -s 800x600 -i :0.0 -an -f rawvideo -pix_fmt rgb8 outpu\
t.raw
avconv -f rawvideo -r 15 -s 800x600 -pix_fmt rgb8 -i output.raw -vcodec libx264\
 output.mp4
The first command to record, the second can be later to encode. This uses very little cpu, but the io bandwidth is limited for the sdcard. It also maxes out around 10-15 frames a second, because of sdcard write speed. The playback speed is good at 20 frames a second, but then it will drop a bunch of frames and skip, rather than playback faster like encoding inline.

Maybe possible to use a ramdisk here for short videos with high frame rate, or smaller video sizes.

I used format rgb8 to save on disk space and io bandwidth... rgb24 or rgba could work but you have to use even lower frame rate. yuyv422 can work too but uses a bunch more cpu.


So... What intermediate format can I use that will work. rawvideo uses too much disk io, and libx264 uses too much cpu. I tried a few but the quality was terrible

seandepagnier
Posts: 12
Joined: Thu Aug 25, 2016 6:07 pm

Re: screencasting

Mon Mar 12, 2018 4:57 am

I tried without success to record in mpeg, then re-encode to x264

Code: Select all

avconv -f x11grab -r 20 -s 800x600 -i :0.0 -an -f mjpeg output.mpg
avconv -r 20 -f mjpeg -i output.mpg -r 20 -vcodec libx264 output.mp4
It works with little cpu or io bandwidth, but somehow still speeds the video up, I'm not sure why. It works at 10 frames a second, but that is not useful.


The quality is worse than either rawvideo, or encoding x264 on the fly.

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: screencasting

Mon Mar 12, 2018 5:20 am

seandepagnier wrote:
Mon Mar 12, 2018 4:37 am
Maybe possible to use a ramdisk here for short videos with high frame rate, or smaller video sizes.
why not, just use
/run/shm/out.XXX

try
df -hT /run/shm
ls -la /dev/shm/
first

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: screencasting

Tue Mar 13, 2018 8:48 am

found this:
sudo apt-get install -y simplescreenrecorder
nice and easy menu / plus header icon /
- - sound recording also not work / must be disabled

Return to “Beginners”