Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: FFmpeg and x11grab?

  1. #11
    Join Date
    Dec 2006
    Beans
    7,231

    Re: FFmpeg and x11grab?

    Hi bgiannes,

    Quote Originally Posted by bgiannes View Post
    1) i just used the command from your post

    Code:
    ffmpeg -y -t 30 -f x11grab -qscale 2 -r 15 -s 1024x768 -i :0.0 \
    -s 800x600 -vcodec libx264 -vpre hq -crf 22 -threads 0 x11grab.mp4
    i've tryed change things around a bit but same result
    I hope that I have not introduced confusion again by using the '\' character to produce a line break . The full command is of course:

    Code:
    ffmpeg -y -t 30 -f x11grab -qscale 2 -r 15 -s 1024x768 -i :0.0 -s 800x600 -vcodec libx264 -vpre hq -crf 22 -threads 0 x11grab.mp4
    all on one line. I don't believe you actually need to place -qscale 2 for the input file as it uses raw video. Can I suggest another thread that went way beyond my own meagre skills with x11grab as Nixie Pixel develops a much more sophisticated commandline:

    gtk-recordmydesktop + compiz cube effects = severe tearing
    http://ubuntuforums.org/showthread.php?t=1179861

    Towards the end of this thread Nixie demonstrates a quite advanced syntax that works quite well. As regards including sound I have consistently failed to add this to the screen capture. Still waiting for the Fakeoutdoorsman to sort it all out and write a guide .

    Andrew
    You think that's air you're breathing now?

  2. #12
    Join Date
    Jun 2007
    Beans
    14,450

    Re: FFmpeg and x11grab?

    by using the '\' character to produce a line break
    Actually the \ seems to always work fine, the exception being in that mplayer command (for whatever reason, maybe because it followed a valid command ...?

  3. #13
    Join Date
    Apr 2008
    Location
    CA, US
    Beans
    119
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: FFmpeg and x11grab?

    i had read that thread, but as i can't get x11grab working i havn't really been trying to jazz up the syntax

    ffmpeg -y -t 60 -r 25 -s 1920x1200 -f x11grab -i :0.0 out.avi

    should work out of the box.


    ps recordmydesktop w/ sound does work, but i need to reset the sound source each time i run it. The problem is that the volume is v low

    i can convert the ovg file and turn up the vol but the qulity is just pain bad.


    i'm sure i can get audio... you guys try somthing like this... (with the "capture" sound selected & un-muted and at max vol in the mixer gui)

    arecord -D default -t raw -c 1 -f S16_LE -r 48000 - | ffmpeg -f s16le -ab 128k -ar 48000 -i - -acodec libmp3lame -vn soundtestcapture.avi

    then x11 w/ this
    arecord -D default -t raw -c 1 -f S16_LE -r 48000 - | ffmpeg -f s16le -ab 128k -ar 48000 -ac 1 -i - -acodec libmp3lame -t 5 -f x11grab -r 25 -s 800x600 -i :0.0 -vcodec libvid capture.avi

    ps
    i rebuilt ffmpeg but x11grab is still broken, i just saw that there is a nvidia driver update, i'm going to try it tonight, but other capture programs have no problems with x11. Maybe i'm have a build error with X11grab?
    Last edited by bgiannes; July 9th, 2009 at 07:26 PM.

  4. #14
    Join Date
    Dec 2006
    Beans
    7,231

    Re: FFmpeg and x11grab?

    Hi bgiannes,

    Quote Originally Posted by bgiannes View Post

    Code:
    ffmpeg -y -t 60 -r 25 -s 1920x1200 -f x11grab -i :0.0 out.avi
    should work out of the box.
    Indeed it should and it certainly does on my own system. Are you building FFmpeg from svn? Best way to do this is From Fakeoutdoorsman's guide:

    HOWTO: Install and use the latest FFmpeg and x264
    http://ubuntuforums.org/showthread.php?t=786095

    This guide now incorporates the necessary options for x11grab.

    Andrew
    You think that's air you're breathing now?

  5. #15
    Join Date
    Apr 2008
    Location
    CA, US
    Beans
    119
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: FFmpeg and x11grab?

    Quote Originally Posted by andrew.46 View Post
    Hi bgiannes,



    Indeed it should and it certainly does on my own system. Are you building FFmpeg from svn? Best way to do this is From Fakeoutdoorsman's guide:

    HOWTO: Install and use the latest FFmpeg and x264
    http://ubuntuforums.org/showthread.php?t=786095

    This guide now incorporates the necessary options for x11grab.

    Andrew

    i do my builds from there, i had to do a

    sudo aptitude install libice-dev libsm-dev libx11-dev libxext-dev libxi-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxt-dev libxtrap-dev libxtst-dev libxv-dev x-dev zlib1g-dev

    and then the build and i'm good, now for the syntax....

  6. #16
    Join Date
    Apr 2008
    Location
    CA, US
    Beans
    119
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: FFmpeg and x11grab?

    ffmpeg -s 1920x1080 -r 25 -f x11grab -i :0.0 -f oss -i /dev/dsp out.avi
    works but the sound volume is low a v bad quality, the fram rate is v low as well?

  7. #17
    Join Date
    Dec 2006
    Beans
    7,231

    Re: FFmpeg and x11grab?

    Hi bgiannes,

    Quote Originally Posted by bgiannes View Post
    works but the sound volume is low a v bad quality, the fram rate is v low as well?
    I am a little jealous as you have succeeded where I have failed . When you use x11grab the default input streams will be:

    Code:
    Stream #0.0: Video: rawvideo, bgra, 800x600, 384000 kb/s, 25 tbr, 1000k tbn, 25 tbc
    Stream #1.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
    but the trick is to manipulate the output. When you simply specify .avi you will be given the FFmpeg defaults of low quality mpeg4 video and low quality mp2 sound, and the results are a little disappointing as you have seen. So the question has always been what are the best settings for the output sound and video. Video has been discussed in great depth in Nixie's thread for sound I guess you could try a reasonable mp3 sound to start with:

    Code:
    -acodec libmp3lame -ab 128k
    and that would at least provide a start although you limit yourself a little with the avi container, possibilities are greater with .mp4 or .mkv.

    All the best,

    Andrew

    Andrew
    You think that's air you're breathing now?

  8. #18
    Join Date
    May 2009
    Location
    Gelsenkirchen, Germany
    Beans
    113

    Re: FFmpeg and x11grab?

    Quote Originally Posted by bgiannes View Post
    i'm sure i can get audio... you guys try somthing like this... (with the "capture" sound selected & un-muted and at max vol in the mixer gui)

    arecord -D default -t raw -c 1 -f S16_LE -r 48000 - | ffmpeg -f s16le -ab 128k -ar 48000 -i - -acodec libmp3lame -vn soundtestcapture.avi

    then x11 w/ this
    arecord -D default -t raw -c 1 -f S16_LE -r 48000 - | ffmpeg -f s16le -ab 128k -ar 48000 -ac 1 -i - -acodec libmp3lame -t 5 -f x11grab -r 25 -s 800x600 -i :0.0 -vcodec libvid capture.avi
    If I type in:
    Code:
    ffmpeg -f alsa -i plughw:0 -f x11grab -s 1440x900 -r 24 -b 100k -bf 2 -g 300 -i :0.0 -ar 22050 -ab 128k -acodec libmp3lame -vcodec libxvid -aspect 1.6 -sameq MyScreencast.avi
    ...it records my Screen and captures sound via built-in microphone.
    Possibly, you need to change the screen size (mine is 1440x900) and the alsa device (for me, plughw:0 is good)


    To stop recording, just hit "q".

  9. #19
    Join Date
    Nov 2008
    Location
    San Francisco, California
    Beans
    389
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: FFmpeg and x11grab?

    Quote Originally Posted by andrew.46 View Post
    Towards the end of this thread Nixie demonstrates a quite advanced syntax that works quite well. As regards including sound I have consistently failed to add this to the screen capture. Still waiting for the Fakeoutdoorsman to sort it all out and write a guide .

    Andrew
    Hah, I never saw this. Thank you for your kind words, but I just pasted together stuff from the suggestions of #ffmpeg members, especially Dark Shikari, based on your original command. You're the expert here!

    Trust me, I don't have the knowledge to come up with "advanced syntax" on my own!

  10. #20
    Join Date
    Feb 2009
    Beans
    124

    Re: FFmpeg and x11grab?

    Quote Originally Posted by produnis View Post
    If I type in:
    Code:
    ffmpeg -f alsa -i plughw:0 -f x11grab -s 1440x900 -r 24 -b 100k -bf 2 -g 300 -i :0.0 -ar 22050 -ab 128k -acodec libmp3lame -vcodec libxvid -aspect 1.6 -sameq MyScreencast.avi
    ...it records my Screen and captures sound via built-in microphone.
    Possibly, you need to change the screen size (mine is 1440x900) and the alsa device (for me, plughw:0 is good)


    To stop recording, just hit "q".
    Code:
    ffmpeg -f alsa -i plughw:0 -f x11grab -s 1920x1080 -r 24 -b 100k -bf 2 -g 300 -i :0.0 -ar 22050 -ab 128k -acodec libmp3lame -vcodec libxvid -aspect 1.77777778 -sameq MyScreencast.avi
    using the above command gives me very low fps around 5 i guess.

    Using the opensource Ati drivers for HD4200

Page 2 of 3 FirstFirst 123 LastLast

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
  •