Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] using ffmpeg for screen cast
Date: Mon, 27 Jun 2011 14:03:59
Message-Id: 201106271435.22541.michaelkintzios@gmail.com
In Reply to: Re: [gentoo-user] [OT] using ffmpeg for screen cast by Stroller
1 On Monday 27 Jun 2011 12:08:17 Stroller wrote:
2 > On 26 June 2011, at 19:54, Mick wrote:
3
4 > >> Try passing "-sameq"
5 > >
6 > > WOW! Exceptional improvement in a single stroke! Thanks! :)
7 > >
8 > > Why is it that ffmpeg degrades the quality with default settings? What
9 > > does it assume that the setting is? (sorry for the newbie Qs, but this
10 > > area is until now outside my cognitive map! ;-)
11 >
12 > I don't know about the "default" settings, but I would interpret the file
13 > extension of your original command as telling mplayer that "the
14 > destination file should be encoded as mpeg2". This is a pretty poor codec
15 > by today's standards.
16 >
17 > I could well be wrong, though. Do you know what format the output file is?
18
19 No, I have no idea. I assume it is capturing my desktop in some raw video
20 format - whatever that means. What would X11 feed to x11grab?
21
22
23 > IMO you're best encoding to h264 (in an mp4 container) for distribution,
24 > but I think it's possible the encoding load of that might affect your
25 > screencast. So you might wish to use sameq or the r210 or rawvideo codecs
26 > and then transcode to h264 (or WebM or whatever) afterwards.
27
28 I changed the output file to mp4 and it transcodes it accordingly! :)
29
30 ffmpeg -f x11grab -s xga -r 25 -i :0.0 -sameq -aspect 4:3 /tmp/out.mp4
31 FFmpeg version SVN-r25767, Copyright (c) 2000-2010 the FFmpeg developers
32 built on Jan 30 2011 17:04:59 with gcc 4.4.4
33 configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --
34 mandir=/usr/share/man --enable-static --enable-shared --cc=x86_64-pc-linux-
35 gnu-gcc --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --
36 disable-stripping --disable-debug --disable-doc --disable-network --disable-
37 static --disable-vdpau --enable-libmp3lame --enable-libvorbis --enable-libx264
38 --enable-libxvid --enable-libfaac --enable-nonfree --disable-indev=v4l --
39 disable-indev=oss --disable-indev=jack --enable-x11grab --disable-outdev=oss
40 --enable-libopencore-amrwb --enable-libopencore-amrnb --enable-librtmp --
41 disable-altivec --cpu=core2 --enable-hardcoded-tables
42 libavutil 50.33. 0 / 50.33. 0
43 libavcore 0.13. 0 / 0.13. 0
44 libavcodec 52.96. 0 / 52.96. 0
45 libavformat 52.84. 0 / 52.84. 0
46 libavdevice 52. 2. 2 / 52. 2. 2
47 libavfilter 1.62. 0 / 1.62. 0
48 libswscale 0.12. 0 / 0.12. 0
49 libpostproc 51. 2. 0 / 51. 2. 0
50 [x11grab @ 0x1a52510] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1024
51 height: 768
52 [x11grab @ 0x1a52510] shared memory extension found
53 [x11grab @ 0x1a52510] Estimating duration from bitrate, this may be inaccurate
54 Input #0, x11grab, from ':0.0':
55 Duration: N/A, start: 1309180986.812527, bitrate: 629145 kb/s
56 Stream #0.0: Video: rawvideo, bgra, 1024x768, 629145 kb/s, 25 tbr, 1000k
57 tbn, 25 tbc
58 [buffer @ 0x1a7db80] w:1024 h:768 pixfmt:bgra
59 [ffsink @ 0x1a7ddf0] auto-inserting filter 'auto-inserted scaler 0' between
60 the filter 'src' and the filter 'out'
61 [scale @ 0x1a7e110] w:1024 h:768 fmt:bgra -> w:1024 h:768 fmt:yuv420p
62 flags:0xa0000004
63 Output #0, mp4, to '/tmp/out.mp4':
64 Metadata:
65 encoder : Lavf52.84.0
66 Stream #0.0: Video: mpeg4, yuv420p, 1024x768 [PAR 1:1 DAR 4:3], q=2-31,
67 200 kb/s, 25 tbn, 25 tbc
68 Stream mapping:
69 Stream #0.0 -> #0.0
70 Press [q] to stop encoding
71 frame= 14 fps= 0 q=0.0 size= 702kB time=0.68 bitrate=8454.1kbits/s
72 dup=frame= 27 fps= 25 q=0.0 size= 1056kB time=1.20 bitrate=7212.1kbits/s
73 dup=frame= 40 fps= 25 q=0.0 size= 1411kB time=1.72 bitrate=6720.9kbits/s
74 dup=
75 [snip...]
76
77
78 Then it plays it as such:
79
80 mplayer /tmp/out.mp4
81 MPlayer SVN-r32624-4.4.4 (C) 2000-2010 MPlayer Team
82
83 Playing /tmp/out.mp4.
84 libavformat file format detected.
85 [lavf] stream 0: video (mpeg4), -vid 0
86 VIDEO: [MP4V] 1024x768 24bpp 25.000 fps 5798.3 kbps (707.8 kbyte/s)
87 Clip info:
88 major_brand: isom
89 minor_version: 512
90 compatible_brands: isomiso2mp41
91 encoder: Lavf52.84.0
92 ==========================================================================
93 Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
94 Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
95 ==========================================================================
96 Audio: no sound
97 Starting playback...
98 Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
99 VO: [xv] 1024x768 => 1024x768 Planar YV12
100 V: 19.1 0/ 0 5% 0% 0.0% 0 0
101
102
103 Exiting... (End of file)
104
105
106 Not sure how to define the vcodec to be h264. Is ffodivx the same as h264?
107
108
109 > > Now, I hope I'm not getting greedy, but how do I add voice recording to
110 > > the above stanza? Or do I have to record voice and then package it
111 > > along with the video in a container as a separate step?
112 >
113 > EXAMPLES
114 > Video and Audio grabbing
115 > FFmpeg can grab video and audio from devices given that you specify
116 > the input format and device.
117 >
118 > ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0
119 > /tmp/out.mpg
120 >
121 > Note that you must activate the right video source and channel
122 > before launching FFmpeg with any TV viewer such as xawtv
123 > (<http://linux.bytesex.org/xawtv/>) by Gerd Knorr. You also have to
124 > set the audio recording levels correctly with a standard mixer.
125 >
126 > Audacity is widely used for simple audio editing.
127
128 Great! Thanks Stroller. :)
129
130 --
131 Regards,
132 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] [OT] using ffmpeg for screen cast Leonardo Guilherme <leonardo.guilherme@×××××.com>