public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] [OT] using ffmpeg for screen cast
@ 2011-06-26 17:28 Mick
  2011-06-26 17:48 ` David Abbott
  2011-06-26 18:09 ` Albert Hopkins
  0 siblings, 2 replies; 8+ messages in thread
From: Mick @ 2011-06-26 17:28 UTC (permalink / raw
  To: gentoo-user


[-- Attachment #1.1: Type: Text/Plain, Size: 350 bytes --]

Hi All,

I was trying to record my desktop using:

ffmpeg -f x11grab -s xga -r 25 -i :0.0 -aspect 4:3 /tmp/out.mpg

but the result is rather blurred as you can see in the attached screenshot, 
when I play it with mplayer.

Is there some other option (codec) I should add to improve the quality of the 
captured image?
-- 
Regards,
Mick

[-- Attachment #1.2: mpg.png --]
[-- Type: image/png, Size: 259899 bytes --]

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [OT] using ffmpeg for screen cast
  2011-06-26 17:28 [gentoo-user] [OT] using ffmpeg for screen cast Mick
@ 2011-06-26 17:48 ` David Abbott
  2011-06-26 18:09 ` Albert Hopkins
  1 sibling, 0 replies; 8+ messages in thread
From: David Abbott @ 2011-06-26 17:48 UTC (permalink / raw
  To: gentoo-user

On Sun, Jun 26, 2011 at 1:28 PM, Mick <michaelkintzios@gmail.com> wrote:
> Hi All,
>
> I was trying to record my desktop using:
>
> ffmpeg -f x11grab -s xga -r 25 -i :0.0 -aspect 4:3 /tmp/out.mpg
>
> but the result is rather blurred as you can see in the attached screenshot,
> when I play it with mplayer.
>
> Is there some other option (codec) I should add to improve the quality of the
> captured image?
> --
> Regards,
> Mick

I have used recordmydesktop and received good results;
recordmydesktop -device hw:1 --width 1200 --height 800 -x 1900 -y 30 -o test.ogv

control alt p to pause
control alt s to stop

Adjust to taste that is on a dual screen.
HTH
David



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [OT] using ffmpeg for screen cast
  2011-06-26 17:28 [gentoo-user] [OT] using ffmpeg for screen cast Mick
  2011-06-26 17:48 ` David Abbott
@ 2011-06-26 18:09 ` Albert Hopkins
  2011-06-26 18:54   ` Mick
  1 sibling, 1 reply; 8+ messages in thread
From: Albert Hopkins @ 2011-06-26 18:09 UTC (permalink / raw
  To: gentoo-user



On Sunday, June 26 at 18:28 (+0100), Mick said:

> Hi All,
> 
> I was trying to record my desktop using:
> 
> ffmpeg -f x11grab -s xga -r 25 -i :0.0 -aspect 4:3 /tmp/out.mpg
> 
> but the result is rather blurred as you can see in the attached screenshot, 
> when I play it with mplayer.
> 
> Is there some other option (codec) I should add to improve the quality of the 
> captured image?

Try passing "-sameq"

-a





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [OT] using ffmpeg for screen cast
  2011-06-26 18:09 ` Albert Hopkins
@ 2011-06-26 18:54   ` Mick
  2011-06-27 11:08     ` Stroller
  0 siblings, 1 reply; 8+ messages in thread
From: Mick @ 2011-06-26 18:54 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 1284 bytes --]

On Sunday 26 Jun 2011 19:09:40 Albert Hopkins wrote:
> On Sunday, June 26 at 18:28 (+0100), Mick said:
> > Hi All,
> > 
> > I was trying to record my desktop using:
> > 
> > ffmpeg -f x11grab -s xga -r 25 -i :0.0 -aspect 4:3 /tmp/out.mpg
> > 
> > but the result is rather blurred as you can see in the attached
> > screenshot, when I play it with mplayer.
> > 
> > Is there some other option (codec) I should add to improve the quality of
> > the captured image?
> 
> Try passing "-sameq"
> 
> -a

WOW!  Exceptional improvement in a single stroke!  Thanks!  :)

Why is it that ffmpeg degrades the quality with default settings?  What does 
it assume that the setting is? (sorry for the newbie Qs, but this area is 
until now outside my cognitive map! ;-)

Thank you both for your suggestions.  The recordmydesktop looks good, but I am 
not sure if I will have to transcode it to make sure that it would also work 
for MSWindows users?  Is ogg MSWindows 'compatible'?

Now, I hope I'm not getting greedy, but how do I add voice recording to the 
above stanza?  Or do I have to record voice and then package it along with the 
video in a container as a separate step?

Once I achieve that how can I go back and edit the voice part?
-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [OT] using ffmpeg for screen cast
  2011-06-26 18:54   ` Mick
@ 2011-06-27 11:08     ` Stroller
  2011-06-27 13:35       ` Mick
  0 siblings, 1 reply; 8+ messages in thread
From: Stroller @ 2011-06-27 11:08 UTC (permalink / raw
  To: gentoo-user


On 26 June 2011, at 19:54, Mick wrote:
>>> ...
>>> ffmpeg -f x11grab -s xga -r 25 -i :0.0 -aspect 4:3 /tmp/out.mpg
>>> 
>>> but the result is rather blurred as you can see in the attached
>>> screenshot, when I play it with mplayer.
>> ...
>> Try passing "-sameq"
> 
> WOW!  Exceptional improvement in a single stroke!  Thanks!  :)
> 
> Why is it that ffmpeg degrades the quality with default settings?  What does 
> it assume that the setting is? (sorry for the newbie Qs, but this area is 
> until now outside my cognitive map! ;-)

I don't know about the "default" settings, but I would interpret the file extension of your original command as telling mplayer that "the destination file should be encoded as mpeg2". This is a pretty poor codec by today's standards.

I could well be wrong, though. Do you know what format the output file is?

IMO you're best encoding to h264 (in an mp4 container) for distribution, but I think it's possible the encoding load of that might affect your screencast. So you might wish to use sameq or the r210 or rawvideo codecs and then transcode to h264 (or WebM or whatever) afterwards.

> Now, I hope I'm not getting greedy, but how do I add voice recording to the 
> above stanza?  Or do I have to record voice and then package it along with the 
> video in a container as a separate step?

EXAMPLES                                                                        
   Video and Audio grabbing                                                     
       FFmpeg can grab video and audio from devices given that you specify the  
       input format and device.                                                 
                                                                                
               ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg

       Note that you must activate the right video source and channel before    
       launching FFmpeg with any TV viewer such as xawtv                        
       (<http://linux.bytesex.org/xawtv/>) by Gerd Knorr. You also have to set  
       the audio recording levels correctly with a standard mixer. 

Audacity is widely used for simple audio editing.

Stroller.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [OT] using ffmpeg for screen cast
  2011-06-27 11:08     ` Stroller
@ 2011-06-27 13:35       ` Mick
  2011-06-27 14:14         ` Leonardo Guilherme
  0 siblings, 1 reply; 8+ messages in thread
From: Mick @ 2011-06-27 13:35 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 5419 bytes --]

On Monday 27 Jun 2011 12:08:17 Stroller wrote:
> On 26 June 2011, at 19:54, Mick wrote:

> >> Try passing "-sameq"
> > 
> > WOW!  Exceptional improvement in a single stroke!  Thanks!  :)
> > 
> > Why is it that ffmpeg degrades the quality with default settings?  What
> > does it assume that the setting is? (sorry for the newbie Qs, but this
> > area is until now outside my cognitive map! ;-)
> 
> I don't know about the "default" settings, but I would interpret the file
> extension of your original command as telling mplayer that "the
> destination file should be encoded as mpeg2". This is a pretty poor codec
> by today's standards.
> 
> I could well be wrong, though. Do you know what format the output file is?

No, I have no idea.  I assume it is capturing my desktop in some raw video 
format - whatever that means.  What would X11 feed to x11grab?


> IMO you're best encoding to h264 (in an mp4 container) for distribution,
> but I think it's possible the encoding load of that might affect your
> screencast. So you might wish to use sameq or the r210 or rawvideo codecs
> and then transcode to h264 (or WebM or whatever) afterwards.

I changed the output file to mp4 and it transcodes it accordingly!  :)

 ffmpeg -f x11grab -s xga -r 25 -i :0.0 -sameq -aspect 4:3 /tmp/out.mp4
FFmpeg version SVN-r25767, Copyright (c) 2000-2010 the FFmpeg developers
  built on Jan 30 2011 17:04:59 with gcc 4.4.4
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --
mandir=/usr/share/man --enable-static --enable-shared --cc=x86_64-pc-linux-
gnu-gcc --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --
disable-stripping --disable-debug --disable-doc --disable-network --disable-
static --disable-vdpau --enable-libmp3lame --enable-libvorbis --enable-libx264 
--enable-libxvid --enable-libfaac --enable-nonfree --disable-indev=v4l --
disable-indev=oss --disable-indev=jack --enable-x11grab --disable-outdev=oss 
--enable-libopencore-amrwb --enable-libopencore-amrnb --enable-librtmp --
disable-altivec --cpu=core2 --enable-hardcoded-tables
  libavutil     50.33. 0 / 50.33. 0
  libavcore      0.13. 0 /  0.13. 0
  libavcodec    52.96. 0 / 52.96. 0
  libavformat   52.84. 0 / 52.84. 0
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.62. 0 /  1.62. 0
  libswscale     0.12. 0 /  0.12. 0
  libpostproc   51. 2. 0 / 51. 2. 0
