Making a video screen cast of your Ubuntu Touch (“UT”) device is a bit difficult as of the date of this blog post, however, thankfully, there is a way to do it with a bunch of scary terminal commands.
This is pretty technical, but is probably the only way (for now) to do this. Special thanks to Amolith who forwarded to Joe (“in here”) who then forwarded it to me. The power of free software communities at work!
First, I’ll just give you the commands in case you are already familiar enough with terminals and commands. Then, I will provide detailed how-to to follow.
Record a big raw video file in interesting .raw format
EDIT 20/06/21
This first command has been updated to reduce ‘terminal weirdness’. Now it works quietly in the terminal. Special thanks to Rodney for that excellent improvement.
adb exec-out timeout 120 mirscreencast -m /run/mir_socket --stdout --cap-interval 2 -s 384 640 > ubuntu_touch.raw
Convert it to ‘normal’ format (mp4) with ffmpeg tool
ffmpeg -f rawvideo -pix_fmt rgba -s:v 384x640 -i ubuntu_touch.raw -filter:v "setpts=2*PTS" ubuntu_touch.mp4
I plan to give a few more how-to details next by editing this blog post but for now I at least wanted it logged somewhere where myself and others can easily find it.
Enjoy
Tutorial – How to actually do it.
Before you begin
I would recommend creating a directory / folder just for doing this stuff. Then, you will navigate in your terminal to this directory. That makes sure that all the video is dumping in a place where you’ll be able to find it and work with it easier. Otherwise, your terminal might autonomously dump it an undesired location (your Home directory if you left everything default…). Once you have created this directory, navigate to it with the terminal’s ‘cd’ command. If you don’t know how to do that, take a few minutes to search and learn? It’s a good life skill and you can brag about it at the coffee machine or water cooler…
Now that you have the scary command line codes above ready to copy and paste, here’s how you do it and what to expect.
First, you’ll have to make sure you have adb
setup on your ‘production machine’ (the machine that is recording the Ubuntu Touch output video. You should be ok to just do the usual sudo apt install adb
and then perhaps you’ll need to be in ‘Developer mode’ to do all this. You might find that your system already has adb. If so, it will tell you that your version is up to date, etc and you can continue. If you need either of these or find it’s not working right, this blog has a lot of good info in one place. Most should be current still at the time of this post.
Next, plug in your UT device and get ready to record. Probably a quick test video is wise, by the way, before you start recording a long meaningful video.
Next, run the first command above by copying/pasting into your terminal. You will see this (or something very similar) in the terminal. Just pretend this means “your raw video is now recording to your production machine” because that’s what’s happening even though you can’t see it:
daemon not running; starting now at tcp:5037
daemon started successfully
When you are done recording, go back to your terminal and press ‘control C’ in to stop the process. You will see absolutely nothing except your ^C. Just pretend this means ‘Your raw video file has now stopped recording and is sitting in the directory where you started it”.
Finally, you’ll need to convert the raw video to a human-usable format – and probably mp4 is what you’re looking for which is why the above command is setup the way it is. Note that if you want to do any other million different things with your video work, you could study the power of ffmpeg and do whatever you like with formats, resolutions, etc, etc….
Now, in your terminal after you run the converting command, you are going to see a lot of ‘stuff’ in your terminal. I’m not going to even paste it here because there is so much. I’m also not going to pretend I know what any of of it means. Just be aware this is ‘normal’.
Once complete you should now have a .raw video and a .mp4 video in your screen casting directory.
Double click your .mp4 file to make sure it’s working and enjoy your new Ubuntu Touch video screen recording.