Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Using ffmpeg to record my desktop
New Posts  All Forums:Forum Nav:

Using ffmpeg to record my desktop

post #1 of 25
Thread Starter 
I have dual monitors and I want a way to record both of them. My resolution is 3360x1050.

This is what I have so far...
Code:
ffmpeg -f x11grab -r 25 -s 3360x1050 -i :0.0 ~/Desktop/record.mpg

but I get a bunch of errors like this:
Code:
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=234679 size=246916
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=234679 size=246916
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=236708 size=246916
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=236708 size=246916
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=238749 size=246916
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=238749 size=246916
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=240790 size=246916
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=240790 size=246916
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=242831 size=246916
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=242831 size=246916
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=244872 size=246916
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=244872 size=246916
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=246913 size=246916
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=246913 size=246916
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=234703 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=234703 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=236732 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=236732 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=238773 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=238773 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=240814 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=240814 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=242855 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=242855 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=244896 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=244896 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=246937 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=246937 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=248978 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=248978 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=251019 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=251019 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=253060 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=253060 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=255101 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=255101 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=257142 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=257142 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=259183 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=259183 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=261224 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=261224 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=263265 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=263265 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=265306 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=265306 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=267347 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=267347 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=269388 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=269388 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=271429 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=271429 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=273470 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=273470 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=275511 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=275511 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=277552 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=277552 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=279593 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=279593 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=281634 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=281634 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=283675 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=283675 size=287093
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=285716 size=287093
[mpeg @ 0x829fa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x829fa0] buffer underflow i=0 bufi=285716 size=287093
frame=   15 fps=  0 q=31.0 size=     780kB time=0.56 bitrate=11410.3kbits/s dup=frame=   28 fps= 23 q=31.0 size=     954kB time=1.08 bitrate=7236.3kbits/s dup=1frame=   43 fps= 24 q=31.0 size=    1128kB time=1.68 bitrate=5500.3kbits/s dup=2frame=   56 fps= 24 q=31.0 size=    1302kB time=2.20 bitrate=4848.2kbits/s dup=3frame=   71 fps= 24 q=31.0 size=    1478kB time=2.80 bitrate=4324.2kbits/s dup=4frame=   87 fps= 24 q=31.0 size=    1808kB time=3.44 bitrate=4305.6kbits/s dup=5frame=   99 fps= 24 q=31.0 size=    1984kB time=3.92 bitrate=4146.2kbits/s dup=6frame=  112 fps= 24 q=31.0 size=    2158kB time=4.44 bitrate=3981.6kbits/s dup=7frame=  127 fps= 24 q=31.0 size=    2336kB time=5.04 bitrate=3796.9kbits/s dup=8frame=  140 fps= 25 q=31.0 size=    2512kB time=5.56 bitrate=3701.1kbits/s dup=9frame=  155 fps= 25 q=31.0 size=    2688kB time=6.16 bitrate=3574.7kbits/s dup=1frame=  168 fps= 25 q=31.0 size=    2862kB time=6.68 bitrate=3509.8kbits/s dup=1frame=  183 fps= 25 q=31.0 size=    3196kB time=7.28 bitrate=3596.4kbits/s dup=1frame=  196 fps= 25 q=31.0 size=    3370kB time=7.80 bitrate=3539.4kbits/s dup=1frame=  199 fps= 25 q=31.0 Lsize=    3374kB time=7.92 bitrate=3489.9kbits/s dup=134 drop=0    
video:3360kB audio:0kB global headers:0kB muxing overhead 0.423059% 

If I set it to 1680x1050, I get it to record half my desktop.

I have also tried messing with the xserver input which is :0.0 I have tried setting it to :1.0 and :0.1 but from my understanding, twinview uses 1 xserver stretched across both screens.

I'm really puzzled by this. If anyone could help, I'd appreciate it.

I also want to get audio recording to work. Here is my end goal:

I want to set some aliases to start different recordings:

1. Record my whole desktop with mic audio
2. Record my whole desktop with output audio
3. Record my first screen with mic
4. Record my first screen with output
5. Record my second screen with mic
6. Record my second screen with output
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
post #2 of 25
Every time that I've tried using ffmpeg to directly record X, it's never good quality or I get tons of errors spewed at me. Most people recommend you using Istanbul or recordMyDesktop instead.
post #3 of 25
Thread Starter 
I tried record my desktop but I don't get any output. It's just all gray.
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
post #4 of 25
Thread Starter 
minor update. I started using mp4 and the quality has gone up a ton. No more blockiness/pixelation.

Still can't get both screens...

WAIT MP4 allows me to get both screens!

Now, I need to just work out making it a bit smoother and then get the audio in there.
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
post #5 of 25
Still blocky for me when I use mp4. While it's perfectly possible to use ffmpeg directly, I always found it easier to use some of the popular recording software unless you're extremely tight on space.
post #6 of 25
Thread Starter 
Still getting just a gray box from it. mplay plays .ogg, right?
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
post #7 of 25
Thread Starter 
LOL actually, it looks like recordmydesktop DOES work. It's just smplayer won't play the .ogv
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
post #8 of 25
It should assuming it's still mpeg4 contained in .ogg. Remember Ogg Vorbis is just a container like Matroska.
post #9 of 25
Thread Starter 
It's the craziest thing. smplayer won't play the .ogv or when I convert it to an .mp4 container using ffmpeg. Firefox and VLC will play the .ogv
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
post #10 of 25
Thread Starter 
This is a real shame. Recordmydesktop does a great job umm recording my desktop but the .ogv file is unplayable in kdenlive, smplayer/mplayer (playable in VLC and Firefox) and I can't convert it using mencoder, ffmpeg, vlc, or handbrake.

Oh and uploading to youtube doesn't work either...
Edited by TFB - 1/17/11 at 12:14am
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Q9550 Gigabyte EP45-UD3P EVGA GTX 465 4x2GB G.Skill 1066 
Hard DriveOSMonitorPower
750GB WD Caviar Black Windows 7 ASUS VW224U Dual Screens Corsair 750w HX 
Case
CM Storm Sniper Black 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Using ffmpeg to record my desktop