Advertisement
Guest User

Untitled

a guest
Mar 12th, 2014
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 KB | None | 0 0
  1. -------------- Shell script (recordwindow.sh)
  2.  
  3. #!/bin/sh
  4.  
  5. #Get file name
  6. read -e -p "Enter the path and name of file with out extension e.g. ~/video NOT ~/video.mp4 : " NAME
  7. INFO=$(xwininfo -frame)
  8.  
  9. #get window size
  10. WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' |\
  11. grep -oEe '[0-9]+x[0-9]+')
  12.  
  13. #get window offset
  14. WIN_XY=$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' |\
  15. grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/+/,/' )
  16.  
  17. #capture and encode video
  18. ffmpeg -f x11grab -y -r 24 -s $WIN_GEO -i :0.0+$WIN_XY -vcodec libx264 -crf 18 $NAME.mp4
  19.  
  20. ---------------------------------------
  21.  
  22. # FFMPEG output
  23.  
  24. aiena@linux-hofs:~/SCRIPTS> ./recordwindow.sh
  25. Enter the path and name of file with out extension e.g. ~/video NOT ~/video.mp4 : /home/aiena/tmp1
  26. ffmpeg version 2.1.3 Copyright (c) 2000-2013 the FFmpeg developers
  27. built on Feb 12 2014 20:11:32 with gcc 4.8 (SUSE Linux)
  28. 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
  29. libavutil 52. 48.101 / 52. 48.101
  30. libavcodec 55. 39.101 / 55. 39.101
  31. libavformat 55. 19.104 / 55. 19.104
  32. libavdevice 55. 5.100 / 55. 5.100
  33. libavfilter 3. 90.100 / 3. 90.100
  34. libavresample 1. 1. 0 / 1. 1. 0
  35. libswscale 2. 5.101 / 2. 5.101
  36. libswresample 0. 17.104 / 0. 17.104
  37. libpostproc 52. 3.100 / 52. 3.100
  38. [x11grab @ 0x1ec45e0] device: :0.0+0,0 -> display: :0.0 x: 0 y: 0 width: 1366 height: 741
  39. [x11grab @ 0x1ec45e0] shared memory extension found
  40. Input #0, x11grab, from ':0.0+0,0':
  41. Duration: N/A, start: 1394637155.863753, bitrate: 777374 kb/s
  42. Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1366x741, 777374 kb/s, 24 tbr, 1000k tbn, 24 tbc
  43. [swscaler @ 0x1eae180] deprecated pixel format used, make sure you did set range correctly
  44. No pixel format specified, yuv444p for H.264 encoding chosen.
  45. Use -pix_fmt yuv420p for compatibility with outdated media players.
  46. [libx264 @ 0x1ee3580] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
  47. [libx264 @ 0x1ee3580] profile High 4:4:4 Predictive, level 3.2, 4:4:4 8-bit
  48. [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
  49. Output #0, mp4, to '/home/aiena/tmp1.mp4':
  50. Metadata:
  51. encoder : Lavf55.19.104
  52. Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 1366x741, q=-1--1, 12288 tbn, 24 tbc
  53. Stream mapping:
  54. Stream #0:0 -> #0:0 (rawvideo -> libx264)
  55. Press [q] to stop, [?] for help
  56. [swscaler @ 0x1eae180] Warning: data is not aligned! This can lead to a speedloss
  57. frame= 233 fps= 23 q=-1.0 Lsize= 347kB time=00:00:09.62 bitrate= 295.5kbits/s
  58. video:344kB audio:0kB subtitle:0 global headers:0kB muxing overhead 1.013026%
  59. [libx264 @ 0x1ee3580] frame I:2 Avg QP:11.61 size: 63462
  60. [libx264 @ 0x1ee3580] frame P:63 Avg QP:16.44 size: 3210
  61. [libx264 @ 0x1ee3580] frame B:168 Avg QP:25.16 size: 131
  62. [libx264 @ 0x1ee3580] consecutive B-frames: 3.9% 0.0% 0.0% 96.1%
  63. [libx264 @ 0x1ee3580] mb I I16..4: 52.4% 29.6% 18.0%
  64. [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%
  65. [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%
  66. [libx264 @ 0x1ee3580] 8x8 transform intra:29.2% inter:42.3%
  67. [libx264 @ 0x1ee3580] coded y,u,v intra: 12.1% 3.5% 3.8% inter: 0.2% 0.0% 0.0%
  68. [libx264 @ 0x1ee3580] i16 v,h,dc,p: 44% 56% 0% 0%
  69. [libx264 @ 0x1ee3580] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 11% 59% 0% 0% 0% 0% 0% 0%
  70. [libx264 @ 0x1ee3580] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 35% 29% 14% 2% 3% 4% 4% 4% 4%
  71. [libx264 @ 0x1ee3580] Weighted P-Frames: Y:0.0% UV:0.0%
  72. [libx264 @ 0x1ee3580] ref P L0: 40.7% 10.6% 40.3% 8.4%
  73. [libx264 @ 0x1ee3580] ref B L0: 80.2% 17.3% 2.5%
  74. [libx264 @ 0x1ee3580] ref B L1: 96.8% 3.2%
  75. [libx264 @ 0x1ee3580] kb/s:289.40
  76. Received signal 2: terminating.
  77.  
  78. aiena@linux-hofs:~/SCRIPTS>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement