zoukankan      html  css  js  c++  java
  • How to Record Your Desktop Using FFmpeg on Ubuntu Linux

    FFmpeg is a free software project that produces libraries and programs for handling multimedia data. This tutorial will cover the installation and usage of FFmpeg to record your desktop on Ubuntu Linux. Each individuals results may vary depending on your system configuration.

    Steps

    1. 1
      Check and see if you have FFmpeg installed on your system, by issuing the following commands below if you don't you can install FFmpeg by using the following code. Open up a terminal and enter the following commands below.
      • Type/Copy/Paste: sudo apt-get install synaptic
      • Type/Copy/Paste: sudo apt-get update
        • This command updates the package repositories on your system
      • Type/Copy/Paste: ffmpeg -version
        • This command checks to see if FFmpeg is install on your system
      • Type/Copy/Paste: sudo -s apt-get install ffmpeg
        • This command installs FFmpeg on your system
      • Type/Copy/Paste: cd /home/”your_user_name”/Videos
        • This will change you into your Videos directory, so you can record and keep all your Video files in this directory.
    2. 2
      Before you begin recording your desktop, make sure your microphone is turned on and the volume is turned up. The following commands will record the full desktop video and sound in the video formats provided below.
    3. 3
      To record a video/audio file in MPG format, use the following command in the terminal line:
      • Type/Copy/Paste: ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -r 25 -i :0.0 -vcodec mpeg2video -ar 44100 -s wvga -y -sameq sample.mpg
    4. 4
      To record a video/audio file in ASF/WMV Microsoft format, use the following command in the terminal line:
      • Type/Copy/Paste: ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -r 10 -i :0.0 -sameq -f asf -ar 48000 -s wvga -y sample.asf
      • or
      • Type/Copy/Paste: ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -r 10 -i :0.0 -sameq -f asf -ar 48000 -s wvga -y sample.wmv
    5. 5
      To record a video/audio file in AVI format, use the following command in the terminal line:
      • Type/Copy/Paste: ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -r 25 -i :0.0 -sameq -f mpeg -ar 48000 -s wvga -y sample.avi
    6. 6
      To record a video/audio file in FLV format, use the following command in the terminal line:
      • Type/Copy/Paste: ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -r 10 -i :0.0 -sameq -f flv -ar 44100 -s wvga -y sample.flv
    7. 7
      To record a video/audio file in MP4 format, use the following command in the terminal line:
      • Type/Copy/Paste: ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -r 25 -i :0.0 -sameq -f mpeg -ar 48000 -s wvga -y sample.mp4
    8. 8
      Press q for quit or Control-C to stop the desktop recording process at anytime.
    9. 9
      To convert different file formats
      • Type/Copy/Paste: ffmpeg -i "insert_multimedia_file" -target pal-dvd -ps 2000000000 -aspect 16:9 "insert_multimedia_file"
      • For example, to convert an avi file to a mpeg file, for dvd players
        • Type/Copy/Paste: ffmpeg -i sample.avi -target pal-dvd -ps 2000000000 -aspect 16:9 sample.mpeg
    10. 10
      Use a multimedia player such as VLC multimedia player or Totem multimedia player to view and playback your recorded desktop videos with sound. You should be able to install VLC or Totem multimedia players by using the following commands.
      • Type/Copy/Paste: sudo apt-get update
      • Type/Copy/Paste: sudo -s apt-get install vlc
      • Type/Copy/Paste: sudo -s apt-get install totem
  • 相关阅读:
    [Golang学习笔记] 06 程序实体3 类型断言和类型转换
    [Golang学习笔记] 05 程序实体2 作用域访问权限和变量重声明
    [Golang学习笔记] 04 程序实体1 变量声明
    [Golang学习笔记] 03 库源码文件
    virgo-tomcat-server的生产环境线上配置与管理
    virgo-tomcat-server最大并发连接数的修改
    linux系统下kvm虚拟机的安装
    关于virgo-tomcat-server-3.6.0.RELEASE配置文件修改说明
    关于在Linux下apache-maven的安装
    H3C系列之三层交换机文件管理
  • 原文地址:https://www.cnblogs.com/benhuan/p/3302106.html
Copyright © 2011-2022 走看看