[x11grab @ 0x1a52510] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1024 
height: 768
[x11grab @ 0x1a52510] shared memory extension  found
[x11grab @ 0x1a52510] Estimating duration from bitrate, this may be inaccurate
Input #0, x11grab, from ':0.0':
  Duration: N/A, start: 1309180986.812527, bitrate: 629145 kb/s
    Stream #0.0: Video: rawvideo, bgra, 1024x768, 629145 kb/s, 25 tbr, 1000k 
tbn, 25 tbc
[buffer @ 0x1a7db80] w:1024 h:768 pixfmt:bgra
[ffsink @ 0x1a7ddf0] auto-inserting filter 'auto-inserted scaler 0' between 
the filter 'src' and the filter 'out'
[scale @ 0x1a7e110] w:1024 h:768 fmt:bgra -> w:1024 h:768 fmt:yuv420p 
flags:0xa0000004
Output #0, mp4, to '/tmp/out.mp4':
  Metadata:
    encoder         : Lavf52.84.0
    Stream #0.0: Video: mpeg4, yuv420p, 1024x768 [PAR 1:1 DAR 4:3], q=2-31, 
200 kb/s, 25 tbn, 25 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
frame=   14 fps=  0 q=0.0 size=     702kB time=0.68 bitrate=8454.1kbits/s 
dup=frame=   27 fps= 25 q=0.0 size=    1056kB time=1.20 bitrate=7212.1kbits/s 
dup=frame=   40 fps= 25 q=0.0 size=    1411kB time=1.72 bitrate=6720.9kbits/s 
dup=
[snip...]


Then it plays it as such:

mplayer /tmp/out.mp4 
MPlayer SVN-r32624-4.4.4 (C) 2000-2010 MPlayer Team

Playing /tmp/out.mp4.
libavformat file format detected.
[lavf] stream 0: video (mpeg4), -vid 0
VIDEO:  [MP4V]  1024x768  24bpp  25.000 fps  5798.3 kbps (707.8 kbyte/s)
Clip info:
 major_brand: isom
 minor_version: 512
 compatible_brands: isomiso2mp41
 encoder: Lavf52.84.0
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Audio: no sound
Starting playback...
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 1024x768 => 1024x768 Planar YV12 
V:  19.1   0/  0  5%  0%  0.0% 0 0 


Exiting... (End of file)


Not sure how to define the vcodec to be h264.  Is ffodivx the same as h264?


