How do I convert a part of a CS:GO demo file into a AVI video file? (Ubuntu 16.04)

Actually there is a way to directly record your demo files in avi.

Check out this article.

In order to start recording from your demo you should use these commands: playdemo <demo_file_name> starts the demo (the file should be in your /csgo/ root folder) sv_cheats 1; host_framerate 60 sets the framerate to 60fps startmovie <demo_avi_name> avi starts recording as AVI

Once you enter the startmovie command you will be prompted to choose a video codec. I used Lagarith lossless codec but most other codecs should work fine.

After I recorded the demo file with the command I converted it from avi to mp4 (3rd party program) but because the software I used to convert the file was a bit glitchy it didn't convert it correctly and the mp4 file was laggy. So just make sure you keep the avi file even after converting it to mp4, just in case.

FYI: A 60fps 1080p mp4 video can lag on some computers, so if it looks laggy make sure to go through a section of the mp4 video frame by frame to test if it really is 60fps.

Hope this helps :)