Page 23 of 25 FirstFirst ... 132122232425 LastLast
Results 221 to 230 of 246

Thread: HOWTO: Proper Screencasting on Linux

  1. #221
    Join Date
    Mar 2013
    Beans
    5

    Re: HOWTO: Proper Screencasting on Linux

    Okay, well, I seem to have fixed it for now. Though I'm not entirely sure what did it. I setup a loopback with snd-aloop instead of using a null sink in pulse. I then tried to record from that via "-f alsa -i hw:3,1". That worked, and the audio was being recorded at the correct rate, but it still wasn't good. On the old avconv from the ubuntu repo, I received a single "Alsa buffer xrun" error at the beginning of the recording, and from that point onward my audio was exactly two seconds ahead of my audio. On both the ffmpeg and avconv compiled from source, I had many more of those errors. I then added several libraries via apt-get and the ubuntu repository: libxvidcore-dev, libx264-dev, x264, libffms2-2. I know all of you are likely using versions of those compiled from source, as that is what the ffmpeg guide posted here said to do. After a while I tried just using "-f alsa -i pulse" again but with the new alsa loopback, and that worked better. I thought during my 1.5 hour recording that I was using the avconv version that I compiled, but I was actually using the old version from the repo. Both of my compiled versions seem to not run very well, but that's likely because I'm not using the most recent versions of some libraries. I have no idea.

    My steps to get this working were (without the braces):
    Code:
    $sudo modprobe snd-aloop
    I think pulseaudio should recognize the new "card" immediately, though you may need to --kill and --start it.
    Code:
    $pactl load-module module-combine-sink slaves=[my actual soundcard's sink name],[the loopback's sink name]
    $pactl load-module module-loopback sink=[loopback sink name] source=[pulse's source name for my microphone]
    I then used pavucontrol to mix the audio streams. Any application you want to capture audio from, you tell it to use the combined sink. Anything you don't want to be captured you just send straight to your own sound card.

    I then used the following command to actually record:
    Code:
    $avconv -f x11grab -r 30 -s hd1080 -i :0.0 -f alsa -i pulse -s hd720 -acodec libmp3lame -b 1024k -vcodec libx264 -ar 44100 /tmp/cake.mp4
    In theory it should work as well to use "-f pulse -i [loopback's pulse name]".

    I'm not really entirely sure if it was the alsa loopback, or the libraries I added/updated, but it seems to be holding for now, and pulse is too temperamental for me to try prodding at it until it breaks again.

    Edit: I don't believe it was the libraries, as I was previously having issues even recording .wavs, and none of those video codec updates should have affected that at all.

    I realize what I did was extremely sloppy, but it seems to work for me, so I'm just posting it here. I also realize what I did may not actually help anyone since you're all using ffmpeg, but it may, and the commands are the exact same aside from replacing avconv with ffmpeg.

    Tomorrow I'll try testing to see what exactly I did helped solve the issue.
    Last edited by Jacob Mischka; March 19th, 2013 at 10:06 AM.

  2. #222
    Join Date
    Mar 2009
    Location
    Jipijapa/Manabí/Ecuador
    Beans
    10
    Distro
    Ubuntu

    Re: HOWTO: Proper Screencasting on Linux

    Thanks ron999, working fine for me on UbuntuStudio 13.04, great thanks, your solution my problem.

    This is that working now:

    ffmpeg -f alsa -i pulse -f x11grab -r 25 -s 1600x900 -i :0.0 -acodec flac -vcodec libx264 -vpre lossless_ultrafast -threads 0 out01.mkv

    (Mi Laptop is Dell Inspiron 1750 with a monitor of 1600x900)
    Good Job

  3. #223
    Join Date
    Feb 2008
    Beans
    53
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: HOWTO: Proper Screencasting on Linux

    I am having trouble with the playback of my files. They work fine on my computer using smplayer, but others that view them are having troubles.
    After investigating some, I noticed that if I import the videos into avidemux, the playback time is always much shorter than in smplayer. I'm assuming this is an FPS issue?
    I was using an older version of ffmpeg, but I just updated it and have also tried the "Screencastor" app mentioned in this thread, but the results seem to be the same. I've lowered my framerate to 25 but I didn't notice a difference.
    This is the command line:
    Code:
    ffmpeg -ss "00:00:06" -f "x11grab" -r:v "25" -s:v "1680x1026" -i ":0+0,0" -codec:v "libx264" -crf "20" -me_method "epzs" -g "250" -subq "6" -keyint_min "25" -trellis "1" -bf "16" -threads "0" -b:v "700k" -bt "4000k" -r:v "20" "/home/akovia/Videos/Screencasts/Screencastor_1373735425.mkv"
    Any ideas how I could fix this, or re-encode the video afterwards to to compensate for the framerate?
    Thanks.
    Xubuntu 12.04LTS (Precise) 3.2.0-51-generic x86_64
    Xfce 4 Desktop Environment - version 4.10.2 (Xfce 4.10)

  4. #224
    Join Date
    Sep 2006
    Beans
    3,473

    Re: HOWTO: Proper Screencasting on Linux

    Why not use the commands and method as shown in this HOWTO?

  5. #225
    Join Date
    Feb 2008
    Beans
    53
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: HOWTO: Proper Screencasting on Linux

    Quote Originally Posted by FakeOutdoorsman View Post
    Why not use the commands and method as shown in this HOWTO?
    That's what I've been using, I only tried screencastor since it wasn't working properly anyway. I thought that screencastor was just an ffmpeg command builder anyway, not adding anything of it's own. Am I wrong?
    Xubuntu 12.04LTS (Precise) 3.2.0-51-generic x86_64
    Xfce 4 Desktop Environment - version 4.10.2 (Xfce 4.10)

  6. #226
    Join Date
    Feb 2008
    Beans
    53
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: HOWTO: Proper Screencasting on Linux

    I'm happy to try anything to get some help here. I went ahead and ran the simplest command from page 1 with no audio.
    Code:
    ffmpeg -f x11grab -r 30 -s 1680x1026 -i :0.0 -vcodec libx264 -preset ultrafast -crf 0 -threads 0 output.mkv
    The result is the same.
    In smplayer, the time is 01:09.000
    in avidemux I get 00:51.833
    Xubuntu 12.04LTS (Precise) 3.2.0-51-generic x86_64
    Xfce 4 Desktop Environment - version 4.10.2 (Xfce 4.10)

  7. #227
    Join Date
    Sep 2006
    Beans
    3,473

    Re: HOWTO: Proper Screencasting on Linux

    Using this command in a recently compiled ffmpeg to create a 60 second output:
    Code:
    ffmpeg -f x11grab -r 30 -s 1680x1026 -i :0.0 -vcodec libx264 -preset ultrafast -crf 0 -t 60 output.mkv
    I can not duplicate this issue using Avidemux 2.5.6 (Arch Linux) or 2.5.4 (Ubuntu 13.04). ffmpeg and SMPlayer 0.8.3 in Ubuntu also show 00:01:00.

    When using the fake "ffmpeg" from the repository Avidemux 2.5.4 claims the file is 59.833 seconds in duration, but both ffmpeg versions and SMPlayer still show 00:01:00.

    So maybe you can try compiling ffmpeg instead of using the trash from the repository.

  8. #228
    Join Date
    Feb 2008
    Beans
    53
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: HOWTO: Proper Screencasting on Linux

    Quote Originally Posted by FakeOutdoorsman View Post
    Using this command in a recently compiled ffmpeg to create a 60 second output:
    Code:
    ffmpeg -f x11grab -r 30 -s 1680x1026 -i :0.0 -vcodec libx264 -preset ultrafast -crf 0 -t 60 output.mkv
    I can not duplicate this issue using Avidemux 2.5.6 (Arch Linux) or 2.5.4 (Ubuntu 13.04). ffmpeg and SMPlayer 0.8.3 in Ubuntu also show 00:01:00.

    When using the fake "ffmpeg" from the repository Avidemux 2.5.4 claims the file is 59.833 seconds in duration, but both ffmpeg versions and SMPlayer still show 00:01:00.

    So maybe you can try compiling ffmpeg instead of using the trash from the repository.
    Ouch! I wasn't trying to offend anyone.
    In any case, I am very thankful you took the time to test it out with my programs.

    I followed your outstanding guide like I did ages ago, but of course this time there were problems and it took me three times to get what I hope is right. First, when I paste the commands into my terminal, for some reason the last command never executes, and I didn't notice the first time around. I had to hit enter after each paste ended and before the next paste. Then I noticed another error when pilling GIT.
    Code:
    WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-OWZOd8/pkcs11
    Apparently this is a long standing bug in xubuntu (among other non gnome desktops).

    When I got to the end of the third try, I tried your command to check the version.
    Code:
    $ ffmpeg 2>&1 | head -n1
    WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-OWZOd8/pkcs11: No such file or directory
    *sigh*
    I then tried with ffmpeg --version and got the following.
    Code:
    ffmpeg --version
    WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-OWZOd8/pkcs11: No such file or directory
    ffmpeg version 0.10.7-6:0.10.7-0jon1~precise Copyright (c) 2000-2013 the FFmpeg developers
      built on Jul 15 2013 21:25:07 with gcc 4.6.3
      configuration: --arch=i386 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.10.7-0jon1~precise' --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/i386-linux-gnu --enable-shared --disable-static
      avutil      configuration: --arch=i386 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.10.7-0jon1~precise' --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/i386-linux-gnu/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver
      avcodec     configuration: --arch=i386 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.10.7-0jon1~precise' --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/i386-linux-gnu/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc --enable-libvo-amrwbenc
      avformat    configuration: --arch=i386 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.10.7-0jon1~precise' --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/i386-linux-gnu/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver
      avdevice    configuration: --arch=i386 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.10.7-0jon1~precise' --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/i386-linux-gnu/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver
      avfilter    configuration: --arch=i386 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.10.7-0jon1~precise' --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/i386-linux-gnu/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver
      swscale     configuration: --arch=i386 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.10.7-0jon1~precise' --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/i386-linux-gnu/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver
      swresample  configuration: --arch=i386 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.10.7-0jon1~precise' --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/i386-linux-gnu/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver
      postproc    configuration: --arch=i386 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.10.7-0jon1~precise' --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/i386-linux-gnu/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver
      libavutil      51. 35.100 / 51. 35.100
      libavcodec     53. 61.100 / 53. 61.100
      libavformat    53. 32.100 / 53. 32.100
      libavdevice    53.  4.100 / 53.  4.100
      libavfilter     2. 61.100 /  2. 61.100
      libswscale      2.  1.100 /  2.  1.100
      libswresample   0.  6.100 /  0.  6.100
      libpostproc    52.  0.100 / 52.  0.100
    Missing argument for option '-version'
    Since it did seem to be the right version, I tried another test and unfortunately I still get the same results.

    Avidemux 2.5.6 - 00:29.933
    SMPlayer0.8.5 - 00:42

    I am a moderator over at fanart.tv and am trying to make tutorials. The first few I posted never raised any flags. Then while making a few small tuts for some individuals that needed help, they kept saying they couldn't play them back. (windows users) I directed them to either VLC or MPC-HC for playback and have heard mixed results. I'm not certain if this time discrepancy is to blame or not, but when i was trying to find the root of the problem, this stood out. I do like repositories that auto-update because otherwise I'll forget to keep things updated myself, so I apologize for taking the lazy way out. At this point I'm willing to try anything as I really do need this functionality. I tried all the other programs when I started doing this, but none met my needs like this does.

    I hacked together a script until I ran upon a nice one I found and have been using ever since. It's actually a couple of scripts for both audio and non audio captures, but I've only ever used the non audio and the terminate ones tied to some hotkeys. Here it is in case you find anything fishy.
    Code:
    #!/bin/bash
    
        # SCREENCAST = LOSSLESS SCREENCAST
    
        # =============
        # USER SETTINGS
        # =============
        input=$(zenity --text "Name of Video?" --entry)
        OUTPUT="/home/akovia/Videos/Screencasts"
        KEYBOARDSTART="[ Super + F5 ] keys pressed"
        KEYBOARDSTOP="[ Super + F7 ] keys pressed"
        # =============
    
        # =========
        # VARIABLES
        # =========
        SIZE="1680x1026"
        RATE="30"
        VCODEC="libx264"
    
        PIXELS="yuv420p"
        PRESET="ultrafast"
        # =========
    
          # ===========
          # INFORMATION
          # ===========
          
          # ==========================================
          # keyboard bindings for chosen keys [rc.xml]
          # ==========================================
          # <keybind key="A-F1"><action name="Execute"><command>screencast</command></action></keybind>
          # <keybind key="A-F3"><action name="Execute"><command>screencast-stop</command></action></keybind>
          # ==========================================
    
          # ==============================
          # terminal conversion MKV >> MP4
          # ==============================
          # ffmpeg -i screencast.mkv -c:v libx264 -preset fast -crf 18 -y screencast.mp4
          # ==============================
    
          # ===============================
          # thunar custom action MKV >> MP4
          # ===============================
          # terminal --title="Screencast MKV Conversion to MP4" --geometry="200x35" --icon="$HOME/.icons/ffmpeg/convert.png" -e " ffmpeg -i %f -c:v libx264 -preset fast -crf 18 -y `basename %f .mkv`.mp4"
          # ===============================
    
        # ============
        # SCRIPT BELOW
        # ============
        
        # notification - starting
        notify-send -t 6000 "$KEYBOARDSTART : screencast will begin in 6 seconds"
        
        key-mon &
        
        # pause!
        sleep 6
     
    
        # start screencasting losslessly without audio
        ffmpeg -f x11grab -s $SIZE -r $RATE -i :0.0 -vcodec $VCODEC -preset $PRESET -crf 0 -threads 0 -y "$OUTPUT"/"$input".mkv
    
        ## screencast-stop ## << script (assigned to keyboard shortcut) silently brings the ffmpeg process to a halt here! >>
    
        # notification - completion
        notify-send -t 3000  "$KEYBOARDSTOP : Screencast finished   :-)"
    
        # pause
        sleep 3
    
        # open thunar to show video
        thunar "$OUTPUT"
    Thanks again for taking your time to try and reproduce. I understand if you don't want to take it any further, but I'm open to try any suggestions short of a new OS install.
    Cheers
    Xubuntu 12.04LTS (Precise) 3.2.0-51-generic x86_64
    Xfce 4 Desktop Environment - version 4.10.2 (Xfce 4.10)

  9. #229
    Join Date
    Oct 2013
    Beans
    1

    Re: HOWTO: Proper Screencasting on Linux

    Is this possible...
    Lets say i want to screen capture 2 videos which are on separate monitors. Could i capture both video and sound from these 2 videos at the same time?

  10. #230
    Join Date
    Sep 2006
    Beans
    3,473

    Re: HOWTO: Proper Screencasting on Linux

    Should be possible. From the FFmpeg x11grab docs:

    Code:
    [hostname]:display_number.screen_number[+x_offset,y_offset]
    hostname:display_number.screen_number specifies the X11 display name of the screen to grab from. hostname can be omitted, and defaults to "localhost". The environment variable DISPLAY contains the default display name.

    x_offset and y_offset specify the offsets of the grabbed area with respect to the top-left border of the X11 screen. They default to 0.

    Check the X11 documentation (e.g. man X) for more detailed information.

    Use the dpyinfo program for getting basic information about the properties of your X11 display (e.g. grep for "name" or "dimensions").
    From "man x":
    Code:
           displaynumber
                   The  phrase  "display" is usually used to refer to a collection
                   of monitors that share a common set of input devices (keyboard,
                   mouse,  tablet, etc.).  Most workstations tend to only have one
                   display.  Larger, multi-user systems, however, frequently  have
                   several  displays  so  that  more  than one person can be doing
                   graphics work at once.  To avoid confusion, each display  on  a
                   machine  is assigned a display number (beginning at 0) when the
                   X server for that display is started.  The display number  must
                   always be given in a display name.
    
           screennumber
                   Some displays share their input devices among two or more moni‐
                   tors.  These may be configured  as  a  single  logical  screen,
                   which  allows  windows to move across screens, or as individual
                   screens, each with their own set  of  windows.   If  configured
                   such  that each monitor has its own set of windows, each screen
                   is assigned a screen number (beginning at 0) when the X  server
                   for  that  display  is  started.   If  the screen number is not
                   given, screen 0 will be used.
    I only have one screen, but I guess you would try something like:
    Code:
    ffmpeg -f x11grab -framerate 25 -video_size 1680x1050 -i :0.0 -f x11grab -framerate 25 -video_size 1680x1050 -i :0.1 -c:v libx264 -crf 0 -preset ultrafast output.mkv
    I assume this will create two separate video streams (one per screen) into one output file. You didn't mention if you wanted them combined (side-by-side for example) or anything.
    Last edited by FakeOutdoorsman; October 21st, 2013 at 01:03 AM.

Page 23 of 25 FirstFirst ... 132122232425 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
  •