In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to use avconv for screen recording under Linux". In daily operation, I believe many people have doubts about how to use avconv for screen recording under Linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubt of "how to use avconv for screen recording under Linux". Next, please follow the editor to study!
Libav is a cross-platform tool library that can be used to handle multimedia files, streams and protocols. It originally originated from ffmpeg. Libav comes with tools such as:
Avplay: a video and audio player.
Avconv: a multimedia converter and video and audio recorder capable of recording multiple device input sources.
Avprobe: a tool that connects to a multimedia file stream and returns statistical information about that file stream.
Libavfilter: a Libav tool filter (filtering) API.
In this article, we will show how to record Linux desktop video and audio on a Debian/Ubuntu/Linux Mint distribution through the 'Avconv' program.
Step 1: download the Avconv tool
1. Avconv is part of "libav-tools" and can be downloaded from official debian-based repositories, such as Mint and Ubuntu. Enter the following command:
The code is as follows:
$sudo apt-get update
$sudo apt-get install libav-tools
Note: you should run'. / configure-help' to list all the optional configuration options and install the corresponding decoders and libraries. You still need to do a lot of work to solve the dependency problem.
Also note that if you are compiling from source code, you need to use sudo avconv instead of avconv to run the tool.
Step 2: start recording desktop video
two。 Everything is ready, and now you can record your video by running the following command:
The code is as follows:
$avconv-f x11grab-r 25-s 1920x1080-I: 0.0-vcodec libx264-threads 4$ HOME/output.avi
Briefly explain this command:
Avconv-f x11grab captures the screen from the X service by default.
-r 25 this is the video frame rate you need, which can be set by yourself.
-s 1920 × 1080 is the desktop resolution of your system, which is very important to set to the resolution of your current desktop.
-I: 0.0 the location we want to record (X service output port) can be set to this.
-vcodec libx264 the encoder we use to record video.
-number of threads 4 threads, which can be changed according to the situation.
The destination file path of the $HOME/output output.
The video format used by .avi can be changed to "flv", "mp4", "wmv", "mov", "mkv" and so on.
3. After running the command, a process is automatically run on the terminal to record and press the "Ctrl+C" key to terminate the record.
4. Now, you can use VLC or another player, or use the player "avplay" from the Libav package to play your recorded video.
The code is as follows:
$avplay $HOME/output.avi
Note: don't forget to replace the path of the output file to your own, the recording effect is still very good.
Here is a video I recorded with "avconv" (outside the wall).
Step 3: start recording audio and video on the desktop
5. If you also want to record audio at the same time, run this command to list all the audio input sources:
The code is as follows:
$arecord-l
The result is something like this:
In my case, I only have one audio input source, so the number is 1, which is why I use the following command to capture my video and microphone audio.
The code is as follows:
$avconv-f alsa-I hw:1-f x11grab-r 25-s 1920x1080-I: 0.0-vcodec libx264-threads 4 output-file2.avi
I made some changes, and here's a brief explanation:
-f alsa an option to capture sound from an alsa device.
-I hw:1 is an option to capture audio from a "hw:1" device, which is the only audio input device on my computer.
Note: if you want to use a device other than 1 shown in arecord-l, don't forget to replace "1".
Finish the recording and do "Ctrl + C" again.
Step 4: start recording desktop audio
6. If you only want to record audio, use the following command.
The code is as follows:
$avconv-f alsa-I hw:1 out.wav
7. Replace it with .mp3 and other formats supported by Libav, and you can hear your own voice by playing out.wav.
At this point, the study on "how to use avconv for screen recording under Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.