Results 1 to 9 of 9

Thread: a question about ffmpeg and desktop video and sound capture

  1. #1
    Join Date
    Jul 2009
    Location
    CyberspacEastEngland
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    a question about ffmpeg and desktop video and sound capture

    ok trying to get a good video and sound desktop capture with this


    Code:
    ffmpeg -f alsa -ac 2  -ab 128k  -i hw:0,0 -f x11grab -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -r 30 -qscale 1  -i :0.0   -f avi ./Desktop/mydesktop.avi

    and perfect image/video capture but the sound does not play back


    any ideas why not? got some of the ideas from here

    i am using an alpha lexicon box for my sound system-wide on my machine
    Linux is Latin for off-the-beaten-track [◄►] ● Is there Voodoo in the machine?
    ShanArt ● Mark as SolvedXmms

  2. #2
    Join Date
    Jul 2006
    Location
    Lancashire
    Beans
    Hidden!
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: a question about ffmpeg and desktop video and sound capture

    Hi
    The tutorial that you used only describes how to capture video.
    There's a better tutorial here:-http://ubuntuforums.org/showthread.php?t=1392026
    It captures raw video and pcm audio which is very easy to convert afterwards.
    It works OK for me.
    You'll probably get support there if you need help.

  3. #3
    Join Date
    Jul 2009
    Location
    CyberspacEastEngland
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: a question about ffmpeg and desktop video and sound capture

    Quote Originally Posted by ron999 View Post
    Hi
    The tutorial that you used only describes how to capture video.
    There's a better tutorial here:-http://ubuntuforums.org/showthread.php?t=1392026
    It captures raw video and pcm audio which is very easy to convert afterwards.
    It works OK for me.
    You'll probably get support there if you need help.

    cheers Ron will check that


    it really works it is a great guide/tip

    i modified it slightly so it leaves the recorded video file on desktop



    Code:
    ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1024x768 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 ./Desktop/mydesktop.mkv
    Last edited by shantiq; September 28th, 2010 at 11:26 AM.
    Linux is Latin for off-the-beaten-track [◄►] ● Is there Voodoo in the machine?
    ShanArt ● Mark as SolvedXmms

  4. #4
    Join Date
    Jul 2009
    Location
    CyberspacEastEngland
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: a question about ffmpeg and desktop video and sound capture

    and for a good webcam plus voice grab



    with help from Verb


    i use this which really roks too


    Code:
    ffmpeg -f alsa -ac 2 -i pulse  -f video4linux2 -i /dev/video0 -acodec pcm_s16le  -vpre lossless_ultrafast -threads 0 -s 320x240   -r 30    ./Desktop/mywebcam.avi
    AND just record your voice with a microphone to a wave file


    Code:
    ffmpeg -f alsa -ac 2 -i pulse   -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0  -y  ./Desktop/myVOICE.wav
    Last edited by shantiq; October 1st, 2010 at 01:35 PM.
    Linux is Latin for off-the-beaten-track [◄►] ● Is there Voodoo in the machine?
    ShanArt ● Mark as SolvedXmms

  5. #5
    Join Date
    Jul 2009
    Location
    CyberspacEastEngland
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: a question about ffmpeg and desktop video and sound capture

    AND just record your voice with a microphone to an alac file


    Code:
    ffmpeg -f alsa -ac 2 -i pulse -acodec alac  -y ./Desktop/RecordingMYvoice.m4a


    to flac


    Code:
    ffmpeg -f alsa -ac 2 -i pulse -acodec flac  -y ./Desktop/RecordingMYvoice.flac

    to aac


    Code:
    ffmpeg -f alsa -ac 2 -i pulse -acodec aac -strict experimental -ab 399k  -y ./Desktop/RecordingMYvoice.aac
    Linux is Latin for off-the-beaten-track [◄►] ● Is there Voodoo in the machine?
    ShanArt ● Mark as SolvedXmms

  6. #6
    Join Date
    Jul 2009
    Location
    CyberspacEastEngland
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: a question about ffmpeg and desktop video and sound capture

    ---deleted---
    Last edited by shantiq; January 30th, 2011 at 01:29 PM.
    Linux is Latin for off-the-beaten-track [◄►] ● Is there Voodoo in the machine?
    ShanArt ● Mark as SolvedXmms

  7. #7
    Join Date
    Jul 2009
    Location
    CyberspacEastEngland
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: a question about ffmpeg and desktop video and sound capture

    also if you wish for an HD 1080p grab of desktop + microphone recording


    having made sure your system/nvidia settings are set on 1920x1080

    ie system/admin/nvdia X server settings /resolution/pick 1920/apply



    run

    Code:
    ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 35 -s hd1080 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0   -y  ./Desktop/Mydesktop.mkv
    Last edited by shantiq; January 30th, 2011 at 02:16 PM.
    Linux is Latin for off-the-beaten-track [◄►] ● Is there Voodoo in the machine?
    ShanArt ● Mark as SolvedXmms

  8. #8
    Join Date
    Jul 2009
    Location
    CyberspacEastEngland
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: a question about ffmpeg and desktop video and sound capture

    if you want to grab your desktop and desktop sound (music/video) instead

    use the same code line

    Code:
    ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1280x1024 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0   -y ./Desktop/mydesktop.mkv

    but to make sure your mike is not picked up instead you need to do this



    + Q: How can I control PulseAudio input? (e.g. capture application audio instead of mic)
    A: Install “pavucontrol“. Start recording with ffmpeg. Start pavucontrol. Go to the “Recording” tab and you’ll find ffmpeg listed there. Change audio capture from “Internal Audio Analog Stereo” to “Monitor of Internal Audio Analog Stereo“.
    Now it should record system and application audio instead of microphone.

    Code:
    sudo apt-get install pavucontrol
    from verb
    Linux is Latin for off-the-beaten-track [◄►] ● Is there Voodoo in the machine?
    ShanArt ● Mark as SolvedXmms

  9. #9
    Join Date
    Aug 2008
    Beans
    67

    Re: a question about ffmpeg and desktop video and sound capture

    I used f.e. this command

    Code:
    ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1024x768 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 1.mkv
    But I've got audio delay in recorded video in about 2sec. What I have to put in this command that audio delay disappeared?
    Last edited by rulet; October 1st, 2011 at 09:02 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •