Linux'ta Skype görüntülü aramaları nasıl kaydedilir?


28

Skype ile kaydedilmiş video röportajları yapmak istiyorum ve bunu gerçekleştirmek için güvenilir bir araç arıyorum.

Dışarıda yavaş ya da arabası olmayan bir şey var mı?

(K) Ubuntu'yu çalıştırıyorum.


gtk-recordmydesktop denedin mi? onunla her şeyi kaydedebilirim. ffmpeg -i x11grab da çalışıyor. Ses alsa-loop'un çalışmasında sorun yaşıyorsanız.
RobotHumans

Askubuntu.com'da sormayı deneyin .
Adam Byrtek

Yanıtlar:


11

İstediğiniz ekranın herhangi bir bölümünü kaydedebileceğiniz bir http://recordmydesktop.sourceforge.net/about.php yazılımı olan recordMyDesktop yazılımı bulunmaktadır . Skype oturumlarımı kaydetmek için kullanıyorum.

sudo apt-get install recordmydesktop

Ana kanallardan yüklemek için


Bir kulaklık takarken bunu kullandım ve diğer tarafın sesini kaydetti. Sanırım varsayılan mikrofondan ses kaydı yapıyordu (bu yüzden diğer tarafımdan değil kendi sesimi çekiyordu). Nasıl düzeltileceği hakkında bir fikrin var mı?
Marcus Junius Brutus,

11

Bu komut tam masaüstünüzü yakalayacaktır: Bu yüzden, skype sohbeti (veya başka bir şeyi) kaydetmek istediğinizde bu komutu kullanın

ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /tmp/out.mpg   

1
Teşekkürler! Web kameramın penceresi ve diğer kişinin penceresi gibi yalnızca belirli pencereleri nasıl kaydederim? Belki de düzenlemeyi kolaylaştırmak için ayrı ayrı nasıl kaydedileceği bile.
curiousguy

1
@curiousguy, recordmydesktop ile belirli bir pencereyi kaydetmek için, pencere kimliğini almak için "xwininfo" kullanın, ardından recordmydesktop ile "--windowid" parametresini kullanın. Pencerenizi belirli bir boyuta (piksel cinsinden) ölçeklendirmek istiyorsanız bunu yapmanın farklı yolları vardır - Compiz'in bunu bir seçenek olarak kullandığına inanıyorum, ayrıca Openbox size pencere boyutlarını da söyleyecektir. (Fedora kullanıyorum.) Ayrıca Openbox'ın bir pencereyi "temizlemenize" izin vereceğine inanıyorum, recordmydesktop pencere sınırınızı kaydediyorsa yararlıdır. Ancak, bu ffmpeg ile mümkün olup olmadığından emin değilim?
PJ Brunet

Bir kişi ubuntu altında etkin olan x11grab ile nasıl derlenir? Hangi pakete ihtiyacı var?
v010dya,

8

Arka fon

Bir arama sırasında (veya herhangi bir X11 masaüstü etkinliği sırasında) canlı video ve ses kaydı ffmpeg ve mevcut yardım makalelerinin miktarı (bu site dahil) sayesinde çok zor değildir. Bununla birlikte, daha yüksek kaliteyi hedefliyorsanız, eşzamanlı medya kapma ve sıkıştırmanın basit yaklaşım sınırlarına hızla erişeceksiniz. Bu nedenle, aşağıdakileri mümkün kılacak bir alete (veya bir aletlere) ihtiyaç:

  1. Aramaları daha fazla işlenmek üzere bir dosyaya sıkıştırmaksızın kaydedin, bir telefonu ararken yalnızca sesle ilgilendiğimizi kabul ederek.
  2. Kaydedilen aramaları daha sonra yüksek kalitede sıkıştırın.

Aşağıdaki Bash komut dosyaları ( myrec, myrec-novideove myproc) bu görevdeki girişimlerim. Eminim bu senaryoları yazmanın daha iyi yolları vardır, ama halindeyken Bash komut dosyası yazmayı öğreniyordum (işe koyulduktan sonra ekleyebileceğim büyük bir memnuniyetle).

Ön şartlar

  1. ffmpeg
  2. pulseaudio
  3. skype

Eğer 1ya 2da sistemde mevcut değildir, tercih paket yöneticisi ile yüklediği (kullandığım synaptic). İçin skypeziyaret www.skype.com .


