DEV Community

Roby Cigar
Roby Cigar

Posted on • Edited on

1 1

Cara Record Layar Pake CLI (No GUI)

Yup benar sekali, di tutorial kali ini saya akan menunjukkan cara merekam layar tanpa software fancy semacam obs dengan hanya bermodalkan terminal saja.

Tools yang akan kita pakai adalah FFmpeg, apakah itu?

FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.

Intinya FFmpeg berfungsi sebagai software termantep untuk mengolah video, baik itu file bertipe mp4, mp3, mkv, dll. FFmpeg juga cross OS lho, jadi bisa dipakai di Windows, MacOS, Linux, maupun Solaris. Tanpa panjang lebar mari kita mulai saja.

Oke lets go...

1) Download ffmpeg
Pertama-tama buka terminal dan massukan perintah berikut.

sudo apt-get install ffmpeg
Enter fullscreen mode Exit fullscreen mode

2) Dapatkan resolusi layar
Agar kita dapat merekam seluruh layar, kita perlu tahu size screen kita dengan memasukkan perintah berikut nanti akan keluar output berapa ukuran layar kamu.

xdpyinfo | grep 'dimensions:'
Enter fullscreen mode Exit fullscreen mode

Setelah itu, copy hasil dari ukuran layar.

3) Rekam layar kamu

Untuk merekam layar tanpa merekam audio kita bisa masukkan command berikut.

Note: ganti 1920x1080 pada command di bawah dengan ukuran layar yang sudah kamu copy dari perintah sebelumnya.

ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :0.0+0,0 -c:v libx264rgb -crf 0 -preset ultrafast sample.mkv
Enter fullscreen mode Exit fullscreen mode

Jika ingin sekaligus merekam audio masukkan perintah berikut

ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :0.0+0,0 -f pulse -ac 2 -i 0 -c:v libx264rgb -crf 0 -preset ultrafast sample.mkv
Enter fullscreen mode Exit fullscreen mode

4) Stop Recording

Untuk menghentikan rekaman layar, cukup pencet ctrl + c, atau tutup terminal kamu maka file akan otomatis tersimpan.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay