Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------- Shell script (recordwindow.sh)
- #!/bin/sh
- #Get file name
- read -e -p "Enter the path and name of file with out extension e.g. ~/video NOT ~/video.mp4 : " NAME
- INFO=$(xwininfo -frame)
- #get window size
- WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' |\
- grep -oEe '[0-9]+x[0-9]+')
- #get window offset
- WIN_XY=$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' |\
- grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/+/,/' )
- #capture and encode video
- ffmpeg -f x11grab -y -r 24 -s $WIN_GEO -i :0.0+$WIN_XY -vcodec libx264 -crf 18 $NAME.mp4
- ---------------------------------------
- # FFMPEG output
- aiena@linux-hofs:~/SCRIPTS> ./recordwindow.sh
- Enter the path and name of file with out extension e.g. ~/video NOT ~/video.mp4 : /home/aiena/tmp1
- ffmpeg version 2.1.3 Copyright (c) 2000-2013 the FFmpeg developers
- built on Feb 12 2014 20:11:32 with gcc 4.8 (SUSE Linux)
- configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared --disable-static --enable-debug --disable-stripping --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -g -fPIC -I/usr/include/gsm' --enable-gpl --enable-x11grab --enable-version3 --enable-pthreads --enable-avfilter --enable-libpulse --enable-libvpx --enable-libopus --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libxvid --enable-libx264 --enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-postproc --enable-libdc1394 --enable-librtmp --enable-libfreetype --enable-avresample --enable-libtwolame --enable-libvo-aacenc --enable-gnutls
- libavutil 52. 48.101 / 52. 48.101
- libavcodec 55. 39.101 / 55. 39.101
- libavformat 55. 19.104 / 55. 19.104
- libavdevice 55. 5.100 / 55. 5.100
- libavfilter 3. 90.100 / 3. 90.100
- libavresample 1. 1. 0 / 1. 1. 0
- libswscale 2. 5.101 / 2. 5.101
- libswresample 0. 17.104 / 0. 17.104
- libpostproc 52. 3.100 / 52. 3.100
- [x11grab @ 0x1ec45e0] device: :0.0+0,0 -> display: :0.0 x: 0 y: 0 width: 1366 height: 741
- [x11grab @ 0x1ec45e0] shared memory extension found
- Input #0, x11grab, from ':0.0+0,0':
- Duration: N/A, start: 1394637155.863753, bitrate: 777374 kb/s
- Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1366x741, 777374 kb/s, 24 tbr, 1000k tbn, 24 tbc
- [swscaler @ 0x1eae180] deprecated pixel format used, make sure you did set range correctly
- No pixel format specified, yuv444p for H.264 encoding chosen.
- Use -pix_fmt yuv420p for compatibility with outdated media players.
- [libx264 @ 0x1ee3580] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
- [libx264 @ 0x1ee3580] profile High 4:4:4 Predictive, level 3.2, 4:4:4 8-bit
- [libx264 @ 0x1ee3580] 264 - core 135 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=18.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
- Output #0, mp4, to '/home/aiena/tmp1.mp4':
- Metadata:
- encoder : Lavf55.19.104
- Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 1366x741, q=-1--1, 12288 tbn, 24 tbc
- Stream mapping:
- Stream #0:0 -> #0:0 (rawvideo -> libx264)
- Press [q] to stop, [?] for help
- [swscaler @ 0x1eae180] Warning: data is not aligned! This can lead to a speedloss
- frame= 233 fps= 23 q=-1.0 Lsize= 347kB time=00:00:09.62 bitrate= 295.5kbits/s
- video:344kB audio:0kB subtitle:0 global headers:0kB muxing overhead 1.013026%
- [libx264 @ 0x1ee3580] frame I:2 Avg QP:11.61 size: 63462
- [libx264 @ 0x1ee3580] frame P:63 Avg QP:16.44 size: 3210
- [libx264 @ 0x1ee3580] frame B:168 Avg QP:25.16 size: 131
- [libx264 @ 0x1ee3580] consecutive B-frames: 3.9% 0.0% 0.0% 96.1%
- [libx264 @ 0x1ee3580] mb I I16..4: 52.4% 29.6% 18.0%
- [libx264 @ 0x1ee3580] mb P I16..4: 1.8% 0.7% 0.5% P16..4: 1.4% 0.2% 0.1% 0.0% 0.0% skip:95.3%
- [libx264 @ 0x1ee3580] mb B I16..4: 0.2% 0.2% 0.0% B16..8: 1.5% 0.0% 0.0% direct: 0.0% skip:98.1% L0:53.4% L1:46.4% BI: 0.1%
- [libx264 @ 0x1ee3580] 8x8 transform intra:29.2% inter:42.3%
- [libx264 @ 0x1ee3580] coded y,u,v intra: 12.1% 3.5% 3.8% inter: 0.2% 0.0% 0.0%
- [libx264 @ 0x1ee3580] i16 v,h,dc,p: 44% 56% 0% 0%
- [libx264 @ 0x1ee3580] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 11% 59% 0% 0% 0% 0% 0% 0%
- [libx264 @ 0x1ee3580] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 35% 29% 14% 2% 3% 4% 4% 4% 4%
- [libx264 @ 0x1ee3580] Weighted P-Frames: Y:0.0% UV:0.0%
- [libx264 @ 0x1ee3580] ref P L0: 40.7% 10.6% 40.3% 8.4%
- [libx264 @ 0x1ee3580] ref B L0: 80.2% 17.3% 2.5%
- [libx264 @ 0x1ee3580] ref B L1: 96.8% 3.2%
- [libx264 @ 0x1ee3580] kb/s:289.40
- Received signal 2: terminating.
- aiena@linux-hofs:~/SCRIPTS>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement