Делаем скринкаст (запись видео с экрана) в Linux - IT-C@FE
×
Masterpro Nivo Slider (06 фев 2023)

Это форк Vinaora Nivo Slider, пришлось переименовать, в силу требования JED. Даже старую версию качать можно было только с варезных сайтов, нашпигованную троянами. Зачем оно такое, согласитесь.

Идея Делаем скринкаст (запись видео с экрана) в Linux

Подробнее
11 года 3 нед. назад - 11 года 3 нед. назад #1 от Aleksej
В рамках этой публикации - короткий рассказ о том, как, работая в линуксе, без проблем снять видео с экрана вашего монитора (сделать скринкаст). Прошу прощения за возможные повторы, этот материал не носит характер сенсации и/или некоего новаторства, будучи многократно описан в интернете... но практика показывает, что многие и многие, только еще делающие свои первые шаги в линуксе - и дай бог, как говорится! - по сию пору не слыхали о существовании простейшего этого механизма.

Итак. Заходим в консоль и устанавливаем необходимые нам пакеты (проделывалось все это, в данном случае, в контексте Fedora 17):

# yum install gtk-recordmydesktop h264enc
Загружены модули: langpacks, presto, refresh-packagekit
Разрешение зависимостей
--> Проверка сценария
---> Пакет gtk-recordmydesktop.noarch 0:0.3.8-6.fc17 помечен для установки
--> Обработка зависимостей: recordmydesktop >= 0.3.8 пакета: gtk-recordmydesktop-0.3.8-6.fc17.noarch
---> Пакет h264enc.noarch 1:9.4.6-1.fc17 помечен для установки
--> Проверка сценария
---> Пакет recordmydesktop.i686 0:0.3.8.1-7.fc17 помечен для установки
--> Обработка зависимостей: jack-audio-connection-kit-example-clients пакета: recordmydesktop-0.3.8.1-7.fc17.i686
--> Проверка сценария
---> Пакет jack-audio-connection-kit-example-clients.i686 0:1.9.8-9.fc17 помечен для установки
--> Проверка зависимостей окончена

Зависимости определены

=======================================================================================================
 Package                                       Архитектура
                                                          Версия              Репозиторий        Размер
=======================================================================================================
Установка:
 gtk-recordmydesktop                           noarch     0.3.8-6.fc17        fedora              99 k
 h264enc                                       noarch     1:9.4.6-1.fc17      rpmfusion-free     116 k
Установка зависимостей:
 jack-audio-connection-kit-example-clients     i686       1.9.8-9.fc17        updates            121 k
 recordmydesktop                               i686       0.3.8.1-7.fc17      fedora              61 k

Результат операции
=======================================================================================================
Установка   2 Пакета (+2 Зависимых пакета)

Объем загрузки: 398 k
Объем изменений: 1.3 M
Продолжить? [y/N]: y
Загрузка пакетов:
(1/4): h264enc-9.4.6-1.fc17.noarch.rpm                                          | 116 kB     00:01     
(2/4): gtk-recordmydesktop-0.3.8-6.fc17.noarch.rpm                              |  99 kB     00:02     
(3/4): jack-audio-connection-kit-example-clients-1.9.8-9.fc17.i686.rpm          | 121 kB     00:02     
(4/4): recordmydesktop-0.3.8.1-7.fc17.i686.rpm                                  |  61 kB     00:00     
-------------------------------------------------------------------------------------------------------
Общий размер                                                            76 kB/s | 398 kB     00:05     
Проверка сценария
Проверяем сценарий
Проверка сценария прошла успешно
Выполнение сценария
  Установка   : jack-audio-connection-kit-example-clients-1.9.8-9.fc17.i686                        1/4 
  Установка   : 1:h264enc-9.4.6-1.fc17.noarch                                                      2/4 
  Установка   : recordmydesktop-0.3.8.1-7.fc17.i686                                                3/4 
  Установка   : gtk-recordmydesktop-0.3.8-6.fc17.noarch                                            4/4 
  Проверка    : recordmydesktop-0.3.8.1-7.fc17.i686                                                1/4 
  Проверка    : jack-audio-connection-kit-example-clients-1.9.8-9.fc17.i686                        2/4 
  Проверка    : gtk-recordmydesktop-0.3.8-6.fc17.noarch                                            3/4 
  Проверка    : 1:h264enc-9.4.6-1.fc17.noarch                                                      4/4 

Установлено:
  gtk-recordmydesktop.noarch 0:0.3.8-6.fc17                h264enc.noarch 1:9.4.6-1.fc17               

Установлены зависимости:
  jack-audio-connection-kit-example-clients.i686 0:1.9.8-9.fc17  recordmydesktop.i686 0:0.3.8.1-7.fc17 

