Skip to content

Instantly share code, notes, and snippets.

@joelio
Created December 3, 2012 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelio/7c9ae49caee0833832d5 to your computer and use it in GitHub Desktop.
Save joelio/7c9ae49caee0833832d5 to your computer and use it in GitHub Desktop.
Output from screencaptuire
Port 8090
# bind to all IPs aliased or not
BindAddress 0.0.0.0
# max number of simultaneous clients
MaxClients 4
# max bandwidth per-client (kb/s)
MaxBandwidth 10000
# Suppress that if you want to launch ffserver as a daemon.
NoDaemon
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 800K
</Feed>
<Stream test.ts>
Feed feed1.ffm
Format mpegts
AudioCodec libmp3lame
AudioBitRate 128
AudioChannels 2
AudioSampleRate 44100
AVOptionAudio flags +global_header
VideoBitRate 800
VideoFrameRate 25
VideoSize 1920x1088
VideoCodec libx264
AVOptionVideo flags +global_header
</Stream>
videoconf@vc-mcuk-seating:~/stream$ screencap
ffmpeg version 0.10.6-6:0.10.6-0ubuntu0jon1~precise1 Copyright (c) 2000-2012 the FFmpeg developers
built on Nov 12 2012 13:11:38 with gcc 4.6.3
configuration: --arch=amd64 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.10.6-0ubuntu0jon1~precise1' --libdir=/usr/lib/x86_64-linux-gnu --disable-stripping --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/x86_64-linux-gnu --enable-shared --disable-static
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
[alsa @ 0xd9c4a0] Estimating duration from bitrate, this may be inaccurate
Input #0, alsa, from 'hw:0,0':
Duration: N/A, start: 1354558396.829604, bitrate: N/A
Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
[x11grab @ 0xda47c0] device: :0.0+0,0 -> display: :0.0 x: 0 y: 0 width: 1920 height: 1080
[x11grab @ 0xda47c0] shared memory extension found
[x11grab @ 0xda47c0] Estimating duration from bitrate, this may be inaccurate
Input #1, x11grab, from ':0.0+0,0':
Duration: N/A, start: 1354558396.871842, bitrate: 1658880 kb/s
Stream #1:0: Video: rawvideo (BGRA / 0x41524742), bgra, 1920x1080, 1658880 kb/s, 25 tbr, 1000k tbn, 25 tbc
[buffer @ 0xda1f80] w:1920 h:1080 pixfmt:bgra tb:1/1000000 sar:0/1 sws_param:
[scale @ 0xda2060] w:1920 h:1080 fmt:bgra -> w:1920 h:1088 fmt:yuv420p flags:0x4
x264 [error]: invalid profile: 1
[libx264 @ 0xdc2ee0] Error setting profile 1.
Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
Stream #0:0: Audio: mp3, 44100 Hz, 2 channels, s16, 2000 kb/s
Stream #0:1: Video: h264, yuv420p, 1920x1088, q=11-51, 2000 kb/s, 1000k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le -> libmp3lame)
Stream #1:0 -> #0:1 (rawvideo -> libx264)
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
screencap() {
RESOLUTION="1920x1080" # Make this the capture size
QUALITY="libvpx-1080p" # Run ls /usr/share/ffmpeg and pick a preset
THREADS="4" # Change this to the amount of cpu threads you want ffmpeg to use
OUTPUT="http://localhost:8090/feed1.ffm" # Leave the extension, change the file name to whatever
#OUTPUT="test.mkv"
ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -r 25 -s $RESOLUTION -i :0.0+0,0 -acodec aac -strict experimental -vcodec libx264 -vpre $QUALITY -threads $THREADS -sameq -y $OUTPUT
}
@joelio
Copy link
Author

joelio commented Dec 3, 2012

videoconf@vc-mcuk-seating:~/stream$ cat /usr/share/ffmpeg/libvpx-1080p.ffpreset
g=120
lag-in-frames=16
deadline=good
cpu-used=0
vprofile=1
qmax=51
qmin=11
slices=4
b=2M

ignored unless using -pass 2

maxrate=24M
minrate=100k
auto-alt-ref=1
arnr-maxframes=7
arnr-strength=5
arnr-type=centered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment