Videocapture settings for the Blend&Paint DVD

Published on

Warning : the method presented in this article are too old to be applied now. Use this information at your own risk.

videocapture screen

Blend&Paint is my next DVD video tutorial as you probably already read here last week . The DVD is actually on a presale period on the Blendere-shop during the time I finish the video editing.

How I do to setup screen-capture with LinuxMint

Recording desktop on Linux is actually not easy. I already wait for the future comments pointing me the good 'GTKrecordmydesktop' and other similar front end using the recordmydesktop program. I already know them , but they are actually broken and do wrong work ( audio not sync, frame dropped, wrong *.ogv files at saving ). Too bad, I used it for my previous DVD and it worked like a charm. So, when something like this don't work, you have to find workaround. I finally choose ffmpeg to grab the X11 datas, as well as the audio, and developped with the help of various script found on forums my setup. Here is how I did in hoping it will helps.

Gnome configuration for ratio

First I wanted to produce as output video a 1280x720px video at 30fps. My first problem was about my 1680x1050 monitor not at the same ratio than the video I wanted to record. To keep the windows not jumping outside of my permited area to record with the 16/9 ratio, I added 2 black gnome panel to my desktop ( top 55px , bottom 50px ; thanks to my old math for proportions ) . On this panel I could easily add other information/tool for me , as script launcher, or a virtual desktop changer applet to hide my terminal with the running ffmpeg script, or a monitor to see how processors behave during recording. Here is a screenshot of this setup : ( I created another 'user' on my computer to setup this )

videocapture screen

The ffmpeg video capture script I use :

A simpler script developed by Nathan Vegdahl is available on this newer blog post

I created a *.sh script files executable with this setting inside. It was a big waste of time at starting to find the right setting, because even if there is a huge documentation, most of it is outdated ; and because of bug with the actual Linux Mint 64bit default ffmpeg repositery , I needed to compile the last ffmpeg from source. Hard time for a user as me.

gnome-terminal --tab -t "AudioRecording" -e "ffmpeg -f alsa \
-ac 2 -i pulse -b 192k \
-threads 1 /path/to/your/audio/audios/$(date +%Y%m%d_%H%M%S).mp3" \
--tab -t "VideoCapture" -e "ffmpeg -f x11grab -r 60 -s 1680x944 -i :0.0+0,56 \
-sameq -vcodec libx264 -vpre lossless_slower \
-threads 4 /path/to/your/videos/new-captured/$(date +%Y%m%d_%H%M%S)_raw.mkv"

(replace /path/to/your/audio/audios/ and /path/to/your/audio/videos with your folder path )

videocapture terminal This script open 2 tabed gnome terminal

This script record only a part of my 1680x1050 screen to crop the 2 black gnome panel and fall to the 16/9 ratio. ( 1680x944 *.mkv video output ). I compress the video on the fly and keep good performance. Thanks to my multi processors ; corei7. I exit the recording by pressing 'Q' over the terminal. (Note : I record my voice as notation for video editing, on the DVD I don't speak but use text label. )

1st video convert for Kdenlive :

When video are recorded, I batch convert and compress them to 1280x720 using this script I made launched in the same folder than the videos :

cd /projets/0-Atelier/Blend-and-Paint/video/video-in/new-captured  
mkdir raw  
for mkvmovie in *.mkv ; do   
echo ==============================================   
echo ==== Processing $mkvmovie ====   
echo ==============================================  
ffmpeg -i $mkvmovie -vcodec libx264 -r 30 -vpre lossless_slower -s hd720 -threads 0 $frameoutput   
echo -------------------------------------------------------------------------------------------------------   
echo the movie clip $mkvmovie was well exported to $frameoutput   
echo -------------------------------------------------------------------------------------------------------   
echo Job list finished  

Kdenlive video edition:

Now videos can be edited with Kdenlive , my video editor ( sunab repositery version ).

kdenlive video screen

Doing text label and notation over videos takes a long time , but I really can't imagine speak in english on a DVD tutorial. For the moment I spend the 4 last weeks for video editing 3hours of full making of. Here under a screen of the video blocks : Many little label , graph , video cut , effect and transition. DVD is ready really soon, just need to add bonus and correct it here and there now.

kdenlive video block

Kdenlive video rendering :

When done, I render in Kdenlive with this custom profile :

f=mp4 acodec=libfaac ab=384k ar=48000 ac=2 pix_fmt=yuv420p vcodec=libx264 r=30 cqp=0 me_method=esa subq=8 qmin=10 qcomp=0.6 qdiff=4 qmax=51 coder=ac partitions=+parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 refs=16 flags2=+dct8x8+mixed_refs trellis=1 threads=0 aspect=%dar

It's produce large files *.mp4 but lossless ; ready for the final conversion for including on the DVD ; I plan to use Xvid as ffmpeg2theora produce laggy OGV since last versions.

Conclusion :

Useless to notes ; what a headache to find a correct workflow to produce videos capture on Linux nowadays. You can now better understand why there is no more artist producing quality video tutorial on Linux ;)

I hope I will not have to reinvent a third method if I want to produce another DVD.

note: this method and the actual Mypaint version has a known bug not solvable for the moment that unfortunately appear on my DVD at few moment ; the colorpicker keeps displayed on screen instead of the brush cursor. Fortunately this not affect the readability, or the comprehension. Just a funny cursor sometimes

License: "Videocapture settings for the Blend&Paint DVD" by David Revoy − CC-BY 4.0
Tags:  #code  #linux  #lab   | Download: Markdown