Выполнено!

Информацию о том, что же это за страшные пакеты такие... вы легко можете получить по yum info package_name:

$ yum info gtk-recordmydesktop
Загружены модули: langpacks, presto, refresh-packagekit
Установленные пакеты
Название: gtk-recordmydesktop
Архитектура: noarch
Версия: 0.3.8
Выпуск: 6.fc17
Объем: 383 k
Источник: installed
Из источника: fedora
Аннотация: GUI Desktop session recorder with audio and video
Ссылка: http://recordmydesktop.sourceforge.net/
Лицензия: GPLv2+
Описание: Graphical frontend for the recordmydesktop desktop session recorder.
        : 
        : recordMyDesktop is a desktop session recorder for linux that attempts to be
        : easy to use, yet also effective at it's primary task.
        : 
        : As such, the program is separated in two parts; a simple command line tool that
        : performs the basic tasks of capturing and encoding and an interface that
        : exposes the program functionality in a usable way.

$ yum info h264enc
Загружены модули: langpacks, presto, refresh-packagekit
Установленные пакеты
Название: h264enc
Архитектура: noarch
Период: 1
Версия: 9.4.6
Выпуск: 1.fc17
Объем: 458 k
Источник: installed
Из источника: rpmfusion-free
Аннотация: An interactive menu-driven frontend for mencoder
Ссылка: http://h264enc.sourceforge.net/
Лицензия: GPLv2+
Описание: h264enc is an advanced and powerful interactive menu-driven shell
        : script written for the GNU/Linux operating system which can help you
        : to encode a DVD, a video file, a directory with video files or a (S)VCD
        : to the H.264/MPEG-4 Part 10/AVC video format using the MEncoder encoder
        : from the MPlayer project and the libx264 library. It supports muxing
        : the final encode from AVI to Matroska, from AVI to OGM, from AVI to TS
        : and from AVI to the MP4 container.


Все, как видите, несложно... Установив - открываем gtk-recordmydesktop -





и... собственно, записываем. Пишем либо весь экран либо - часть его; русскоязычный и очень незамысловатый интерфейс графической оболочки recordMyDesktop, думаю, проблем в освоении вызвать не должен.

Единственное неудобство - запись у вас получится в неудобоваримом формате ogv... Ничего, сейчас все исправим. Не напрасно же мы с вами устанавливали пакет h264enc !

Открываем консоль и переходим в директорию, где сохранен только что созданный видеофайл. Вводим:

h264enc -2p -p slow -t film -pf high


И - понеслось.

Конвертации предшествует целый ряд вопросов; на которые, за исключением трех - Select the Input type [file/dir/dvd/vcd]: - ответ file, Provide the Input Video File: ответ - имя_конвертируемого_файла и Select the Audio Codec [default is AAC]: ответ NOSOUND - вы можете ответить попросту и не заморачиваясь нажатием клавиши Enter. Таким образом, всего через несколько секунд запускается процесс конвертации:


+=============================================================+
|<<<<<<< h264enc - the interactive shell script ripper >>>>>>>|
|-------------------------------------------------------------|
|<<<<<< version: 9.4.6 - (C) 2006-2012, Grozdan Nikolov >>>>>>|
+=============================================================+


Select the Input type [file/dir/dvd/vcd]: file
Provide the Input Video File: out-3.ogv
Provide a name for the Output File [default is H264-30299]: 

Note that you are running out of disk space in
the destination output directory and/or in the
configuration directory of h264enc!

This could be a problem if you want to convert
the final encode to MKV, OGM, TS or to the MP4
container. It is recommended to free up some disk
space or provide a different destination output
directory before continuing with the encoding
process if you intend to do some of the above
tasks!

Space left over in '/home/aleksej': 2272 MiB
Space left over in '/home/aleksej/.h264enc/job30299': 2272 MiB

#### Press 'Enter' to continue, CTRL+C to exit ####

Scan for multiple video streams? [y/N]: 
Would you like to use Pre/Postprocessing video filters? [y/N]: 
Would you like to Crop the Video file? [y/N]: 
Would you like to include/rip a Subtitle? [y/N]: 

-> Detecting FPS value...
-> Detected 15.000 FPS
-> Number of frames: 1101

Would you like to set/force the Output Frame Rate (FPS)? [y/N]: 

-> Detecting original resolution...
-> Original resolution: 1280x1024

-> Detected Aspect Ratio (AR): 1.2500:1
-> Storage Aspect Ratio (SAR): 1.2500:1
-> Pixel Aspect Ratio (PAR): 1.0000:1
-> Total pixels: 1310720