Kayıpsız video ve kayıpsız ses kaydı yapın - myrec

  1. Bir metin dosyası oluşturun
  2. Farklı kaydet myrec(ya da senin için çalışan isim)
  3. myrecKomutu yayınlayarak çalıştırılabilir olun :chmod +x myrec
  4. Aşağıdaki kodu yapıştırın ve User settingskurulumunuza uyacak şekilde bölümü değiştirin :

#!/bin/bash

echo "Record lossless audio and lossless video for further processing."
echo "Created file name always starts with temp_YYYYMMDD_HHMMSS."
echo "Syntax:"
echo "myrec [optional file description]"
echo "Optional file description is appended to the file name, with spaces replaced by underscores."
echo
echo

### User settings - adjust values to suit your system and needs

# I used to have the name of my webcam mic here, but that stopped working after a system update. "default" was the only fix I found. If you have more than one microphone connected, you may need to tell Pulseaudio which mic you want to be the default, I think pavucontrol is the utility for it.
# If you want to try supplying a name here, run pacmd, then within it the command list-sources will give you a list of possible microphones. Use the name field value without angle brackets.
microphone_audio_device="default"

# Run pacmd, within it the command list-sinks will give you a list of devices to choose from. Use the name field value without angle brackets.
speakers_audio_device="alsa_output.pci-0000_00_1b.0.analog-stereo.monitor"

# Select frame size.
# Some standard frame sizes for reference:
# wvga 852x480
# wxga 1366x768
# wsxga 1600x1024
# wuxga 1920x1200
# woxga 2560x1600
# wqsxga 3200x2048
# wquxga 3840x2400
# whsxga 6400x4096
# whuxga 7680x4800
frame_size="wsxga"

# Framerate in frames per second
framerate="30"

# Indicate which screen the video should be recorded from and an optional offset.
# For example:
# :0.0+10,20
# where 0.0 is display.screen number of your X11 server, same as the DISPLAY environment variable. 10 is the x-offset and 20 the y-offset of the frame, measured from the top left corner of the screen to the top left corner of the frame.
frame_position=":0.0"

# Include the trailing slash after target directory name.
# Expect a very large file!
target_directory="/target/directory/name/"

### End of user settings



record_command="ffmpeg -f pulse -thread_queue_size 512k -i $speakers_audio_device -f pulse -thread_queue_size 512k -i $microphone_audio_device -f x11grab -s $frame_size -r $framerate -thread_queue_size 512k -i $frame_position -map 0 -map 1 -map 2 -codec:a copy -codec:v libx264 -qp 0 -preset ultrafast"
temporary_file_prefix="temp_"

# The IFS (Internal Field Separator) system variable stores the character that separates command line arguments.
# We can use it to replace spaces with underscores.
temp=$IFS
IFS='_'
description="$*"
IFS=$temp

