2011/6/27 Mick <michaelkintz...@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/

Reply via email to