Specify the desired Resolution [default is 1280x1024]: 
Specify the Expand filter parameters [press 'Enter' to skip]: 
Would you like to set/force the input Video Aspect Ratio? [y/N]: 

+=============================+
| H.264 Encoder Configuration |
+=============================+

Specify the desired Video Bitrate in kbps [default is 1000]: 

-> Bits Per Pixel value: 0.050 bpp
-> Bits Per Block value: 13.020 bpb
-> Using "x264 slow" preset

+=====================+
| Audio Configuration |
+=====================+

Scan for multiple Audio streams? [y/N]: 

Available Audio Codecs
~~~~~~~~~~~~~~~~~~~~~~
MP3 -----> Container support: AVI, MKV, MP4, OGM, TS
AC3 -----> Container support: AVI, MKV, MP4, OGM, TS
DTS -----> Container support: MKV, TS
AAC -----> Container support: MKV, MP4, TS
AAC+ ----> Container support: MP4, MKV
neroAAC -> Container support: MP4, MKV
VORBIS --> Container support: MP4, MKV, OGM
FLAC ----> Container support: MKV
PCM -----> Container support: AVI, MKV, OGM
COPY ----> Container support: Depends on audio codec
NOSOUND -> Container support: AVI, MKV, MP4, OGM, TS

Track 1: Select the Audio Codec [default is AAC]: NOSOUND

+=============================+
| Miscellaneous Configuration |
+=============================+

Would you like to set a target file size? [y/N]: 
Would you like to pass additional options to MEncoder? [y/N]: 
Would you like to inspect the MEncoder options? [y/N]: 
Would you like to encode a Sample? [y/N]: 
Would you like to save the MEncoder options to a file? [y/N]: 
Would you like to convert the final encode from AVI to MKV? [y/N]: 
Would you like to convert the final encode from AVI to MP4? [y/N]: 
Would you like to convert the final encode from AVI to TS? [y/N]: 
Would you like to convert the final encode from AVI to OGM? [y/N]: 

-> Starting to encode the Video file in 2-pass mode
-> Using "x264 slow" preset
-> Using '/dev/null' as output for the first pass
-> Using '/home/aleksej/H264-30299.avi' as output file for the second pass

Starting to encode in: 5 4 3 2 1 
MEncoder SVN-r34652-4.7.0 (C) 2000-2012 MPlayer Team
Option x264encopts: turbo option is deprecated; use slow_firstpass to disable turbo
success: format: 0  data: 0x0 - 0x69efd4
libavformat version 53.32.100 (external)
libavformat file format detected.
[lavf] stream 1: video (theora), -vid 0
[lavf] stream 2: audio (vorbis), -aid 0
VIDEO:  [theo]  1280x1024  0bpp  15.000 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:44  fourcc:0x6F656874  size:1280x1024  fps:15.000  ftime:=0.0667
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [harddup]
Opening video filter: [softskip]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 53.61.100 (external)
Selected video codec: [fftheora] vfm: ffmpeg (FFmpeg Theora)
==========================================================================
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.25:1 - prescaling to correct movie aspect.
[swscaler @ 0x42b50640]using unscaled yuv420p -> yuv420p special converter
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: profile Main, level 3.2
Pos:   0.1s      2f (11%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
[VD_FFMPEG] DRI failure.
Pos:   3.7s     56f (11%) 11.14fps Trem:   0min   0mb  A-V:0.000 [0:0]
Writing header...
ODML: vprp aspect is 16384:13107.
Writing header...
ODML: vprp aspect is 16384:13107.
Pos:  63.4s    951f (100%) 20.68fps Trem:   0min   3mb  A-V:0.000 [422:0]

Flushing video frames.
Writing index...
Writing header...
ODML: vprp aspect is 16384:13107.

Video stream:  487.688 kbit/s  (60960 B/s)  size: 3864927 bytes  63.400 secs  951 frames
x264 [info]: frame I:7     Avg QP: 3.17  size:419717
x264 [info]: frame P:413   Avg QP: 2.41  size:  1876
x264 [info]: frame B:531   Avg QP: 6.41  size:   287
x264 [info]: consecutive B-frames: 20.6% 11.1% 11.0% 57.2%
x264 [info]: mb I  I16..4: 55.8%  0.0% 44.2%
x264 [info]: mb P  I16..4:  0.2%  0.0%  0.0%  P16..4:  3.8%  0.0%  0.0%  0.0%  0.0%    skip:96.1%
x264 [info]: mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.1%  0.0%  0.0%  direct: 0.1%  skip:99.8%  L0:46.5% L1:49.6% BI: 3.9%
x264 [info]: final ratefactor: 1.19
x264 [info]: direct mvs  spatial:83.6% temporal:16.4%
x264 [info]: coded y,uvDC,uvAC intra: 31.8% 16.3% 13.8% inter: 0.7% 0.3% 0.2%
x264 [info]: i16 v,h,dc,p: 74% 26%  0%  0%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 29% 19%  4%  5%  4%  5%  4%  6%
x264 [info]: i8c dc,h,v,p: 69% 25%  5%  1%
x264 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x264 [info]: kb/s:487.69

==============================================================

Starting the second pass of the encoding process in: 5 4 3 2 1 
MEncoder SVN-r34652-4.7.0 (C) 2000-2012 MPlayer Team
success: format: 0  data: 0x0 - 0x69efd4
libavformat version 53.32.100 (external)
libavformat file format detected.
[lavf] stream 1: video (theora), -vid 0
[lavf] stream 2: audio (vorbis), -aid 0
VIDEO:  [theo]  1280x1024  0bpp  15.000 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:44  fourcc:0x6F656874  size:1280x1024  fps:15.000  ftime:=0.0667
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [harddup]
Opening video filter: [softskip]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 53.61.100 (external)
Selected video codec: [fftheora] vfm: ffmpeg (FFmpeg Theora)
==========================================================================
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.25:1 - prescaling to correct movie aspect.
[swscaler @ 0x42b50640]using unscaled yuv420p -> yuv420p special converter
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: profile High, level 4.0
Pos:   0.1s      2f (11%)  0.70fps Trem:   0min   0mb  A-V:0.000 [0:0]
[VD_FFMPEG] DRI failure.
Pos:   0.3s      5f (11%)  1.72fps Trem:   0min   0mb  A-V:0.000 [0:0]
Writing header...
ODML: vprp aspect is 16384:13107.
Writing header...
ODML: vprp aspect is 16384:13107.
Pos:  63.4s    951f (100%)  9.33fps Trem:   0min   6mb  A-V:0.000 [794:0]

Flushing video frames.
Writing index...
Writing header...
ODML: vprp aspect is 16384:13107.

Video stream:  795.089 kbit/s  (99386 B/s)  size: 6301081 bytes  63.400 secs  951 frames
x264 [info]: frame I:7     Avg QP: 0.02  size:484461
x264 [info]: frame P:413   Avg QP: 0.06  size:  5674
x264 [info]: frame B:531   Avg QP: 1.24  size:  1067
x264 [info]: consecutive B-frames: 20.6% 11.1% 11.0% 57.2%
x264 [info]: mb I  I16..4: 60.9%  2.3% 36.7%
x264 [info]: mb P  I16..4:  0.1%  0.0%  0.0%  P16..4: 15.6%  0.0%  0.0%  0.0%  0.0%    skip:84.2%
x264 [info]: mb B  I16..4:  0.1%  0.0%  0.0%  B16..8:  5.5%  0.0%  0.0%  direct: 0.7%  skip:93.7%  L0:81.3% L1:18.4% BI: 0.3%
x264 [info]: 8x8 transform intra:2.1% inter:59.9%
x264 [info]: direct mvs  spatial:83.6% temporal:16.4%
x264 [info]: coded y,uvDC,uvAC intra: 31.5% 15.5% 13.6% inter: 3.6% 0.1% 0.1%
x264 [info]: i16 v,h,dc,p: 61% 35%  3%  1%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 30% 28%  2%  3%  5%  5%  4%  7%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 23% 20%  5%  7%  6%  7%  6% 10%
x264 [info]: i8c dc,h,v,p: 63% 31%  5%  2%
x264 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x264 [info]: ref P L0: 98.4%  0.0%  1.1%  0.2%  0.2%  0.1%
x264 [info]: ref B L0: 97.3%  1.9%  0.5%  0.2%
x264 [info]: ref B L1: 98.9%  1.1%
x264 [info]: kb/s:795.09

-> AVI file size: 6.035 MiB (/home/aleksej/H264-30299.avi)

-> Have a nice day ^_^



В итоге вы получите доброе напоследок пожелание проги - Have a nice day ^_^
- и отконвертированное видео в образе гораздо более дружелюбного файла с расширением avi: H264-30299.avi.

Have a nice day! :)
Последнее редактирование: 11 года 3 нед. назад пользователем Aleksej.

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

Подробнее
8 года 6 мес. назад - 8 года 6 мес. назад #2 от serge
И еще один отличный способ сделать скринкаст в линуксе - по ссылке .

А я смогу! - А поглядим! - А я упрямый!
Последнее редактирование: 8 года 6 мес. назад пользователем serge.

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

Работает на Kunena форум