if [ $# -eq 0 ]; then
  $record_command $target_directory$temporary_file_prefix`date +%Y%m%d_%H%M%S`.mkv
else
  $record_command $target_directory$temporary_file_prefix`date +%Y%m%d_%H%M%S`_$description.mkv
fi

Ses kaydetme yalnızca aşağıdaki bölümde ayrı bir komut dosyası tarafından gerçekleştirilir.


Sadece kayıpsız ses kaydı yap - myrec-novideo

  1. Bir metin dosyası oluşturun
  2. Farklı kaydet myrec-novideo(ya da senin için çalışan isim)
  3. myrec-novideoKomutu yayınlayarak çalıştırılabilir olun :chmod +x myrec-novideo
  4. Aşağıdaki kodu yapıştırın ve User settingskurulumunuza uyacak şekilde bölümü değiştirin :

#!/bin/bash

echo "Record lossless audio for further processing."
echo "Created file name always starts with temp_YYYYMMDD_HHMMSS."
echo "Syntax:"
echo "myrec-novideo [optional file description]"
echo "Optional file description is appended to the file name, with spaces replaced by underscores."
echo
echo


### User settings - adjust values to suit your system

# I used to have the name of my webcam mic here, but that stopped working after a system update. "default" was the only fix I found. If you have more than one microphone connected, you may need to tell Pulseaudio which mic you want to be the default, I think pavucontrol is the utility for it.
# If you want to try supplying a name here, run pacmd, then within it the command list-sources will give you a list of possible microphones. Use the name field value without angle brackets.
microphone_audio_device="default"

# Run pacmd, within it the command list-sinks will give you a list of devices to choose from. Use the name field value without angle brackets.
speakers_audio_device="alsa_output.pci-0000_00_1b.0.analog-stereo.monitor"

# Include the trailing slash after target directory name.
# Expect a large file!
target_directory="/target/directory/name/"

### End of user settings



record_command="ffmpeg -f pulse -thread_queue_size 512k -i $speakers_audio_device -f pulse -thread_queue_size 512k -i $microphone_audio_device -map 0 -map 1 -codec:a copy -codec:a copy"
temporary_file_prefix="temp_"

# The IFS (Internal Field Separator) system variable stores the character that separates command line arguments.
# We can use it to replace spaces with underscores.
temp=$IFS
IFS='_'
description="$*"
IFS=$temp

if [ $# -eq 0 ]; then
  $record_command $target_directory$temporary_file_prefix`date +%Y%m%d_%H%M%S`.mkv
else
  $record_command $target_directory$temporary_file_prefix`date +%Y%m%d_%H%M%S`_$description.mkv
fi


Kayıtlı dosyaları işle - myproc

  1. Bir metin dosyası oluşturun
  2. Farklı kaydet myproc(ya da senin için çalışan isim)
  3. myprocKomutu yayınlayarak çalıştırılabilir olun :chmod +x myproc
  4. Aşağıdaki kodu yapıştırın ve User settingskurulumunuza uyacak şekilde bölümü değiştirin :


#!/bin/bash

echo "Compress files recorded with myrec or myrec-novideo."
echo "For files to be processed they need to reside in the storage directory and start with temp_"
echo "The two audio tracks (mic and speakers) are mixed together into one new stream, but they are also available as separate tracks in the final file."

# Mixing is because players I know cannot play two audio tracks from the same file simultaneously.
# The mic also captures sounds produced by the speakers. It has two effects:
# 1. You can use this single track to hear both yourself (the mic) and whatever came out of your speakers. Personally I did not like the degraded quality of recorded speaker sounds, hence the direct recording off the sound card and mixing that with the mic track.
# 2. Speaker sounds recorded by the mic are slightly delayed when compared to the direct recording off the sound card. The mixed track is thus hard to listen to.
# I do have echo cancellation module loaded in Pulseaudio, perhaps there is something wrong with my configuration?

### User settings

# Indicate storage directory without the trailing slash
storage_directory="/storage/directory/name"

### End of user settings

# Any temp_ file may contain 3 streams (audio, audio, video) indexed as (0, 1, 2), or just 2 streams (audio, audio) indexed as (0, 1).
# A file temp2_ contains just one stream: both audio streams from temp_ mixed.
# The step with temp2_ is necessary as the mixing option (-filter_complex) is a global option (i.e. not stream-specific). Attempts at doing it all in one go prevent the separate tracks from being copied into the final file.

for f in $storage_directory/temp_*
do
  if [ -e ${f/temp_/} ]
  then
    # Do not overwrite an existing final file. Prevents unnecessary work when the script is run regularly as a cron job.
    echo "$f: A final file (without temp_) already exists. Skipping. If you want to reencode, please delete the final file manually."
  else
    # Variable g will contain the name of the second temporary file with both audio streams mixed into one.
    g=${f/temp_/temp2_}

    # Mixing mic and sound card tracks into one stream
    ffmpeg -i "$f" -map 0:0 -map 0:1 -filter_complex amix=inputs=2:duration=longest:dropout_transition=2 -codec:a libvorbis -n "$g"

    # Create the final file: copy the mixed audio stream from temp2_, add and compress both separate audio streams from temp_, compress at high quality the video stream from temp_.
    # The question mark in -map 0:2? tells ffmpeg to ignore the error if this stream (video) is missing. Allows this same script to be used for audio-only recordings.
    ffmpeg -i "$f" -i "$g" -map 1:0 -map 0:0 -map 0:1 -map 0:2? -codec:a:0 copy -codec:a:1 libvorbis -codec:a:2 libvorbis -codec:v libx264 -qp 18 -preset slow -threads 0 -n "${g/temp2_/}"

    # Delete temp2_
    rm "$g"
  fi
done


ffmpegEsnekliği sayesinde myproc, video akışını içerebilen veya içermeyen dosyaları işleyebilir.


Scriptler nasıl kullanılır?

  1. Skype'ın video araması penceresinin ekranınızda nerede olacağına karar verin ve pencere boyutunu istediğiniz boyuta ayarlayın. Skype bu pencere ayarını hatırlayacaktır, bu yüzden sadece bir kez yapmanız yeterlidir. Her sonraki aramada, pencere aynı boyutta aynı yerde görünecektir. myrecAyarlarınızı söylemeyi unutmayın . Genel olarak, görüntülü arama penceresini web kameranızın yakınında bir yere koymaya çalışın, böylece diğer taraftaki kişi onları gözünüze baktığınızı düşünme şansına sahip olur.
  2. Bir terminal penceresi açınız. Kayda başlamak istediğinizde aşağıdaki komutu kullanın:

    • ses ve video kaydetmek için: . myrec some description
    • sadece ses kaydetmek için: . myrec-novideo some description

    some descriptionHer iki komut dosyasında da isteğe bağlıdır. TabBazı yazımları kaydetmek üzere komut dosyası adlarını genişletmek için tuşu kullanabilirsiniz . ffmpegkayda tarih ve saatin temp_YYYYMMDD_HHMMSS_some_description.mkvolduğu adlı bir dosyaya kayda başlayacaktır YYYYMMDD_HHMMSS.

  3. Durmaya hazır olduğunuzda kaydın qbulunduğu terminal penceresinde tuşuna basın ffmpeg.
  4. . myprocDosyaları işlemek (sıkıştırmak) için çalıştırın . El ile yapabilir veya cronsiz yokken yapmak için bir iş ayarlayabilirsiniz .
  5. Sıkıştırmanın beklendiği gibi gittiğini doğruladıktan sonra, temp_dosyayı silin .


Sorunlar

  1. Mikrofon adıyla belirtilemiyor, yalnızca özel değeri kullanabilir default. Orada mikrofon adı vardı, ancak bu ayar sistem güncellemesinden sonra çalışmayı durdurdu. Yalnızca kurulumumla sınırlı bir şey olabilir veya ile pulseaudio.
  2. Mic audio, sesimi ve hoparlörlerden gelen sesi içerir. Hoparlörlerden gelen ses, doğrudan ses kartından kaydedilen ses akışının biraz gerisindedir. Pulse'nin yankı iptal modülü yüklü, ancak sanırım sadece kendi ses yankımı iptal etmem gerekiyor. Mesele şu ki, mikrofonun sesi ses kartı sesi ile karıştırıldığında, hafif gecikmenin ortaya çıkan akışı dinlemesini zorlaştırması. Mikrofonun hoparlörlerden sesleri kaydetmesini nasıl önleyebileceği konusunda fikri olan var mı?


Final notları

Umarım bu araçları faydalı bulursunuz. Gelişme ve yorumlarınız için düşüncelerinizi duymak için sabırsızlanıyorum.


2
Vay. Bir hesabınız yoksa bir git hesabı başlatmak ve bu komut dosyalarını orada tutmak isteyebilirsiniz.
RobertL

Sevgili Xavras, tüm kullanıcı ayarlarını düzelttim ve geçici dosya önekini değiştirdim ve saniyeyi dosya formatından çıkardım. Komut dosyasını çalıştırdıktan sonra "... ~ / Desktop / sky_20160506_12-10h.mkv hatası alıyorum: Böyle bir dosya veya dizin yok" Dosyayı önceden oluşturmak veya kök olarak çalıştırmak yardımcı olmuyor. Bu neden olabilir?
superAnnoyingUser 6'16

Merhaba @Student, şimdiye kadar çözmüş olabilirsiniz, ancak yorumunuz hakkında yalnızca bugün bir bildirim aldım. Alıntı yaptığınız hataya bakıldığında, tilde (~) uygun yoldan çözülmediğini düşünüyorum. Yolu, / home / student / gibi, tam formda sunmayı deneyin. Kayıt veya işleme komut dosyasında bu sorunla mı karşılaştınız?
Xavras Wyzryn

4

Open Broadcaster Software (OBS) Studio, tüm bu gereklilikleri kullanımı kolay bir arayüze bağlar.

Açık kaynak ve çapraz platform:

Ubuntu 15.04 ve sonrası için:

sudo add-apt-repository ppa:obsproject/obs-studio
sudo apt-get update && sudo apt-get install obs-studio ffmpeg

Diğer dağıtımlar / önceki Ubuntu sürümleri için git wiki’yi kontrol edin


0

xvidcap masaüstünüzden bir alan seçmenize ve kaydetmenize olanak sağlar. Komutla başla

xvidcap

videonuzu varsayılan olarak ./test-0000.mpeg konumunda bulabilirsiniz.

Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.