> > Now, I hope I'm not getting greedy, but how do I add voice recording to
> > the above stanza?  Or do I have to record voice and then package it
> > along with the video in a container as a separate step?
> 
> EXAMPLES
>    Video and Audio grabbing
>        FFmpeg can grab video and audio from devices given that you specify
> the input format and device.
> 
>                ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0
> /tmp/out.mpg
> 
>        Note that you must activate the right video source and channel
> before launching FFmpeg with any TV viewer such as xawtv
>        (<http://linux.bytesex.org/xawtv/>) by Gerd Knorr. You also have to
> set the audio recording levels correctly with a standard mixer.
> 
> Audacity is widely used for simple audio editing.

Great!  Thanks Stroller.  :)

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [OT] using ffmpeg for screen cast
  2011-06-27 13:35       ` Mick
@ 2011-06-27 14:14         ` Leonardo Guilherme
  2011-06-27 14:47           ` Mick
  0 siblings, 1 reply; 8+ messages in thread
From: Leonardo Guilherme @ 2011-06-27 14:14 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 5698 bytes --]

2011/6/27 Mick <michaelkintzios@gmail.com>

> On Monday 27 Jun 2011 12:08:17 Stroller wrote:
> > On 26 June 2011, at 19:54, Mick wrote:
>
> > >> Try passing "-sameq"
> > >
> > > WOW!  Exceptional improvement in a single stroke!  Thanks!  :)
> > >
> > > Why is it that ffmpeg degrades the quality with default settings?  What
> > > does it assume that the setting is? (sorry for the newbie Qs, but this
> > > area is until now outside my cognitive map! ;-)
> >
> > I don't know about the "default" settings, but I would interpret the file
> > extension of your original command as telling mplayer that "the
> > destination file should be encoded as mpeg2". This is a pretty poor codec
> > by today's standards.
> >
> > I could well be wrong, though. Do you know what format the output file
> is?
>
> No, I have no idea.  I assume it is capturing my desktop in some raw video
> format - whatever that means.  What would X11 feed to x11grab?
>
>
> > IMO you're best encoding to h264 (in an mp4 container) for distribution,
> > but I think it's possible the encoding load of that might affect your
> > screencast. So you might wish to use sameq or the r210 or rawvideo codecs
> > and then transcode to h264 (or WebM or whatever) afterwards.
>
> I changed the output file to mp4 and it transcodes it accordingly!  :)
>
>  ffmpeg -f x11grab -s xga -r 25 -i :0.0 -sameq -aspect 4:3 /tmp/out.mp4
> FFmpeg version SVN-r25767, Copyright (c) 2000-2010 the FFmpeg developers
>  built on Jan 30 2011 17:04:59 with gcc 4.4.4
>  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --
> mandir=/usr/share/man --enable-static --enable-shared --cc=x86_64-pc-linux-
> gnu-gcc --enable-gpl --enable-version3 --enable-postproc --enable-avfilter
> --
> disable-stripping --disable-debug --disable-doc --disable-network
> --disable-
> static --disable-vdpau --enable-libmp3lame --enable-libvorbis
> --enable-libx264
> --enable-libxvid --enable-libfaac --enable-nonfree --disable-indev=v4l --
> disable-indev=oss --disable-indev=jack --enable-x11grab
> --disable-outdev=oss
> --enable-libopencore-amrwb --enable-libopencore-amrnb --enable-librtmp --
> disable-altivec --cpu=core2 --enable-hardcoded-tables
>  libavutil     50.33. 0 / 50.33. 0
>  libavcore      0.13. 0 /  0.13. 0
>  libavcodec    52.96. 0 / 52.96. 0
>  libavformat   52.84. 0 / 52.84. 0
>  libavdevice   52. 2. 2 / 52. 2. 2
>  libavfilter    1.62. 0 /  1.62. 0
>  libswscale     0.12. 0 /  0.12. 0
>  libpostproc   51. 2. 0 / 51. 2. 0
> [x11grab @ 0x1a52510] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1024
> height: 768
> [x11grab @ 0x1a52510] shared memory extension  found
> [x11grab @ 0x1a52510] Estimating duration from bitrate, this may be
> inaccurate
> Input #0, x11grab, from ':0.0':
>  Duration: N/A, start: 1309180986.812527, bitrate: 629145 kb/s
>    Stream #0.0: Video: rawvideo, bgra, 1024x768, 629145 kb/s, 25 tbr, 1000k
> tbn, 25 tbc
> [buffer @ 0x1a7db80] w:1024 h:768 pixfmt:bgra
> [ffsink @ 0x1a7ddf0] auto-inserting filter 'auto-inserted scaler 0' between
> the filter 'src' and the filter 'out'
> [scale @ 0x1a7e110] w:1024 h:768 fmt:bgra -> w:1024 h:768 fmt:yuv420p
> flags:0xa0000004
> Output #0, mp4, to '/tmp/out.mp4':
>  Metadata:
>    encoder         : Lavf52.84.0
>    Stream #0.0: Video: mpeg4, yuv420p, 1024x768 [PAR 1:1 DAR 4:3], q=2-31,
> 200 kb/s, 25 tbn, 25 tbc
> Stream mapping:
>  Stream #0.0 -> #0.0
> Press [q] to stop encoding
> frame=   14 fps=  0 q=0.0 size=     702kB time=0.68 bitrate=8454.1kbits/s
> dup=frame=   27 fps= 25 q=0.0 size=    1056kB time=1.20
> bitrate=7212.1kbits/s
> dup=frame=   40 fps= 25 q=0.0 size=    1411kB time=1.72
> bitrate=6720.9kbits/s
> dup=
> [snip...]
>
>
> Then it plays it as such:
>
> mplayer /tmp/out.mp4
> MPlayer SVN-r32624-4.4.4 (C) 2000-2010 MPlayer Team
>
> Playing /tmp/out.mp4.
> libavformat file format detected.
> [lavf] stream 0: video (mpeg4), -vid 0
> VIDEO:  [MP4V]  1024x768  24bpp  25.000 fps  5798.3 kbps (707.8 kbyte/s)
> Clip info:
>  major_brand: isom
>  minor_version: 512
>  compatible_brands: isomiso2mp41
>  encoder: Lavf52.84.0
> ==========================================================================
> Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
> Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
> ==========================================================================
> Audio: no sound
> Starting playback...
> Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
> VO: [xv] 1024x768 => 1024x768 Planar YV12
> V:  19.1   0/  0  5%  0%  0.0% 0 0
>
>
> Exiting... (End of file)
>
>
> Not sure how to define the vcodec to be h264.  Is ffodivx the same as h264?
>
>
> > > Now, I hope I'm not getting greedy, but how do I add voice recording to
> > > the above stanza?  Or do I have to record voice and then package it
> > > along with the video in a container as a separate step?
> >
> > EXAMPLES
> >    Video and Audio grabbing
> >        FFmpeg can grab video and audio from devices given that you
> specify
> > the input format and device.
> >
> >                ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0
> > /tmp/out.mpg
> >
> >        Note that you must activate the right video source and channel
> > before launching FFmpeg with any TV viewer such as xawtv
> >        (<http://linux.bytesex.org/xawtv/>) by Gerd Knorr. You also have
> to
> > set the audio recording levels correctly with a standard mixer.
> >
> > Audacity is widely used for simple audio editing.
>
> Great!  Thanks Stroller.  :)
>
> --
> Regards,
> Mick
>

This link was very helpful to me, maybe it can be to you:

http://verb3k.wordpress.com/2010/01/26/how-to-do-proper-screencasts-on-linux/

[-- Attachment #2: Type: text/html, Size: 6903 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] [OT] using ffmpeg for screen cast
  2011-06-27 14:14         ` Leonardo Guilherme
@ 2011-06-27 14:47           ` Mick
  0 siblings, 0 replies; 8+ messages in thread
From: Mick @ 2011-06-27 14:47 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 364 bytes --]

On Monday 27 Jun 2011 15:14:28 Leonardo Guilherme wrote:

> This link was very helpful to me, maybe it can be to you:
> 
> http://verb3k.wordpress.com/2010/01/26/how-to-do-proper-screencasts-on-linu
> x/

This is excellent info.  Just what I was looking for, with a lot of detailed 
explanation and examples too.  Thanks for sharing!
-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-06-27 14:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-26 17:28 [gentoo-user] [OT] using ffmpeg for screen cast Mick
2011-06-26 17:48 ` David Abbott
2011-06-26 18:09 ` Albert Hopkins
2011-06-26 18:54   ` Mick
2011-06-27 11:08     ` Stroller
2011-06-27 13:35       ` Mick
2011-06-27 14:14         ` Leonardo Guilherme
2011-06-27 14:47           ` Mick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox